diff --git a/lang b/lang index 5bae723fd..8bd772eb2 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 5bae723fd9bcbb26395b9aa748dd163d9d1fdbd9 +Subproject commit 8bd772eb208af109520a56b60762f25889f2ed0d diff --git a/src/main/java/forestry/plugins/PluginBiomesOPlenty.java b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java new file mode 100644 index 000000000..213f5df8a --- /dev/null +++ b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java @@ -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 java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry; + +import forestry.api.farming.Farmables; +import forestry.core.config.Defaults; +import forestry.core.proxy.Proxies; +import forestry.farming.logic.FarmableGenericCrop; +import forestry.farming.logic.FarmableGenericSapling; + +@Plugin(pluginID = "BiomesOPlenty", name = "BiomesOPlenty", author = "Nirek", url = Defaults.URL, unlocalizedDescription = "for.plugin.biomesoplenty.description") +public class PluginBiomesOPlenty extends ForestryPlugin { + + private static final String BoP = "BiomesOPlenty"; + + public static Block BoPSaplings; + public static Block BoPColorizedSaplings; + public static Block BoPTurnip; + public static Item BoPTurnipSeeds; + + @Override + public boolean isAvailable() { + return Proxies.common.isModLoaded(BoP); + } + + @Override + public String getFailMessage() { + return "BiomesOPlenty not found"; + } + + @Override + public void doInit() { + super.doInit(); + + BoPSaplings = GameRegistry.findBlock(BoP, "saplings"); + BoPColorizedSaplings = GameRegistry.findBlock(BoP, "colorizedSaplings"); + BoPTurnipSeeds = GameRegistry.findItem(BoP, "turnipSeeds"); + BoPTurnip = GameRegistry.findBlock(BoP, "turnip"); + + List saplingItemKeys = new ArrayList(); + + if (BoPSaplings != null) { + saplingItemKeys.add("saplings"); + } + if (BoPColorizedSaplings != null) { + saplingItemKeys.add("colorizedSaplings"); + } + + for (String key : saplingItemKeys) { + Item saplingItem = GameRegistry.findItem(BoP, key); + String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); + FMLInterModComms.sendMessage(Defaults.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); + } + ItemStack BoPPersimmon = new ItemStack(GameRegistry.findItem(BoP, "food"), 1, 8); + Farmables.farmables.get("farmArboreal").add(new FarmableGenericSapling(BoPSaplings, 15, BoPPersimmon)); + + Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(BoPTurnipSeeds, 1, 0), BoPTurnip, 7)); + } +} diff --git a/src/main/java/forestry/plugins/PluginManager.java b/src/main/java/forestry/plugins/PluginManager.java index 22a6d9c22..c9bb8afde 100755 --- a/src/main/java/forestry/plugins/PluginManager.java +++ b/src/main/java/forestry/plugins/PluginManager.java @@ -78,6 +78,7 @@ public class PluginManager { LEPIDOPTEROLOGY(new PluginLepidopterology()), MAIL(new PluginMail()), STORAGE(new PluginStorage()), + BIOMESOPLENTY(new PluginBiomesOPlenty()), BUILDCRAFT_FUELS(new PluginBuildCraftFuels()), BUILDCRAFT_RECIPES(new PluginBuildCraftRecipes()), BUILDCRAFT_STATEMENTS(new PluginBuildCraftStatements()),