Plant Mega Pack Stage 2

Cactus/Desert plants to crop multifarm, acceptable to Cacti bee flower allele
Land Crops to crop multifarm, seeds to seed oil, products to juice in Squeezer
This commit is contained in:
Nirek-K committed 2015-03-27 05:28:07 -05:00
1 parent f0c535f30a
commit a3f23ea1cb
1 file changed
+77
@@ -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<String> landCropPlant = ImmutableList.of(
"Beet",
"BellPepperYellow",
"Celery",
"Corn",
"Cucumber",
"Lettuce",
"Onion",
"Spinach",
"Tomato"
);
ImmutableList<String> desertPlant = ImmutableList.of(
"desertApachePlume",
"desertBrittlebush",
"desertBroadLeafGilia",
"desertBroomSnakeweed",
"desertKangarooPaw",
"desertOcotillo",
"desertPeninsulaOnion",
"desertSeepwood",
"desertWhiteSage"
);
Map<String, Integer> cactusPlant = new HashMap<String, Integer>();
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<String> 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<String, Integer> 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) {