diff --git a/src/main/java/forestry/plugins/PluginPlantMegaPack.java b/src/main/java/forestry/plugins/PluginPlantMegaPack.java index b15619f0f..b8450fc3b 100644 --- a/src/main/java/forestry/plugins/PluginPlantMegaPack.java +++ b/src/main/java/forestry/plugins/PluginPlantMegaPack.java @@ -12,17 +12,23 @@ package forestry.plugins; import com.google.common.collect.ImmutableList; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; +import forestry.api.apiculture.FlowerManager; import forestry.api.farming.Farmables; +import forestry.api.recipes.RecipeManagers; import forestry.core.GameMode; import forestry.core.config.Defaults; import forestry.core.fluids.Fluids; import forestry.core.proxy.Proxies; import forestry.core.utils.RecipeUtil; +import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableStacked; @Plugin(pluginID = "PlantMegaPack", name = "PlantMegaPack", author = "Nirek", url = Defaults.URL, unlocalizedDescription = "for.plugin.plantmegapack.description") @@ -55,11 +61,50 @@ public class PluginPlantMegaPack extends ForestryPlugin { "bambooWetForest" ); + ImmutableList landCropPlant = ImmutableList.of( + "Beet", + "BellPepperYellow", + "Celery", + "Corn", + "Cucumber", + "Lettuce", + "Onion", + "Spinach", + "Tomato" + ); + + ImmutableList desertPlant = ImmutableList.of( + "desertApachePlume", + "desertBrittlebush", + "desertBroadLeafGilia", + "desertBroomSnakeweed", + "desertKangarooPaw", + "desertOcotillo", + "desertPeninsulaOnion", + "desertSeepwood", + "desertWhiteSage" + + ); + + Map cactusPlant = new HashMap(); + cactusPlant.put("cactusArmatocereusMatucanensis", 6); + cactusPlant.put("cactusBaseballBat", 6); + cactusPlant.put("cactusEchinocereusMetornii", 2); + cactusPlant.put("cactusGoldenCereus", 3); + cactusPlant.put("cactusGoldenSaguaro", 6); + cactusPlant.put("cactusMatucanaAureiflora", 1); + cactusPlant.put("cactusPricklyPear", 5); + cactusPlant.put("cactusSnowPole", 6); + cactusPlant.put("cactusToothpick", 6); + + ImmutableList waterPlant = ImmutableList.of( "waterKelpGiantGRN", "waterKelpGiantYEL" ); + int seedamount = GameMode.getGameMode().getIntegerSetting("squeezer.liquid.seed"); + int juiceAmount = GameMode.getGameMode().getIntegerSetting("squeezer.liquid.apple"); for (String reedLike : reedLikePlant) { Block reedBlock = GameRegistry.findBlock(PlantMP, reedLike); ItemStack reedStack = GameRegistry.findItemStack(PlantMP, reedLike, 1); @@ -68,6 +113,38 @@ public class PluginPlantMegaPack extends ForestryPlugin { Farmables.farmables.get("farmPoales").add(new FarmableStacked(reedBlock, 14, 4)); } } + + for (String landCrop : landCropPlant) { + Block landCropBlock = GameRegistry.findBlock(PlantMP, "crop" + landCrop); + ItemStack seedStack = GameRegistry.findItemStack(PlantMP, "seed" + landCrop, 1); + ItemStack foodStack = GameRegistry.findItemStack(PlantMP, "food" + landCrop, 1); + if (landCropBlock != null && seedStack != null) { + if (foodStack != null) { + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{foodStack}, Fluids.JUICE.getFluid(juiceAmount)); + } + if (seedStack != null) { + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{seedStack}, Fluids.SEEDOIL.getFluid(seedamount)); + } + Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seedStack, landCropBlock, 4)); + } + } + for (String dPlant : desertPlant) { + Block desertPlantBlock = GameRegistry.findBlock(PlantMP, dPlant); + ItemStack desertPlantStack = GameRegistry.findItemStack(PlantMP, dPlant, 1); + if (desertPlantBlock != null && desertPlantStack != null) { + FlowerManager.flowerRegistry.registerAcceptableFlower(desertPlantBlock, FlowerManager.FlowerTypeCacti); + Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(desertPlantStack, desertPlantBlock, 4)); + } + } + + for (Map.Entry cPlant : cactusPlant.entrySet()) { + Block cactusPlantBlock = GameRegistry.findBlock(PlantMP, cPlant.getKey()); + ItemStack cactusPlantStack = GameRegistry.findItemStack(PlantMP, cPlant.getKey(), 1); + if (cactusPlantBlock != null) { + FlowerManager.flowerRegistry.registerAcceptableFlower(cactusPlantBlock, FlowerManager.FlowerTypeCacti); + Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(cactusPlantStack, cactusPlantBlock, cPlant.getValue())); + } + } for (String wPlant : waterPlant) { ItemStack waterPlantStack = GameRegistry.findItemStack(PlantMP, wPlant, 1); if (waterPlantStack != null) {