Search in sources :

Example 1 with BlockOre

use of com.builtbroken.mc.core.content.resources.ore.BlockOre 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();
}
Also used : ItemSheetMetal(com.builtbroken.mc.core.content.resources.items.ItemSheetMetal) ItemGenMaterial(com.builtbroken.mc.core.content.resources.items.ItemGenMaterial) ItemSimpleCraftingTool(com.builtbroken.mc.core.content.tool.ItemSimpleCraftingTool) BlockOre(com.builtbroken.mc.core.content.resources.ore.BlockOre) ItemBlockOre(com.builtbroken.mc.core.content.resources.ore.ItemBlockOre) ItemCircuits(com.builtbroken.mc.core.content.parts.ItemCircuits) ItemBlockOre(com.builtbroken.mc.core.content.resources.ore.ItemBlockOre) GenMaterial(com.builtbroken.mc.core.content.resources.GenMaterial) ItemGenMaterial(com.builtbroken.mc.core.content.resources.items.ItemGenMaterial) BlockHeatedStone(com.builtbroken.mc.core.content.blocks.BlockHeatedStone) PlacementDataExtended(com.builtbroken.mc.lib.world.edit.PlacementDataExtended) PlacementData(com.builtbroken.mc.lib.world.edit.PlacementData) BlockMultiblock(com.builtbroken.mc.framework.multiblock.BlockMultiblock) ItemSheetMetalTools(com.builtbroken.mc.core.content.tool.ItemSheetMetalTools) DefinedGenItems(com.builtbroken.mc.core.content.resources.DefinedGenItems) ItemCraftingParts(com.builtbroken.mc.core.content.parts.ItemCraftingParts) MRHandlerItemStack(com.builtbroken.mc.lib.recipe.item.MRHandlerItemStack) ItemStack(net.minecraft.item.ItemStack) ItemBlockMetadata(com.builtbroken.mc.prefab.tile.item.ItemBlockMetadata) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Aggregations

BlockHeatedStone (com.builtbroken.mc.core.content.blocks.BlockHeatedStone)1 ItemCircuits (com.builtbroken.mc.core.content.parts.ItemCircuits)1 ItemCraftingParts (com.builtbroken.mc.core.content.parts.ItemCraftingParts)1 DefinedGenItems (com.builtbroken.mc.core.content.resources.DefinedGenItems)1 GenMaterial (com.builtbroken.mc.core.content.resources.GenMaterial)1 ItemGenMaterial (com.builtbroken.mc.core.content.resources.items.ItemGenMaterial)1 ItemSheetMetal (com.builtbroken.mc.core.content.resources.items.ItemSheetMetal)1 BlockOre (com.builtbroken.mc.core.content.resources.ore.BlockOre)1 ItemBlockOre (com.builtbroken.mc.core.content.resources.ore.ItemBlockOre)1 ItemSheetMetalTools (com.builtbroken.mc.core.content.tool.ItemSheetMetalTools)1 ItemSimpleCraftingTool (com.builtbroken.mc.core.content.tool.ItemSimpleCraftingTool)1 BlockMultiblock (com.builtbroken.mc.framework.multiblock.BlockMultiblock)1 MRHandlerItemStack (com.builtbroken.mc.lib.recipe.item.MRHandlerItemStack)1 PlacementData (com.builtbroken.mc.lib.world.edit.PlacementData)1 PlacementDataExtended (com.builtbroken.mc.lib.world.edit.PlacementDataExtended)1 ItemBlockMetadata (com.builtbroken.mc.prefab.tile.item.ItemBlockMetadata)1 EventHandler (cpw.mods.fml.common.Mod.EventHandler)1 ItemStack (net.minecraft.item.ItemStack)1