diff --git a/src/main/java/forestry/farming/logic/FarmableFarmCraftory.java b/src/main/java/forestry/farming/logic/FarmableFarmCraftory.java deleted file mode 100755 index 7427fdba7..000000000 --- a/src/main/java/forestry/farming/logic/FarmableFarmCraftory.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * 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.farming.logic; - -import java.util.Collection; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import forestry.api.farming.ICrop; -import forestry.api.farming.IFarmable; -import forestry.core.utils.StackUtils; -import forestry.core.vect.Vect; -import forestry.plugins.PluginFarmCraftory; - -public class FarmableFarmCraftory implements IFarmable { - - Collection germlings; - Collection windfall; - - public FarmableFarmCraftory(Collection germlings, Collection windfall) { - this.germlings = germlings; - this.windfall = windfall; - } - - @Override - public boolean isSaplingAt(World world, int x, int y, int z) { - - if (world.isAirBlock(x, y, z)) { - return false; - } - - Block block = world.getBlock(x, y, z); - return block == PluginFarmCraftory.blockSingle || block == PluginFarmCraftory.blockMulti; - } - - @Override - public ICrop getCropAt(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - if (block != PluginFarmCraftory.blockSingle && block != PluginFarmCraftory.blockMulti) { - return null; - } - TileEntity tile = world.getTileEntity(x, y, z); - if (tile == null) { - return null; - } - if (PluginFarmCraftory.getGrowthStage(tile) < 2) { - return null; - } - - return new CropBlock(world, block, world.getBlockMetadata(x, y, z), new Vect(x, y, z)); - } - - @Override - public boolean isGermling(ItemStack itemstack) { - for (ItemStack seed : germlings) { - if (StackUtils.isIdenticalItem(seed, itemstack)) { - return true; - } - } - - return false; - } - - @Override - public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) { - return germling.copy().tryPlaceItemIntoWorld(player, world, x, y - 1, z, 1, 0, 0, 0); - } - - @Override - public boolean isWindfall(ItemStack itemstack) { - for (ItemStack fruit : windfall) { - if (StackUtils.isIdenticalItem(fruit, itemstack)) { - return true; - } - } - - return false; - } - -} diff --git a/src/main/java/forestry/plugins/PluginEE.java b/src/main/java/forestry/plugins/PluginEE.java deleted file mode 100755 index c1268eb47..000000000 --- a/src/main/java/forestry/plugins/PluginEE.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * 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 java.lang.reflect.Field; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.common.BiomeDictionary; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IMutation; -import forestry.apiculture.genetics.AlleleBeeSpecies; -import forestry.apiculture.genetics.BeeTemplates; -import forestry.apiculture.genetics.IJubilanceProvider; -import forestry.apiculture.genetics.JubilanceReqRes; -import forestry.apiculture.genetics.MutationEMC; -import forestry.core.config.Defaults; -import forestry.core.genetics.Allele; -import forestry.core.proxy.Proxies; - -@Plugin(pluginID = "EqEx2", name = "Equivalent Exchange 2", author = "SirSengir", url = Defaults.URL, unlocalizedDescription = "for.plugin.ee2.description") -public class PluginEE extends ForestryPlugin { - - public IMutation darkenedA; - public IMutation reddenedA; - public IMutation omegaA; - - public ItemStack eeBlock1; - public ItemStack eeBlock2; - - public Class eeRelay2Class; - public Class eeRelay3Class; - public Field eeRelay2EMCField; - public Field eeRelay3EMCField; - - @Override - public boolean isAvailable() { - return Proxies.common.isModLoaded("mod_EE"); - } - - @Override - public String getFailMessage() { - return "Equivalent Exchange not found"; - } - - @Override - public void postInit() { - - try { - - eeBlock1 = new ItemStack((Block) Class.forName("ee.EEBlock").getField("eeStone").get(null), 1, 8); - eeBlock2 = new ItemStack((Block) Class.forName("ee.EEBlock").getField("eeStone").get(null), 1, 9); - eeRelay2Class = Class.forName("ee.TileRelay2"); - eeRelay2EMCField = eeRelay2Class.getField("scaledEnergy"); - eeRelay3Class = Class.forName("ee.TileRelay3"); - eeRelay3EMCField = eeRelay3Class.getField("scaledEnergy"); - - } catch (Exception ex) { - Proxies.log.fine("Necessary block/classes from EE were not found"); - return; - } - - IJubilanceProvider jubilanceProviderDarkened = new JubilanceReqRes(eeBlock1); - IJubilanceProvider jubilanceProviderReddened = new JubilanceReqRes(eeBlock2); - - ((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesDarkened")).jubilanceProvider = jubilanceProviderDarkened; - ((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesReddened")).jubilanceProvider = jubilanceProviderReddened; - ((AlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesOmega")).jubilanceProvider = jubilanceProviderReddened; - - darkenedA = new MutationEMC(Allele.speciesModest, Allele.speciesWintry, BeeTemplates.getDarkenedTemplate(), 100, eeBlock1, eeRelay2Class, - eeRelay2EMCField, 139264); - reddenedA = new MutationEMC(Allele.speciesDarkened, Allele.speciesTropical, BeeTemplates.getReddenedTemplate(), 100, eeBlock2, eeRelay3Class, - eeRelay3EMCField, 466944); - omegaA = new MutationEMC(Allele.speciesDarkened, Allele.speciesReddened, BeeTemplates.getOmegaTemplate(), 100, eeBlock2, eeRelay3Class, - eeRelay3EMCField, 933888).restrictBiomeType(BiomeDictionary.Type.NETHER).restrictBiomeType(BiomeDictionary.Type.SANDY); - - } -} diff --git a/src/main/java/forestry/plugins/PluginFarmCraftory.java b/src/main/java/forestry/plugins/PluginFarmCraftory.java deleted file mode 100755 index db0906022..000000000 --- a/src/main/java/forestry/plugins/PluginFarmCraftory.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * 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 java.lang.reflect.Method; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import forestry.api.farming.Farmables; -import forestry.core.config.Defaults; -import forestry.core.proxy.Proxies; -import forestry.farming.logic.FarmableFarmCraftory; - -@Plugin(pluginID = "FarmCraftory", name = "FarmCraftory", author = "SirSengir", url = Defaults.URL, unlocalizedDescription = "for.plugin.farmcraftory.description") -public class PluginFarmCraftory extends ForestryPlugin { - - public static Block blockSingle; - public static Block blockMulti; - - public static Class classSingle; - public static Class classMulti; - - public static Method methodGrowthSingle; - public static Method methodGrowthMulti; - - public static final HashMap vegetableSeeds = new HashMap(); - public static final String[] seedIdentifiers = new String[]{"turnipSeedBag", "cabbageSeedBag", "onionSeedBag", "spinachSeedBag", "leekSeedBag", - "cucumberSeedBag", "tomatoSeedBag", "eggplantSeedBag", "greenPepperSeedBag", "yamSeedBag", "strawberrySeedBag", "pineappleSeedBag"}; - public static final HashMap vegetableItems = new HashMap(); - public static final String[] vegetableIdentifiers = new String[]{"turnipItem", "cabbageItem", "onionItem", "spinachItem", "leekItem", "cucumberItem", - "tomatoItem", "eggplantItem", "greenPepperItem", "yamItem", "strawberryItem", "pineappleItem"}; - - public static final HashMap cerealSeeds = new HashMap(); - public static final String[] cseedIdentifiers = new String[]{"cornSeedBag"}; - public static final HashMap cerealItems = new HashMap(); - public static final String[] cerealIdentifiers = new String[]{"cornItem"}; - - @Override - public boolean isAvailable() { - return Proxies.common.isModLoaded("FarmCraftory"); - } - - @Override - public String getFailMessage() { - return "FarmCraftory not found"; - } - - @Override - public void doInit() { - super.doInit(); - - try { - - blockSingle = (Block) Class.forName("farmcraftory.FarmCraftory").getField("singleHarvest").get(null); - blockMulti = (Block) Class.forName("farmcraftory.FarmCraftory").getField("multiHarvest").get(null); - - classSingle = Class.forName("farmcraftory.TileEntitySingleHarvest"); - classMulti = Class.forName("farmcraftory.TileEntityMultiHarvest"); - - methodGrowthSingle = classSingle.getMethod("getGrowthStage"); - methodGrowthMulti = classMulti.getMethod("getGrowthStage"); - - for (String str : seedIdentifiers) { - try { - vegetableSeeds.put(str, new ItemStack((Item) Class.forName("farmcraftory.FarmCraftory").getField(str).get(null))); - } catch (Exception ex) { - Proxies.log.info("FarmCraftory item '%s' could not be integrated.", str); - Proxies.log.info(ex.getMessage()); - } - } - - for (String str : vegetableIdentifiers) { - try { - vegetableItems.put(str, new ItemStack((Item) Class.forName("farmcraftory.FarmCraftory").getField(str).get(null))); - } catch (Exception ex) { - Proxies.log.info("FarmCraftory item '%s' could not be integrated.", str); - Proxies.log.info(ex.getMessage()); - } - } - - for (String str : cseedIdentifiers) { - try { - cerealSeeds.put(str, new ItemStack((Item) Class.forName("farmcraftory.FarmCraftory").getField(str).get(null))); - } catch (Exception ex) { - Proxies.log.info("FarmCraftory item '%s' could not be integrated.", str); - Proxies.log.info(ex.getMessage()); - } - } - - for (String str : cerealIdentifiers) { - try { - cerealItems.put(str, new ItemStack((Item) Class.forName("farmcraftory.FarmCraftory").getField(str).get(null))); - } catch (Exception ex) { - Proxies.log.info("FarmCraftory item '%s' could not be integrated.", str); - Proxies.log.info(ex.getMessage()); - } - } - - if (blockMulti != null && blockSingle != null) { - Farmables.farmables.get("farmWheat").add(new FarmableFarmCraftory(cerealSeeds.values(), cerealItems.values())); - Farmables.farmables.get("farmVegetables").add(new FarmableFarmCraftory(vegetableSeeds.values(), vegetableItems.values())); - } - - } catch (Exception ex) { - Proxies.log.info("FarmCraftory plugin unexpectedly failed to load."); - Proxies.log.info(ex.getMessage()); - } - } - - public static int getGrowthStage(TileEntity tile) { - try { - if (classSingle.isInstance(tile)) { - return (Integer) methodGrowthSingle.invoke(tile); - } else if (classMulti.isInstance(tile)) { - return (Integer) methodGrowthMulti.invoke(tile); - } - } catch (Exception ex) { - return 0; - } - - return 0; - } - -} diff --git a/src/main/java/forestry/plugins/PluginManager.java b/src/main/java/forestry/plugins/PluginManager.java index a573e4c9b..dd6c0e07a 100644 --- a/src/main/java/forestry/plugins/PluginManager.java +++ b/src/main/java/forestry/plugins/PluginManager.java @@ -89,8 +89,6 @@ public class PluginManager { BIOMESOPLENTY(new PluginBiomesOPlenty()), CHISEL(new PluginChisel()), EXTRAUTILITIES(new PluginExtraUtilities()), - EQUIVELENT_EXCHANGE(new PluginEE()), - FARM_CRAFTORY(new PluginFarmCraftory()), HARVESTCRAFT(new PluginHarvestCraft()), INDUSTRIALCRAFT(new PluginIC2()), MAGICALCROPS(new PluginMagicalCrops()),