2017-02-23 13:29:43 +01:00
|
|
|
/*
|
|
|
|
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 TechReborn
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2016-07-15 12:28:41 +02:00
|
|
|
package techreborn.init;
|
|
|
|
|
2016-12-10 09:15:39 +01:00
|
|
|
import com.google.common.base.CaseFormat;
|
2016-07-16 11:44:54 +02:00
|
|
|
import com.google.common.collect.ImmutableList;
|
2016-07-15 12:28:41 +02:00
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.init.Items;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.fml.common.Loader;
|
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
2016-07-16 11:44:54 +02:00
|
|
|
import techreborn.Core;
|
2017-06-14 17:56:09 +02:00
|
|
|
import techreborn.blocks.BlockMachineFrames;
|
2017-06-12 11:55:26 +02:00
|
|
|
import techreborn.blocks.cable.BlockCable;
|
2016-07-16 11:44:54 +02:00
|
|
|
import techreborn.items.*;
|
2016-07-15 12:28:41 +02:00
|
|
|
|
|
|
|
public class OreDict {
|
|
|
|
|
2016-10-08 21:46:16 +02:00
|
|
|
private static final ImmutableList<String> plateGenIgnores = ImmutableList.of(
|
|
|
|
"hot", //Hot ingots
|
2016-12-10 09:15:39 +01:00
|
|
|
"mixed_metal", //Mixed metal has own version of plate
|
|
|
|
"iridium_alloy", //Iridium alloy is plate itself
|
2016-10-08 21:46:16 +02:00
|
|
|
ModItems.META_PLACEHOLDER //...
|
|
|
|
);
|
|
|
|
|
|
|
|
public static void init() {
|
2017-04-21 10:09:28 +02:00
|
|
|
if (Loader.isModLoaded("ic2")) {
|
2016-10-08 21:46:16 +02:00
|
|
|
Core.logHelper.info("IC2 installed, enabling integration");
|
|
|
|
IC2Dict.init();
|
|
|
|
}
|
|
|
|
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("reBattery", ModItems.RE_BATTERY);
|
2016-10-08 21:46:16 +02:00
|
|
|
|
|
|
|
OreDictionary.registerOre("circuitBasic", ItemParts.getPartByName("electronicCircuit"));
|
|
|
|
OreDictionary.registerOre("circuitAdvanced", ItemParts.getPartByName("advancedCircuit"));
|
|
|
|
OreDictionary.registerOre("circuitStorage", ItemParts.getPartByName("dataStorageCircuit"));
|
|
|
|
OreDictionary.registerOre("circuitElite", ItemParts.getPartByName("dataControlCircuit"));
|
|
|
|
OreDictionary.registerOre("circuitMaster", ItemParts.getPartByName("energyFlowCircuit"));
|
|
|
|
|
2017-06-14 17:56:09 +02:00
|
|
|
OreDictionary.registerOre("machineBlockBasic", BlockMachineFrames.getFrameByName("machine", 1));
|
|
|
|
OreDictionary.registerOre("machineBlockAdvanced", BlockMachineFrames.getFrameByName("advancedMachine", 1));
|
|
|
|
OreDictionary.registerOre("machineBlockElite", BlockMachineFrames.getFrameByName("highlyAdvancedMachine", 1));
|
2016-10-08 21:46:16 +02:00
|
|
|
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("lapotronCrystal", ModItems.LAPOTRONIC_CRYSTAL);
|
|
|
|
OreDictionary.registerOre("energyCrystal", ModItems.ENERGY_CRYSTAL);
|
2016-10-08 21:46:16 +02:00
|
|
|
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("drillBasic", ModItems.DIAMOND_DRILL);
|
|
|
|
OreDictionary.registerOre("drillDiamond", ModItems.DIAMOND_DRILL);
|
2016-10-08 21:46:16 +02:00
|
|
|
|
|
|
|
OreDictionary.registerOre("industrialTnt", Blocks.TNT);
|
|
|
|
OreDictionary.registerOre("craftingIndustrialDiamond", Items.DIAMOND);
|
2017-06-12 11:55:26 +02:00
|
|
|
OreDictionary.registerOre("insulatedGoldCableItem", BlockCable.getCableByName("insulatedgold"));
|
2016-10-08 21:46:16 +02:00
|
|
|
OreDictionary.registerOre("fertilizer", new ItemStack(Items.DYE, 1, 15));
|
|
|
|
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("ic2Generator", ModBlocks.SOLID_FUEL_GENEREATOR);
|
|
|
|
OreDictionary.registerOre("ic2SolarPanel", ModBlocks.SOLAR_PANEL);
|
|
|
|
OreDictionary.registerOre("ic2Macerator", ModBlocks.GRINDER);
|
|
|
|
OreDictionary.registerOre("ic2Extractor", ModBlocks.EXTRACTOR);
|
|
|
|
OreDictionary.registerOre("ic2Windmill", ModBlocks.WIND_MILL);
|
|
|
|
OreDictionary.registerOre("ic2Watermill", ModBlocks.WATER_MILL);
|
2016-10-08 21:46:16 +02:00
|
|
|
|
|
|
|
//OreDictionary.registerOre("uran235", nothing);
|
|
|
|
//OreDictionary.registerOre("uran238", nothing);
|
|
|
|
//OreDictionary.registerOre("smallUran235", nothing);
|
|
|
|
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("fenceIron", ModBlocks.REFINED_IRON_FENCE);
|
2017-04-21 10:09:28 +02:00
|
|
|
//TODO ic2 bug? Disabled as it crashes with this line
|
|
|
|
//OreDictionary.registerOre("woodRubber", ModBlocks.RUBBER_LOG);
|
2017-01-01 08:29:32 +01:00
|
|
|
OreDictionary.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS);
|
2016-10-08 21:46:16 +02:00
|
|
|
|
|
|
|
OreDictionary.registerOre("craftingGrinder", ItemParts.getPartByName("diamondGrindingHead"));
|
|
|
|
OreDictionary.registerOre("craftingGrinder", ItemParts.getPartByName("tungstenGrindingHead"));
|
|
|
|
OreDictionary.registerOre("craftingSuperconductor", ItemParts.getPartByName("superconductor"));
|
|
|
|
OreDictionary.registerOre("batteryUltimate", ItemParts.getPartByName("diamondGrindingHead"));
|
|
|
|
|
|
|
|
OreDictionary.registerOre("materialResin", ItemParts.getPartByName("rubberSap"));
|
|
|
|
OreDictionary.registerOre("materialRubber", ItemParts.getPartByName("rubber"));
|
2016-12-21 18:31:52 +01:00
|
|
|
OreDictionary.registerOre("itemRubber", ItemParts.getPartByName("rubber"));
|
2016-12-11 20:34:56 +01:00
|
|
|
OreDictionary.registerOre("pulpWood", ItemDusts.getDustByName("saw_dust"));
|
2016-10-08 21:46:16 +02:00
|
|
|
|
|
|
|
for (String type : ItemGems.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 02:08:13 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type));
|
2016-10-08 21:46:16 +02:00
|
|
|
boolean ignoreIt = false;
|
|
|
|
for (String ignore : plateGenIgnores)
|
|
|
|
if (type.startsWith(ignore))
|
|
|
|
ignoreIt = true;
|
|
|
|
if (!ignoreIt)
|
2016-12-10 09:15:39 +01:00
|
|
|
ItemPlates.registerType(type);
|
2016-10-08 21:46:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (String type : ItemIngots.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 00:59:27 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type));
|
2016-10-08 21:46:16 +02:00
|
|
|
boolean ignoreIt = false;
|
|
|
|
for (String ignore : plateGenIgnores)
|
|
|
|
if (type.startsWith(ignore))
|
|
|
|
ignoreIt = true;
|
|
|
|
if (!ignoreIt)
|
|
|
|
ItemPlates.registerType(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (String type : ItemPlates.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 00:59:27 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "plate_" + type), ItemPlates.getPlateByName(type));
|
2016-10-08 21:46:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (String type : ItemDusts.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 00:59:27 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "dust_" + type), ItemDusts.getDustByName(type));
|
2016-10-08 21:46:16 +02:00
|
|
|
}
|
|
|
|
|
2016-12-12 18:54:20 +01:00
|
|
|
for (String type : ItemDustsSmall.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 00:59:27 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "dust_tiny_" + type), ItemDustsSmall.getSmallDustByName(type));
|
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "dust_small_" + type), ItemDustsSmall.getSmallDustByName(type));
|
2016-12-12 18:54:20 +01:00
|
|
|
}
|
|
|
|
|
2016-10-08 21:46:16 +02:00
|
|
|
for (String type : ItemNuggets.types) {
|
|
|
|
if (type.equals(ModItems.META_PLACEHOLDER))
|
|
|
|
continue; //Aware of placeholders!
|
2016-12-22 00:59:27 +01:00
|
|
|
OreDictionary.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "nugget_" + type), ItemNuggets.getNuggetByName(type));
|
2016-10-08 21:46:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-07-15 12:28:41 +02:00
|
|
|
|
|
|
|
}
|