Search in sources :

Example 6 with BlockRegistryArboriculture

use of forestry.arboriculture.blocks.BlockRegistryArboriculture in project ForestryMC by ForestryMC.

the class ModuleArboriculture method registerRecipes.

@Override
public void registerRecipes() {
    ItemRegistryCore coreItems = ModuleCore.getItems();
    BlockRegistryArboriculture blocks = getBlocks();
    ItemRegistryArboriculture items = getItems();
    for (BlockArbLog log : blocks.logs) {
        ItemStack logInput = new ItemStack(log, 1, OreDictionary.WILDCARD_VALUE);
        ItemStack coalOutput = new ItemStack(Items.COAL, 1, 1);
        RecipeUtil.addSmelting(logInput, coalOutput, 0.15F);
    }
    List<IWoodType> allWoodTypes = new ArrayList<>();
    Collections.addAll(allWoodTypes, EnumForestryWoodType.VALUES);
    Collections.addAll(allWoodTypes, EnumVanillaWoodType.VALUES);
    for (IWoodType woodType : allWoodTypes) {
        ItemStack planks = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, false);
        ItemStack logs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
        ItemStack slabs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.SLAB, false);
        ItemStack fences = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.FENCE, false);
        ItemStack fenceGates = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.FENCE_GATE, false);
        ItemStack stairs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.STAIRS, false);
        ItemStack doors = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.DOOR, false);
        ItemStack fireproofPlanks = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, true);
        ItemStack fireproofLogs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, true);
        ItemStack fireproofSlabs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.SLAB, true);
        ItemStack fireproofFences = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.FENCE, true);
        ItemStack fireproofFenceGates = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.FENCE_GATE, true);
        ItemStack fireproofStairs = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.STAIRS, true);
        if (woodType instanceof EnumForestryWoodType) {
            planks.setCount(4);
            logs.setCount(1);
            RecipeUtil.addShapelessRecipe("planks_" + woodType.getName(), planks.copy(), logs.copy());
            slabs.setCount(6);
            planks.setCount(1);
            RecipeUtil.addRecipe("slabs_" + woodType.getName(), slabs.copy(), "###", '#', planks.copy());
            fences.setCount(3);
            planks.setCount(1);
            RecipeUtil.addRecipe("fences_" + woodType.getName(), fences.copy(), "#X#", "#X#", '#', planks.copy(), 'X', "stickWood");
            fenceGates.setCount(1);
            planks.setCount(1);
            RecipeUtil.addRecipe("fence_gates_" + woodType.getName(), fenceGates.copy(), "X#X", "X#X", '#', planks.copy(), 'X', "stickWood");
            stairs.setCount(4);
            planks.setCount(1);
            RecipeUtil.addRecipe("stairs_" + woodType.getName(), stairs.copy(), "#  ", "## ", "###", '#', planks.copy());
            doors.setCount(3);
            planks.setCount(1);
            RecipeUtil.addRecipe("doors_" + woodType.getName(), doors.copy(), "## ", "## ", "## ", '#', planks.copy());
        }
        fireproofPlanks.setCount(4);
        fireproofLogs.setCount(1);
        RecipeUtil.addShapelessRecipe("fireproof_planks_" + woodType.getName(), fireproofPlanks.copy(), fireproofLogs.copy());
        fireproofSlabs.setCount(6);
        fireproofPlanks.setCount(1);
        RecipeUtil.addRecipe("fireproof_slabs_" + woodType.getName(), fireproofSlabs.copy(), "###", '#', fireproofPlanks.copy());
        fireproofFences.setCount(3);
        fireproofPlanks.setCount(1);
        RecipeUtil.addRecipe("fireproof_fences_" + woodType.getName(), fireproofFences.copy(), "#X#", "#X#", '#', fireproofPlanks.copy(), 'X', "stickWood");
        fireproofFenceGates.setCount(1);
        fireproofPlanks.setCount(1);
        RecipeUtil.addRecipe("fireproof_fence_gates_" + woodType.getName(), fireproofFenceGates.copy(), "X#X", "X#X", '#', fireproofPlanks.copy(), 'X', "stickWood");
        fireproofStairs.setCount(4);
        fireproofPlanks.setCount(1);
        RecipeUtil.addRecipe("fireproof_stairs_" + woodType.getName(), fireproofStairs.copy(), "#  ", "## ", "###", '#', fireproofPlanks.copy());
        doors.setCount(3);
        fireproofPlanks.setCount(1);
        RecipeUtil.addRecipe("fireproof_doors_" + woodType.getName(), doors.copy(), "## ", "## ", "## ", '#', fireproofPlanks.copy());
        // Fabricator recipes
        if (ForestryAPI.enabledModules.containsAll(Arrays.asList(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY), new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE)))) {
            logs.setCount(1);
            fireproofLogs.setCount(1);
            RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[] { " # ", "#X#", " # ", '#', coreItems.refractoryWax, 'X', logs.copy() });
            planks.setCount(1);
            fireproofPlanks.setCount(5);
            RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), fireproofPlanks.copy(), new Object[] { "X#X", "#X#", "X#X", '#', coreItems.refractoryWax, 'X', planks.copy() });
        }
    }
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
        // SQUEEZER RECIPES
        int seedOilMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
        int juiceMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
        int mulchMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.mulch.apple");
        ItemStack mulch = new ItemStack(coreItems.mulch);
        RecipeManagers.squeezerManager.addRecipe(20, EnumFruit.CHERRY.getStack(), Fluids.SEED_OIL.getFluid(5 * seedOilMultiplier), mulch, 5);
        RecipeManagers.squeezerManager.addRecipe(60, EnumFruit.WALNUT.getStack(), Fluids.SEED_OIL.getFluid(18 * seedOilMultiplier), mulch, 5);
        RecipeManagers.squeezerManager.addRecipe(70, EnumFruit.CHESTNUT.getStack(), Fluids.SEED_OIL.getFluid(22 * seedOilMultiplier), mulch, 2);
        RecipeManagers.squeezerManager.addRecipe(10, EnumFruit.LEMON.getStack(), Fluids.JUICE.getFluid(juiceMultiplier * 2), mulch, (int) Math.floor(mulchMultiplier * 0.5f));
        RecipeManagers.squeezerManager.addRecipe(10, EnumFruit.PLUM.getStack(), Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.5f)), mulch, mulchMultiplier * 3);
        RecipeManagers.squeezerManager.addRecipe(10, EnumFruit.PAPAYA.getStack(), Fluids.JUICE.getFluid(juiceMultiplier * 3), mulch, (int) Math.floor(mulchMultiplier * 0.5f));
        RecipeManagers.squeezerManager.addRecipe(10, EnumFruit.DATES.getStack(), Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.25)), mulch, mulchMultiplier);
        RecipeUtil.addFermenterRecipes(new ItemStack(items.sapling, 1, OreDictionary.WILDCARD_VALUE), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
    }
    // Grafter
    RecipeUtil.addRecipe("grafter", items.grafter.getItemStack(), "  B", " # ", "#  ", 'B', "ingotBronze", '#', "stickWood");
    RecipeUtil.addRecipe("tree_chest", blocks.treeChest, " # ", "XYX", "XXX", '#', "blockGlass", 'X', "treeSapling", 'Y', "chestWood");
}
Also used : IWoodType(forestry.api.arboriculture.IWoodType) ItemRegistryArboriculture(forestry.arboriculture.items.ItemRegistryArboriculture) ItemRegistryCore(forestry.core.items.ItemRegistryCore) ResourceLocation(net.minecraft.util.ResourceLocation) ArrayList(java.util.ArrayList) BlockRegistryArboriculture(forestry.arboriculture.blocks.BlockRegistryArboriculture) EnumForestryWoodType(forestry.api.arboriculture.EnumForestryWoodType) BlockArbLog(forestry.arboriculture.blocks.BlockArbLog) ItemStack(net.minecraft.item.ItemStack)

Aggregations

BlockRegistryArboriculture (forestry.arboriculture.blocks.BlockRegistryArboriculture)6 ItemRegistryArboriculture (forestry.arboriculture.items.ItemRegistryArboriculture)3 Block (net.minecraft.block.Block)2 IBlockState (net.minecraft.block.state.IBlockState)2 EnumForestryWoodType (forestry.api.arboriculture.EnumForestryWoodType)1 IWoodType (forestry.api.arboriculture.IWoodType)1 BlockArbLog (forestry.arboriculture.blocks.BlockArbLog)1 BlockFruitPod (forestry.arboriculture.blocks.BlockFruitPod)1 CommandTree (forestry.arboriculture.commands.CommandTree)1 TileFruitPod (forestry.arboriculture.tiles.TileFruitPod)1 TileSapling (forestry.arboriculture.tiles.TileSapling)1 TreeDecorator (forestry.arboriculture.worldgen.TreeDecorator)1 ItemRegistryCore (forestry.core.items.ItemRegistryCore)1 PacketFXSignal (forestry.core.network.packets.PacketFXSignal)1 VillagerTradeLists (forestry.core.utils.VillagerTradeLists)1 ArrayList (java.util.ArrayList)1 ItemStack (net.minecraft.item.ItemStack)1 EnumFacing (net.minecraft.util.EnumFacing)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 VillagerRegistry (net.minecraftforge.fml.common.registry.VillagerRegistry)1