Search in sources :

Example 1 with FarmableRusticGrape

use of forestry.farming.logic.farmables.FarmableRusticGrape in project ForestryMC by ForestryMC.

the class PluginRustic method registerRecipes.

@Override
public void registerRecipes() {
    ImmutableList<String> fruits = ImmutableList.of("tomato", "chili_pepper");
    ImmutableList<String> crops = ImmutableList.of("tomato", "chili");
    PropertyInteger cropAge = PropertyInteger.create("age", 0, 3);
    int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
    int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
    IFarmRegistry farmRegistry = ForestryAPI.farmRegistry;
    ItemStack grapes = getItemStack("grapes");
    ItemStack grapeSeeds = getItemStack("grape_stem");
    Block grapeLeaves = getBlock("grape_leaves");
    if (grapeSeeds != null) {
        RecipeManagers.squeezerManager.addRecipe(10, grapeSeeds, Fluids.SEED_OIL.getFluid(seedAmount));
    }
    if (grapes != null) {
        RecipeManagers.squeezerManager.addRecipe(10, grapes, Fluids.JUICE.getFluid(juiceAmount / 12));
    }
    if (grapeLeaves != null) {
        farmRegistry.registerFarmables("farmOrchard", new FarmableRusticGrape(grapeLeaves));
    }
    ItemStack sapling = getItemStack("sapling");
    ItemStack ironBerries = getItemStack("ironberries");
    ItemStack olives = getItemStack("olives");
    if (sapling != null && ironBerries != null && olives != null) {
        farmRegistry.registerFarmables("farmArboreal", new FarmableRusticSapling(sapling.getItem(), new ItemStack[] { ironBerries, olives }));
    }
    for (int i = 0; i < fruits.size(); i++) {
        String fruitName = fruits.get(i);
        ItemStack seeds = getItemStack(fruitName + "_seeds");
        Block block = getBlock(crops.get(i) + "_crop");
        ItemStack fruit = getItemStack(fruitName);
        if (seeds != null) {
            RecipeManagers.squeezerManager.addRecipe(10, seeds, Fluids.SEED_OIL.getFluid(seedAmount));
        }
        if (fruit != null) {
            RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount / 25));
        }
        if (seeds != null && block != null) {
            farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(seeds, block, cropAge, 3, 2));
        }
    }
}
Also used : PropertyInteger(net.minecraft.block.properties.PropertyInteger) FarmableRusticGrape(forestry.farming.logic.farmables.FarmableRusticGrape) Block(net.minecraft.block.Block) IFarmRegistry(forestry.api.farming.IFarmRegistry) FarmableRusticSapling(forestry.farming.logic.farmables.FarmableRusticSapling) ItemStack(net.minecraft.item.ItemStack) FarmableAgingCrop(forestry.farming.logic.farmables.FarmableAgingCrop)

Aggregations

IFarmRegistry (forestry.api.farming.IFarmRegistry)1 FarmableAgingCrop (forestry.farming.logic.farmables.FarmableAgingCrop)1 FarmableRusticGrape (forestry.farming.logic.farmables.FarmableRusticGrape)1 FarmableRusticSapling (forestry.farming.logic.farmables.FarmableRusticSapling)1 Block (net.minecraft.block.Block)1 PropertyInteger (net.minecraft.block.properties.PropertyInteger)1 ItemStack (net.minecraft.item.ItemStack)1