use of com.builtbroken.mc.core.content.resources.items.ItemGenMaterial in project Engine by VoltzEngine-Project.
the class Engine method init.
@EventHandler
public void init(FMLInitializationEvent evt) {
Engine.metadata.modId = References.NAME;
Engine.metadata.name = References.NAME;
Engine.metadata.description = References.NAME + " is a content creation toolkit";
Engine.metadata.url = "http://www.builtbroken.com";
Engine.metadata.version = References.VERSION;
Engine.metadata.authorList = Arrays.asList("DarkCow");
Engine.metadata.autogenerated = false;
//Late registration of content
if ((getConfig().hasKey("Content", "LoadOres") || metallicOresRequested) && getConfig().getBoolean("LoadOres", "Content", metallicOresRequested, "Loads up ore blocks and generators. Ore Generation can be disable separate if you want to keep the block for legacy purposes.")) {
ore = contentRegistry.newBlock("veStoneOre", new BlockOre("stone"), ItemBlockOre.class);
MetallicOres.registerSet(ore, getConfig());
}
if ((getConfig().hasKey("Content", "LoadGemOres") || gemOresRequested) && getConfig().getBoolean("LoadGemOres", "Content", gemOresRequested, "Loads up Gem Ores.")) {
gemOre = contentRegistry.newBlock("veGemOre", new BlockGemOre("stone"), ItemBlockGemOre.class);
GemOres.registerSet(gemOre, getConfig());
for (GemTypes types : GemTypes.values()) {
if (types.isRequested()) {
types.item = new ItemGem(types);
contentRegistry.newItem("Gem" + LanguageUtility.capitalizeFirst(types.name) + "Item", types.item);
for (Gems gem : Gems.values()) {
if (gem != Gems.UNKNOWN) {
OreDictionary.registerOre(types.oreDict + gem.getOreName(), types.stack(gem));
}
}
}
}
}
if (multiBlockRequested) {
multiBlock = new BlockMultiblock();
GameRegistry.registerBlock(multiBlock, ItemBlockMulti.class, "veMultiBlock");
NEIProxy.hideItem(multiBlock);
EnumMultiblock.register();
}
boolean forceLoadSheetMetal = (sheetMetalRequested || getConfig().hasKey("SheetMetalContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SheetMetalContent", true, "Forces the sheet metal items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadSimpleTools = (simpleToolsRequested || getConfig().hasKey("SimpleToolsContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SimpleToolsContent", true, "Forces the simple tools items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadCircuits = (circuitsRequested || getConfig().hasKey("Content", "LoadCircuits")) && getConfig().getBoolean("LoadCircuits", "Content", true, "Forces the circuit items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
boolean forceLoadCraftingParts = (craftingPartsRequested || getConfig().hasKey("Content", "LoadCraftingParts")) && getConfig().getBoolean("LoadCraftingParts", "Content", true, "Forces the crafting items(Motors, coils, simple electrical parts) to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
if (sheetMetalRequested || forceLoadSheetMetal) {
itemSheetMetalTools = getManager().newItem("veSheetMetalTools", ItemSheetMetalTools.class);
itemSheetMetal = getManager().newItem("veSheetMetal", ItemSheetMetal.class);
}
if (circuitsRequested || forceLoadCircuits) {
itemCircuits = getManager().newItem("veCircuits", ItemCircuits.class);
}
if (craftingPartsRequested || forceLoadCraftingParts) {
itemCraftingParts = getManager().newItem("veCraftingParts", ItemCraftingParts.class);
}
if (simpleToolsRequested || forceLoadSimpleTools) {
itemSimpleCraftingTools = getManager().newItem("veSimpleTools", ItemSimpleCraftingTool.class);
}
if (getConfig().getBoolean("LoadHeatedRocks", "Content", heatedRockRequested, "Loads up heated rocks which are used to give explosions an extra short term effect on stone.")) {
heatedStone = contentRegistry.newBlock("VEHeatedRock", BlockHeatedStone.class, ItemBlockMetadata.class);
NEIProxy.hideItem(heatedStone);
if (enabledHeatMap) {
HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.stone)), 600);
HeatedBlockRegistry.addNewHeatingConversion(Blocks.cobblestone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.cobblestone)), 600);
}
} else {
HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementData(Blocks.cobblestone, 1), 600);
}
logger.info("Starting resource generator");
long start = System.nanoTime();
for (DefinedGenItems genItem : DefinedGenItems.values()) {
if ((getConfig().hasKey("ForceLoadContent", genItem.name) || genItem.isRequested()) && getConfig().getBoolean(genItem.name, "ForceLoadContent", genItem.isRequested(), "Forces the items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.") || genItem.isRequested()) {
logger.info("\tGenerating " + genItem.name);
genItem.item = getManager().newItem("ve" + LanguageUtility.capitalizeFirst(genItem.name), new ItemGenMaterial(genItem));
for (GenMaterial mat : GenMaterial.values()) {
if (mat == GenMaterial.UNKNOWN || genItem.ignoreMaterials.contains(mat)) {
NEIProxy.hideItem(new ItemStack(genItem.item, 1, mat.ordinal()));
} else {
OreDictionary.registerOre(genItem.oreDict + LanguageUtility.capitalizeFirst(mat.name().toLowerCase()), genItem.stack(mat));
}
}
if (genItem == DefinedGenItems.INGOT && getConfig().getBoolean("EnableCheapSteelRecipe", "Content", true, "Enables iron ingot to steel ingot smelting recipe. Only disable if another recipe for steel exists or most items will be uncraftable.")) {
//TODO check to make sure doesn't conflict
GameRegistry.addSmelting(Items.iron_ingot, genItem.stack(GenMaterial.STEEL), 0f);
}
}
}
if (metallicOresRequested) {
//Register alt ore names
OreDictionary.registerOre("oreBauxite", MetallicOres.BAUXITE.stack());
OreDictionary.registerOre("oreMagnesite", MetallicOres.MAGNESITE.stack());
}
logger.info("Done... Took " + StringHelpers.formatTimeDifference(start, System.nanoTime()));
loader.init();
getManager().fireInit();
}
Aggregations