diff --git a/lang b/lang index 8b7cc82cf..8f4c9d15c 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 8b7cc82cfde21efff1fe382bfc5ef057cf16c539 +Subproject commit 8f4c9d15c478f3dcfaec16633bc0af3c65351bc8 diff --git a/src/main/java/forestry/farming/logic/FarmableGenericCrop.java b/src/main/java/forestry/farming/logic/FarmableGenericCrop.java index 18235a4b8..29b405b92 100755 --- a/src/main/java/forestry/farming/logic/FarmableGenericCrop.java +++ b/src/main/java/forestry/farming/logic/FarmableGenericCrop.java @@ -24,11 +24,13 @@ public class FarmableGenericCrop implements IFarmable { private final ItemStack seed; private final Block block; private final int mature; + ItemStack[] windfall; - public FarmableGenericCrop(ItemStack seed, Block block, int mature) { + public FarmableGenericCrop(ItemStack seed, Block block, int mature, ItemStack... windfall) { this.seed = seed; this.block = block; this.mature = mature; + this.windfall = windfall; } @Override @@ -68,6 +70,11 @@ public class FarmableGenericCrop implements IFarmable { @Override public boolean isWindfall(ItemStack itemstack) { + for (ItemStack drop : windfall) { + if (drop.isItemEqual(itemstack)) { + return true; + } + } return false; } diff --git a/src/main/java/forestry/plugins/PluginImmersiveEngineering.java b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java new file mode 100644 index 000000000..54494c8ac --- /dev/null +++ b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * 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 net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import cpw.mods.fml.common.registry.GameRegistry; + +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.farming.logic.FarmableGenericCrop; + +@Plugin(pluginID = "ImmersiveEngineering", name = "ImmersiveEngineering", author = "Nirek", url = Defaults.URL, unlocalizedDescription = "for.plugin.immersiveengineering.description") +public class PluginImmersiveEngineering extends ForestryPlugin { + + private static final String ImEng = "ImmersiveEngineering"; + + @Override + public boolean isAvailable() { + return Proxies.common.isModLoaded(ImEng); + } + + @Override + public String getFailMessage() { + return "Immersive Engineering not found"; + } + + @Override + protected void registerRecipes() { + + ItemStack hempSeed = GameRegistry.findItemStack(ImEng, "seed", 1); + Block hempCrop = GameRegistry.findBlock(ImEng, "hemp"); + ItemStack hempFiber = new ItemStack(GameRegistry.findItem(ImEng, "material"), 1, 3); + int seedAmount = GameMode.getGameMode().getIntegerSetting("squeezer.liquid.seed"); + if (hempSeed != null && hempCrop != null) { + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{hempSeed}, Fluids.SEEDOIL.getFluid(seedAmount)); + Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(hempSeed, hempCrop, 4, hempFiber)); + } + } + +} diff --git a/src/main/java/forestry/plugins/PluginManager.java b/src/main/java/forestry/plugins/PluginManager.java index 4bde750e6..09630a1af 100644 --- a/src/main/java/forestry/plugins/PluginManager.java +++ b/src/main/java/forestry/plugins/PluginManager.java @@ -91,6 +91,7 @@ public class PluginManager { ENDERIO(new PluginEnderIO()), EXTRAUTILITIES(new PluginExtraUtilities()), HARVESTCRAFT(new PluginHarvestCraft()), + IMMERSIVEENGINEERING(new PluginImmersiveEngineering()), INDUSTRIALCRAFT(new PluginIC2()), MAGICALCROPS(new PluginMagicalCrops()), NATURA(new PluginNatura()),