Search in sources :

Example 21 with ItemRegistryCore

use of forestry.core.items.ItemRegistryCore in project ForestryMC by ForestryMC.

the class ModuleCore method registerRecipes.

@Override
public void registerRecipes() {
    BlockRegistryCore blocks = getBlocks();
    ItemRegistryCore items = getItems();
    ItemRegistryFluids fluidItems = ModuleFluids.getItems();
    /* SMELTING RECIPES */
    RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.APATITE, 1), items.apatite, 0.5f);
    RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.COPPER, 1), items.ingotCopper, 0.5f);
    RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.TIN, 1), items.ingotTin, 0.5f);
    RecipeUtil.addSmelting(new ItemStack(items.peat), items.ash, 0.0f);
    /* BRONZE INGOTS */
    if (Config.isCraftingBronzeEnabled()) {
        ItemStack ingotBronze = items.ingotBronze.copy();
        ingotBronze.setCount(4);
        RecipeUtil.addShapelessRecipe("bronze_ingot", ingotBronze, OreDictUtil.INGOT_TIN, OreDictUtil.INGOT_COPPER, OreDictUtil.INGOT_COPPER, OreDictUtil.INGOT_COPPER);
    }
    /* STURDY MACHINE */
    RecipeUtil.addRecipe("sturdy_casing", items.sturdyCasing, "###", "# #", "###", '#', OreDictUtil.INGOT_BRONZE);
    // / EMPTY CANS
    int canAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.can");
    ItemStack canOutput = fluidItems.canEmpty.getItemStack(canAmount);
    RecipeUtil.addRecipe("tin_can", canOutput, " # ", "# #", '#', OreDictUtil.INGOT_TIN);
    // / GEARS
    List<ItemStack> stoneGear = OreDictionary.getOres(OreDictUtil.GEAR_STONE);
    Object gearCenter;
    if (!stoneGear.isEmpty()) {
        gearCenter = OreDictUtil.GEAR_STONE;
    } else {
        gearCenter = OreDictUtil.INGOT_COPPER;
    }
    RecipeUtil.addRecipe("gear_bronze", items.gearBronze, " # ", "#X#", " # ", '#', OreDictUtil.INGOT_BRONZE, 'X', gearCenter);
    RecipeUtil.addRecipe("gear_copper", items.gearCopper, " # ", "#X#", " # ", '#', OreDictUtil.INGOT_COPPER, 'X', gearCenter);
    RecipeUtil.addRecipe("gear_tin", items.gearTin, " # ", "#X#", " # ", '#', OreDictUtil.INGOT_TIN, 'X', gearCenter);
    // / SURVIVALIST TOOLS
    RecipeUtil.addRecipe("bronze_pickaxe", items.bronzePickaxe, " X ", " X ", "###", '#', OreDictUtil.INGOT_BRONZE, 'X', OreDictUtil.STICK_WOOD);
    RecipeUtil.addRecipe("bronze_shovel", items.bronzeShovel, " X ", " X ", " # ", '#', OreDictUtil.INGOT_BRONZE, 'X', OreDictUtil.STICK_WOOD);
    RecipeUtil.addShapelessRecipe("pickaxe_kit", items.kitPickaxe, items.bronzePickaxe, items.carton);
    RecipeUtil.addShapelessRecipe("shovel_kit", items.kitShovel, items.bronzeShovel, items.carton);
    /* NATURALIST'S ARMOR */
    RecipeUtil.addRecipe("spectacles", items.spectacles, " X ", "Y Y", 'X', OreDictUtil.INGOT_BRONZE, 'Y', OreDictUtil.PANE_GLASS);
    // / WRENCH
    RecipeUtil.addRecipe("wrench", items.wrench, "# #", " # ", " # ", '#', OreDictUtil.INGOT_BRONZE);
    // / WEB
    RecipeUtil.addRecipe("silk_wisp_to_web", new ItemStack(Blocks.WEB, 4), "# #", " # ", "# #", '#', items.craftingMaterial.getSilkWisp());
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
        // / CARPENTER
        // Portable ANALYZER
        RecipeManagers.carpenterManager.addRecipe(100, new FluidStack(FluidRegistry.WATER, 2000), ItemStack.EMPTY, items.portableAlyzer.getItemStack(), "X#X", "X#X", "RDR", '#', OreDictUtil.PANE_GLASS, 'X', OreDictUtil.INGOT_TIN, 'R', OreDictUtil.DUST_REDSTONE, 'D', OreDictUtil.GEM_DIAMOND);
        // Camouflaged Paneling
        RecipeManagers.carpenterManager.addRecipe(50, Fluids.BIOMASS.getFluid(500), ItemStack.EMPTY, items.craftingMaterial.getCamouflagedPaneling(8), "Y#R", "BPB", "R#Y", '#', OreDictUtil.PLANK_WOOD, 'R', OreDictUtil.DUST_REDSTONE, 'P', OreDictUtil.PULP_WOOD, 'R', OreDictUtil.DYE_RED, 'B', OreDictUtil.DYE_BLUE, 'Y', OreDictUtil.DYE_YELLOW);
    } else {
        // Portable ANALYZER
        RecipeUtil.addRecipe("portable_alyzer", items.portableAlyzer.getItemStack(), "X#X", "X#X", "RDR", '#', OreDictUtil.PANE_GLASS, 'X', OreDictUtil.INGOT_TIN, 'R', OreDictUtil.DUST_REDSTONE, 'D', OreDictUtil.GEM_DIAMOND);
        // Camouflaged Paneling
        RecipeUtil.addRecipe("camoflaged_paneling", items.craftingMaterial.getCamouflagedPaneling(8), "WWW", "YBR", "WWW", 'W', OreDictUtil.PLANK_WOOD, 'Y', OreDictUtil.DYE_YELLOW, 'B', OreDictUtil.DYE_BLUE, 'R', OreDictUtil.DYE_RED);
    }
    // ANALYZER
    RecipeUtil.addRecipe("alyzer", blocks.analyzer, "XTX", " Y ", "X X", 'Y', items.sturdyCasing, 'T', items.portableAlyzer, 'X', OreDictUtil.INGOT_BRONZE);
    // Manure and Fertilizer
    int compostWheatAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.compost.wheat");
    if (compostWheatAmount > 0) {
        ItemStack compost = items.compost.getItemStack(compostWheatAmount);
        RecipeUtil.addRecipe("wheat_to_compost", compost, " X ", "X#X", " X ", '#', Blocks.DIRT, 'X', OreDictUtil.CROP_WHEAT);
    }
    int compostAshAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.compost.ash");
    if (compostAshAmount > 0) {
        ItemStack compost = items.compost.getItemStack(compostAshAmount);
        RecipeUtil.addRecipe("ash_to_compost", compost, " X ", "X#X", " X ", '#', Blocks.DIRT, 'X', OreDictUtil.DUST_ASH);
    }
    int fertilizerApatiteAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.fertilizer.apatite");
    if (fertilizerApatiteAmount > 0) {
        ItemStack fertilizer = items.fertilizerCompound.getItemStack(fertilizerApatiteAmount);
        RecipeUtil.addRecipe("sand_to_fertilizer", fertilizer, " # ", " X ", " # ", '#', OreDictUtil.SAND, 'X', OreDictUtil.GEM_APATITE);
    }
    int fertilizerAshAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.fertilizer.ash");
    if (fertilizerAshAmount > 0) {
        ItemStack fertilizer = items.fertilizerCompound.getItemStack(fertilizerAshAmount);
        RecipeUtil.addRecipe("ash_to_fertilizer", fertilizer, "###", "#X#", "###", '#', OreDictUtil.DUST_ASH, 'X', OreDictUtil.GEM_APATITE);
    }
    // Humus
    int humusCompostAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.humus.compost");
    if (humusCompostAmount > 0) {
        ItemStack humus = new ItemStack(blocks.humus, humusCompostAmount);
        RecipeUtil.addRecipe("compost_humus", humus, "###", "#X#", "###", '#', Blocks.DIRT, 'X', items.compost);
    }
    int humusFertilizerAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.humus.fertilizer");
    if (humusFertilizerAmount > 0) {
        ItemStack humus = new ItemStack(blocks.humus, humusFertilizerAmount);
        RecipeUtil.addRecipe("fertilizer_humus", humus, "###", "#X#", "###", '#', Blocks.DIRT, 'X', items.fertilizerCompound);
    }
    // Bog earth
    int bogEarthOutputBucket = ForestryAPI.activeMode.getIntegerSetting("recipe.output.bogearth.bucket");
    if (bogEarthOutputBucket > 0) {
        ItemStack bogEarth = blocks.bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, bogEarthOutputBucket);
        RecipeUtil.addRecipe("bucket_bog_earth", bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', Items.WATER_BUCKET, 'Y', OreDictUtil.SAND);
    }
    int bogEarthOutputCan = ForestryAPI.activeMode.getIntegerSetting("recipe.output.bogearth.can");
    if (bogEarthOutputCan > 0) {
        ItemStack bogEarth = blocks.bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, bogEarthOutputCan);
        ItemStack canWater = fluidItems.getContainer(EnumContainerType.CAN, FluidRegistry.WATER);
        ItemStack waxCapsuleWater = fluidItems.getContainer(EnumContainerType.CAPSULE, FluidRegistry.WATER);
        ItemStack refractoryWater = fluidItems.getContainer(EnumContainerType.REFRACTORY, FluidRegistry.WATER);
        RecipeUtil.addRecipe("can_bog_earth", bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', canWater, 'Y', OreDictUtil.SAND);
        RecipeUtil.addRecipe("capsule_bog_earth", bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', waxCapsuleWater, 'Y', OreDictUtil.SAND);
        RecipeUtil.addRecipe("refractory_capsule_bog_earth", bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', refractoryWater, 'Y', OreDictUtil.SAND);
    }
    // Crafting Material
    RecipeUtil.addRecipe("silk_to_string", new ItemStack(Items.STRING), "#", "#", "#", '#', items.craftingMaterial.getSilkWisp());
    // / Pipette
    RecipeUtil.addRecipe("pipette", items.pipette, "  #", " X ", "X  ", 'X', OreDictUtil.PANE_GLASS, '#', new ItemStack(Blocks.WOOL, 1, OreDictionary.WILDCARD_VALUE));
    // Storage Blocks
    {
        RecipeUtil.addRecipe("apatite_block", blocks.resourceStorageApatite, "###", "###", "###", '#', OreDictUtil.GEM_APATITE);
        RecipeUtil.addShapelessRecipe("block_to_apatite", new ItemStack(items.apatite, 9), OreDictUtil.BLOCK_APATITE);
    }
    {
        RecipeUtil.addRecipe("copper_block", blocks.resourceStorageCopper, "###", "###", "###", '#', OreDictUtil.INGOT_COPPER);
        ItemStack ingotCopper = items.ingotCopper.copy();
        ingotCopper.setCount(9);
        RecipeUtil.addShapelessRecipe("block_to_copper", ingotCopper, OreDictUtil.BLOCK_COPPER);
    }
    {
        RecipeUtil.addRecipe("tin_block", blocks.resourceStorageTin, "###", "###", "###", '#', OreDictUtil.INGOT_TIN);
        ItemStack ingotTin = items.ingotTin.copy();
        ingotTin.setCount(9);
        RecipeUtil.addShapelessRecipe("block_to_tin", ingotTin, OreDictUtil.BLOCK_TIN);
    }
    {
        RecipeUtil.addRecipe("bronze_block", blocks.resourceStorageBronze, "###", "###", "###", '#', OreDictUtil.INGOT_BRONZE);
        ItemStack ingotBronze = items.ingotBronze.copy();
        ingotBronze.setCount(9);
        RecipeUtil.addShapelessRecipe("block_to_bronze", ingotBronze, OreDictUtil.BLOCK_BRONZE);
    }
    if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.ARBORICULTURE))) {
        RecipeUtil.addSmelting(new ItemStack(items.ash, 2), new ItemStack(Items.COAL, 1, 1), 0.15F);
    }
    RecipeUtil.addRecipe("ash_brick", blocks.ashBrick, "A#A", "# #", "A#A", '#', Items.BRICK, 'A', OreDictUtil.DUST_ASH);
    RecipeUtil.addRecipe("ash_stairs", blocks.ashStairs, true, "#  ", "## ", "###", '#', Items.BRICK);
    // alternate recipes
    if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
        RecipeManagers.centrifugeManager.addRecipe(5, new ItemStack(Items.STRING), ImmutableMap.of(items.craftingMaterial.getSilkWisp(), 0.15f));
    }
}
Also used : BlockRegistryCore(forestry.core.blocks.BlockRegistryCore) ItemRegistryCore(forestry.core.items.ItemRegistryCore) FluidStack(net.minecraftforge.fluids.FluidStack) ResourceLocation(net.minecraft.util.ResourceLocation) ItemRegistryFluids(forestry.core.items.ItemRegistryFluids) ItemStack(net.minecraft.item.ItemStack)

Example 22 with ItemRegistryCore

use of forestry.core.items.ItemRegistryCore in project ForestryMC by ForestryMC.

the class PluginHarvestCraft method registerRecipes.

@Override
public void registerRecipes() {
    ImmutableList<String> berries = ImmutableList.of("cranberry", "blackberry", "blueberry", "raspberry", "strawberry");
    ImmutableList<String> fruits = ImmutableList.of("pineapple", "cactusfruit", "cantaloupe", "grape", "kiwi", "chilipepper");
    ImmutableList<String> treeFruits = ImmutableList.of("banana", "dragonfruit", "lemon", "lime", "mango", "orange", "papaya", "peach", "pear", "plum", "pomegranate", "starfruit", "apricot", "date", "fig", "grapefruit", "persimmon", "avocado", "coconut", "durian");
    ImmutableList<String> trees = ImmutableList.of("nutmeg", "olive", "peppercorn");
    ImmutableList<String> treesSpecial = ImmutableList.of("cinnamon", "maple", "paperbark", "vanillabean", // to prevent apples from getting double registered
    "apple");
    ImmutableList<String> herbs = ImmutableList.of("garlic");
    ImmutableList<String> spices = ImmutableList.of("ginger", "spiceleaf");
    ImmutableList<String> vegetables = ImmutableList.of("asparagus", "bean", "beet", "broccoli", "cauliflower", "celery", "leek", "lettuce", "onion", "parsnip", "radish", "rutabaga", "scallion", "soybean", "sweetpotato", "turnip", "whitemushroom", "artichoke", "bellpepper", "brusselsprout", "cabbage", "corn", "cucumber", "eggplant", "okra", "peas", "rhubarb", "seaweed", "tomato", "wintersquash", "zucchini", "bambooshoot", "spinach");
    ImmutableList<String> grains = ImmutableList.of("barley", "oats", "rye");
    ImmutableList<String> cropNuts = ImmutableList.of("peanut");
    ImmutableList<String> nuts = ImmutableList.of("walnut", "almond", "cashew", "chestnut", "pecan", "pistachio", // Cherries in forestry make seed oil
    "cherry");
    ImmutableList.Builder<String> genericCropsBuilder = ImmutableList.builder();
    genericCropsBuilder.add("cotton", "rice", "tealeaf", "coffeebean", "candleberry");
    genericCropsBuilder.addAll(herbs);
    genericCropsBuilder.addAll(spices);
    IFarmRegistry farmRegistry = ForestryAPI.farmRegistry;
    ImmutableList<String> genericCrops = genericCropsBuilder.build();
    ImmutableList.Builder<String> plants = ImmutableList.builder();
    int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 25;
    int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
    int wheatamount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.compost.wheat");
    PropertyInteger plantAGE = PropertyInteger.create("age", 0, 3);
    PropertyInteger fruitAGE = PropertyInteger.create("age", 0, 2);
    // Produce at least 1 mb of juice.
    juiceAmount = Math.max(juiceAmount, 1);
    for (String berryName : berries) {
        ItemStack berry = getItemStack(berryName + "item");
        ItemStack berrySeed = getItemStack(berryName + "seeditem");
        Block berryBlock = getBlock("pam" + berryName + "crop");
        if (berry != null) {
            RecipeManagers.squeezerManager.addRecipe(10, berry, Fluids.JUICE.getFluid(juiceAmount));
        }
        if (berrySeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, berrySeed, Fluids.SEED_OIL.getFluid(seedamount));
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && berrySeed != null && berryBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(berrySeed, berryBlock, plantAGE, 3, 0));
        }
        plants.add(berryName);
    }
    juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
    for (String fruitName : fruits) {
        ItemStack fruit = getItemStack(fruitName + "item");
        ItemStack fruitSeed = getItemStack(fruitName + "seeditem");
        Block fruitBlock = getBlock("pam" + fruitName + "crop");
        if (fruit != null) {
            RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount));
        }
        if (fruitSeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, fruitSeed, Fluids.SEED_OIL.getFluid(seedamount));
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitSeed != null && fruitBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(fruitSeed, fruitBlock, plantAGE, 3, 0));
        }
        plants.add(fruitName);
    }
    // vegetables produce less juice
    juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 2;
    // Produce at least 1 mb of juice.
    juiceAmount = Math.max(juiceAmount, 1);
    for (String vegetableName : vegetables) {
        ItemStack vegetable = getItemStack(vegetableName + "item");
        ItemStack vegetableSeed = getItemStack(vegetableName + "seeditem");
        Block vegetableBlock = getBlock("pam" + vegetableName + "crop");
        if (vegetable != null) {
            RecipeManagers.squeezerManager.addRecipe(10, vegetable, Fluids.JUICE.getFluid(juiceAmount));
        }
        if (vegetableSeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, vegetableSeed, Fluids.SEED_OIL.getFluid(seedamount));
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && vegetableSeed != null && vegetableBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(vegetableSeed, vegetableBlock, plantAGE, 3, 0));
        }
        plants.add(vegetableName);
    }
    ItemRegistryCore coreItems = ModuleCore.getItems();
    for (String grainName : grains) {
        ItemStack grain = getItemStack(grainName + "item");
        ItemStack grainSeed = getItemStack(grainName + "seeditem");
        Block grainBlock = getBlock("pam" + grainName + "crop");
        if (grain != null && wheatamount > 0) {
            RecipeUtil.addRecipe("pam_compost_" + grainName, coreItems.compost.getItemStack(wheatamount), " X ", "X#X", " X ", '#', Blocks.DIRT, 'X', grain);
            FuelManager.moistenerResource.put(grain, new MoistenerFuel(grain, coreItems.mouldyWheat.getItemStack(), 0, 300));
        }
        if (grainSeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, grainSeed, Fluids.SEED_OIL.getFluid(seedamount));
            RecipeManagers.moistenerManager.addRecipe(grainSeed, new ItemStack(Blocks.MYCELIUM), 5000);
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && grainSeed != null && grainBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(grainSeed, grainBlock, plantAGE, 3, 0));
        }
        plants.add(grainName);
    }
    for (String treeFruitName : treeFruits) {
        ItemStack treeFruit = getItemStack(treeFruitName + "item");
        Block treeFruitBlock = getBlock("pam" + treeFruitName);
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && treeFruitBlock != null) {
            farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, treeFruitBlock, fruitAGE, 2, 0));
        }
        if (treeFruit != null) {
            RecipeManagers.squeezerManager.addRecipe(10, treeFruit, Fluids.JUICE.getFluid(juiceAmount));
        }
        plants.add(treeFruitName);
    }
    for (String treeName : trees) {
        Block fruitBlock = getBlock("pam" + treeName);
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitBlock != null) {
            farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0));
        }
        plants.add(treeName);
    }
    for (String treeName : treesSpecial) {
        Block fruitBlock = getBlock("pam" + treeName);
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitBlock != null) {
            farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0));
        }
    }
    for (String cropName : genericCrops) {
        String seedPrefix = cropName;
        if (seedPrefix.equals("tealeaf")) {
            seedPrefix = "tea";
        }
        if (seedPrefix.equals("coffeebean")) {
            seedPrefix = "coffee";
        }
        ItemStack genericCropSeed = getItemStack(seedPrefix + "seeditem");
        Block genericCropBlock = getBlock("pam" + cropName + "crop");
        if (genericCropSeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, genericCropSeed, Fluids.SEED_OIL.getFluid(seedamount));
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && genericCropSeed != null && genericCropBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(genericCropSeed, genericCropBlock, plantAGE, 3, 0));
        }
        plants.add(cropName);
    }
    ItemStack mustardCropSeed = getItemStack("mustard" + "seeditem");
    Block mustardCropBlock = getBlock("pam" + "mustardseeds" + "crop");
    ItemStack mustardFruit = getItemStack("mustard" + "seedsitem");
    if (mustardCropSeed != null) {
        RecipeManagers.squeezerManager.addRecipe(10, mustardCropSeed, Fluids.SEED_OIL.getFluid(seedamount));
    }
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && mustardCropSeed != null && mustardCropBlock != null) {
        farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(mustardCropSeed, mustardCropBlock, plantAGE, 3, 0));
    }
    if (mustardFruit != null) {
        RecipeUtil.addFermenterRecipes(mustardFruit, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
    }
    for (String plantName : plants.build()) {
        ItemStack plant = getItemStack(plantName + "item");
        if (plant != null) {
            RecipeUtil.addFermenterRecipes(plant, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
        }
    }
    for (String cropnutName : cropNuts) {
        ItemStack cropnut = getItemStack(cropnutName + "item");
        ItemStack cropnutSeed = getItemStack(cropnutName + "seeditem");
        Block cropnutBlock = getBlock("pam" + cropnutName + "crop");
        if (cropnutSeed != null) {
            RecipeManagers.squeezerManager.addRecipe(10, cropnutSeed, Fluids.SEED_OIL.getFluid(seedamount));
        }
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && cropnutSeed != null && cropnutBlock != null) {
            farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(cropnutSeed, cropnutBlock, plantAGE, 3, 0));
        }
        if (cropnut != null) {
            RecipeManagers.squeezerManager.addRecipe(20, cropnut, Fluids.SEED_OIL.getFluid(12 * seedamount));
        }
    }
    for (String nutName : nuts) {
        ItemStack nut = getItemStack(nutName + "item");
        Block nutBlock = getBlock("pam" + nutName);
        if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && nutBlock != null) {
            farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, nutBlock, fruitAGE, 2, 0));
        }
        if (nut != null) {
            RecipeManagers.squeezerManager.addRecipe(20, nut, Fluids.SEED_OIL.getFluid(15 * seedamount));
        }
    }
    if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
        ItemStack hcHoneyItem = getItemStack("honeyitem");
        if (hcHoneyItem != null) {
            RecipeManagers.squeezerManager.addRecipe(10, hcHoneyItem, Fluids.FOR_HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP));
        }
        ItemStack hcBeeswaxItem = getItemStack("beeswaxitem");
        if (hcBeeswaxItem != null) {
            RecipeUtil.addRecipe("pam_wax_capsule", ModuleFluids.getItems().waxCapsuleEmpty.getItemStack(ForestryAPI.activeMode.getIntegerSetting("recipe.output.capsule")), "XXX ", 'X', hcBeeswaxItem);
        }
    }
}
Also used : PropertyInteger(net.minecraft.block.properties.PropertyInteger) ImmutableList(com.google.common.collect.ImmutableList) ItemRegistryCore(forestry.core.items.ItemRegistryCore) MoistenerFuel(forestry.api.fuels.MoistenerFuel) ResourceLocation(net.minecraft.util.ResourceLocation) Block(net.minecraft.block.Block) IFarmRegistry(forestry.api.farming.IFarmRegistry) ItemStack(net.minecraft.item.ItemStack) FarmableAgingCrop(forestry.farming.logic.farmables.FarmableAgingCrop)

Example 23 with ItemRegistryCore

use of forestry.core.items.ItemRegistryCore in project ForestryMC by ForestryMC.

the class ForestryJeiPlugin method register.

@Override
public void register(IModRegistry registry) {
    IJeiHelpers jeiHelpers = registry.getJeiHelpers();
    IIngredientBlacklist ingredientBlacklist = jeiHelpers.getIngredientBlacklist();
    List<ItemStack> hiddenItems = ModuleManager.getInternalHandler().getHiddenItems();
    for (ItemStack hiddenItem : hiddenItems) {
        ingredientBlacklist.addIngredientToBlacklist(hiddenItem);
    }
    ItemRegistryCore items = ModuleCore.getItems();
    JeiUtil.addDescription(registry, items.solderingIron, items.circuitboards, items.tubes, items.pipette, items.kitPickaxe, items.kitShovel, items.fertilizerCompound);
    BlockRegistryCore blocks = ModuleCore.getBlocks();
    JeiUtil.addDescription(registry, blocks.analyzer, blocks.bogEarth, blocks.escritoire, blocks.humus);
}
Also used : IIngredientBlacklist(mezz.jei.api.ingredients.IIngredientBlacklist) BlockRegistryCore(forestry.core.blocks.BlockRegistryCore) ItemRegistryCore(forestry.core.items.ItemRegistryCore) ItemStack(net.minecraft.item.ItemStack) IJeiHelpers(mezz.jei.api.IJeiHelpers)

Aggregations

ItemRegistryCore (forestry.core.items.ItemRegistryCore)23 ItemStack (net.minecraft.item.ItemStack)18 ResourceLocation (net.minecraft.util.ResourceLocation)10 ICircuitLayout (forestry.api.circuits.ICircuitLayout)6 FluidStack (net.minecraftforge.fluids.FluidStack)6 ItemRegistryApiculture (forestry.apiculture.items.ItemRegistryApiculture)5 BlockRegistryCore (forestry.core.blocks.BlockRegistryCore)5 MoistenerFuel (forestry.api.fuels.MoistenerFuel)3 ItemRegistryFluids (forestry.core.items.ItemRegistryFluids)3 FarmableAgingCrop (forestry.farming.logic.farmables.FarmableAgingCrop)3 IFarmRegistry (forestry.api.farming.IFarmRegistry)2 EngineBronzeFuel (forestry.api.fuels.EngineBronzeFuel)2 ICrateRegistry (forestry.api.storage.ICrateRegistry)2 BlockRegistryApiculture (forestry.apiculture.blocks.BlockRegistryApiculture)2 CircuitLayout (forestry.core.circuits.CircuitLayout)2 BlockRegistryFarming (forestry.farming.blocks.BlockRegistryFarming)2 Block (net.minecraft.block.Block)2 ImmutableList (com.google.common.collect.ImmutableList)1 EnumForestryWoodType (forestry.api.arboriculture.EnumForestryWoodType)1 IWoodType (forestry.api.arboriculture.IWoodType)1