Plant Mega Pack Stage 1 Bamboo to Reed farm. Bamboo, Kelp to Fermenter

This commit is contained in:
Nirek-K authored and mezz committed 2015-03-26 22:47:20 -07:00
1 parent 06a86742bb
commit af036b64e8
4 files changed
+85 -5

No files matched your search

@@ -25,10 +25,12 @@ public class FarmableStacked implements IFarmable {
private final Block block;
private final int matureHeight;
private final int matureMeta;
public FarmableStacked(Block block, int matureHeight) {
public FarmableStacked(Block block, int matureHeight, int matureMeta) {
this.block = block;
this.matureHeight = matureHeight;
this.matureMeta = matureMeta;
}
@Override
@@ -41,8 +43,7 @@ public class FarmableStacked implements IFarmable {
if (world.getBlock(x, y + (matureHeight - 1), z) != block) {
return null;
}
return new CropBlock(world, block, 0, new Vect(x, y + (matureHeight - 1), z));
return new CropBlock(world, block, matureMeta, new Vect(x, y + (matureHeight - 1), z));
}
@Override
@@ -114,10 +114,10 @@ public class PluginFarming extends ForestryPlugin {
Farmables.farmables.get("farmInfernal").add(new FarmableGenericCrop(new ItemStack(Items.nether_wart), Blocks.nether_wart, 3));
Farmables.farmables.put("farmPoales", new ArrayList<IFarmable>());
Farmables.farmables.get("farmPoales").add(new FarmableStacked(Blocks.reeds, 3));
Farmables.farmables.get("farmPoales").add(new FarmableStacked(Blocks.reeds, 3, 0));
Farmables.farmables.put("farmSucculentes", new ArrayList<IFarmable>());
Farmables.farmables.get("farmSucculentes").add(new FarmableStacked(Blocks.cactus, 3));
Farmables.farmables.get("farmSucculentes").add(new FarmableStacked(Blocks.cactus, 3, 0));
Farmables.farmables.put("farmVegetables", new ArrayList<IFarmable>());
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.potato), Blocks.potatoes, 7));
@@ -94,6 +94,7 @@ public class PluginManager {
HARVESTCRAFT(new PluginHarvestCraft()),
MAGICALCROPS(new PluginMagicalCrops()),
NATURA(new PluginNatura()),
PLANTMEGAPACK(new PluginPlantMegaPack()),
UNDERGROUND_BIOMES(new PluginUndergroundBiomes());
private final ForestryPlugin instance;
@@ -0,0 +1,78 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.plugins;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.farming.Farmables;
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.FarmableStacked;
@Plugin(pluginID = "PlantMegaPack", name = "PlantMegaPack", author = "Nirek", url = Defaults.URL, unlocalizedDescription = "for.plugin.plantmegapack.description")
public class PluginPlantMegaPack extends ForestryPlugin {
private static final String PlantMP = "plantmegapack";
@Override
public boolean isAvailable() {
return Proxies.common.isModLoaded(PlantMP);
}
@Override
public String getFailMessage() {
return "Plant Mega Pack not found";
}
@Override
protected void registerRecipes() {
ImmutableList<String> reedLikePlant = ImmutableList.of(
"bambooAsper",
"bambooFargesiaRobusta",
"bambooGiantTimber",
"bambooGolden",
"bambooMoso",
"bambooShortTassled",
"bambooTimorBlack",
"bambooTropicalBlue",
"bambooWetForest"
);
ImmutableList<String> waterPlant = ImmutableList.of(
"waterKelpGiantGRN",
"waterKelpGiantYEL"
);
for (String reedLike : reedLikePlant) {
Block reedBlock = GameRegistry.findBlock(PlantMP, reedLike);
ItemStack reedStack = GameRegistry.findItemStack(PlantMP, reedLike, 1);
if (reedBlock != null && reedStack != null) {
RecipeUtil.injectLeveledRecipe(reedStack, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
Farmables.farmables.get("farmPoales").add(new FarmableStacked(reedBlock, 14, 4));
}
}
for (String wPlant : waterPlant) {
ItemStack waterPlantStack = GameRegistry.findItemStack(PlantMP, wPlant, 1);
if (waterPlantStack != null) {
RecipeUtil.injectLeveledRecipe(waterPlantStack, GameMode.getGameMode().getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
}
}
}
}