From add35720858b12389c64a74ca2da4b3691d33ea1 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 18 Aug 2014 05:38:48 -0700 Subject: [PATCH 1/4] Fix missing support for ForestryBlock --- src/main/java/forestry/core/gui/slots/SlotCustom.java | 3 +++ src/main/java/forestry/core/utils/ShapedRecipeCustom.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/forestry/core/gui/slots/SlotCustom.java b/src/main/java/forestry/core/gui/slots/SlotCustom.java index 6bb5bb99f..d0881973a 100755 --- a/src/main/java/forestry/core/gui/slots/SlotCustom.java +++ b/src/main/java/forestry/core/gui/slots/SlotCustom.java @@ -24,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly; import forestry.api.genetics.ISpeciesRoot; import forestry.core.config.Defaults; +import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; import forestry.core.interfaces.ICrafter; import forestry.core.render.TextureManager; @@ -126,6 +127,8 @@ public class SlotCustom extends SlotForestry { if (itemstack.getItem() == (Item) filter) return true; } else if (filter instanceof ForestryItem) { if (((ForestryItem) filter).isItemEqual(itemstack)) return true; + } else if (filter instanceof ForestryBlock) { + if (((ForestryBlock) filter).isItemEqual(itemstack)) return true; } else if (filter instanceof ISpeciesRoot) { if (((ISpeciesRoot) filter).isMember(itemstack)) return true; } else { diff --git a/src/main/java/forestry/core/utils/ShapedRecipeCustom.java b/src/main/java/forestry/core/utils/ShapedRecipeCustom.java index 66adf1ce1..bb1460a45 100755 --- a/src/main/java/forestry/core/utils/ShapedRecipeCustom.java +++ b/src/main/java/forestry/core/utils/ShapedRecipeCustom.java @@ -24,6 +24,7 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import forestry.core.config.Defaults; +import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; import forestry.core.interfaces.IDescriptiveRecipe; @@ -222,6 +223,8 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe { hashmap.put(character, new ItemStack((Item) materials[index + 1])); else if (materials[index + 1] instanceof ForestryItem) hashmap.put(character, ((ForestryItem) materials[index + 1]).getItemStack()); + else if (materials[index + 1] instanceof ForestryBlock) + hashmap.put(character, ((ForestryBlock) materials[index + 1]).getItemStack()); else if (materials[index + 1] instanceof Block) hashmap.put(character, new ItemStack((Block) materials[index + 1], 1, Defaults.WILDCARD)); else if (materials[index + 1] instanceof ItemStack) From 15d40439b66df5ecbb7fb493b610131ecfb349df Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 18 Aug 2014 06:28:08 -0700 Subject: [PATCH 2/4] Minor stuff --- api | 2 +- src/main/java/forestry/core/ForestryCore.java | 3 +-- src/main/java/forestry/core/utils/LiquidHelper.java | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api b/api index fc81bb2e8..9431b14bd 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit fc81bb2e83f02c799f780ebdb1db73a315364b08 +Subproject commit 9431b14bd3f93eb51937594af6206b424f8a0158 diff --git a/src/main/java/forestry/core/ForestryCore.java b/src/main/java/forestry/core/ForestryCore.java index 5b9021699..d57efd469 100755 --- a/src/main/java/forestry/core/ForestryCore.java +++ b/src/main/java/forestry/core/ForestryCore.java @@ -208,8 +208,7 @@ public class ForestryCore { LiquidHelper.injectLiquidContainer(Defaults.LIQUID_MILK, Defaults.BUCKET_VOLUME, new ItemStack(Items.milk_bucket), new ItemStack(Items.bucket)); // Lava - LiquidHelper.injectTinContainer(Defaults.LIQUID_LAVA, Defaults.BUCKET_VOLUME, ForestryItem.canLava.getItemStack(), - ForestryItem.canEmpty.getItemStack()); + LiquidHelper.injectTinContainer(Defaults.LIQUID_LAVA, Defaults.BUCKET_VOLUME, ForestryItem.canLava.getItemStack(), ForestryItem.canEmpty.getItemStack()); LiquidHelper.injectRefractoryContainer(Defaults.LIQUID_LAVA, Defaults.BUCKET_VOLUME, ForestryItem.refractoryLava.getItemStack(), ForestryItem.refractoryEmpty.getItemStack()); // Water diff --git a/src/main/java/forestry/core/utils/LiquidHelper.java b/src/main/java/forestry/core/utils/LiquidHelper.java index bae4ba690..e6419cf13 100755 --- a/src/main/java/forestry/core/utils/LiquidHelper.java +++ b/src/main/java/forestry/core/utils/LiquidHelper.java @@ -36,8 +36,8 @@ import forestry.core.render.TextureManager; public class LiquidHelper { - private static LinkedList myLiquids = new LinkedList(); - private static HashMap liquidMap = new HashMap(); + private static final LinkedList myLiquids = new LinkedList(); + private static final HashMap liquidMap = new HashMap(); public static boolean isEmptyLiquidData() { return FluidContainerRegistry.getRegisteredFluidContainerData().length <= 0; From c99eb94d6b33c9fed80b708f8093ec1491eaef4a Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 18 Aug 2014 08:23:14 -0700 Subject: [PATCH 3/4] We might be able to reduce some of the world breakage...particually of items (save the bees!) --- src/main/java/forestry/core/proxy/ProxyCommon.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/forestry/core/proxy/ProxyCommon.java b/src/main/java/forestry/core/proxy/ProxyCommon.java index 524b5af2e..6a762abf9 100755 --- a/src/main/java/forestry/core/proxy/ProxyCommon.java +++ b/src/main/java/forestry/core/proxy/ProxyCommon.java @@ -44,6 +44,7 @@ import forestry.core.network.PacketCoordinates; import forestry.core.network.PacketFXSignal; import forestry.core.network.PacketIds; import forestry.core.render.SpriteSheet; +import forestry.core.utils.StringUtil; public class ProxyCommon { @@ -56,11 +57,11 @@ public class ProxyCommon { } public void registerBlock(Block block, Class itemClass) { - GameRegistry.registerBlock(block, itemClass, block.getUnlocalizedName()); + GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block)); } public void registerItem(Item item) { - GameRegistry.registerItem(item, item.getUnlocalizedName().replace("item.", "")); + GameRegistry.registerItem(item, StringUtil.cleanItemName(item)); } /** From 72121b3abd04e46119ed81350fc748fe82dccc30 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 18 Aug 2014 08:29:34 -0700 Subject: [PATCH 4/4] Should probably fix this... --- src/main/java/forestry/core/CreativeTabForestry.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/forestry/core/CreativeTabForestry.java b/src/main/java/forestry/core/CreativeTabForestry.java index da1cdf867..74dfa842c 100755 --- a/src/main/java/forestry/core/CreativeTabForestry.java +++ b/src/main/java/forestry/core/CreativeTabForestry.java @@ -41,16 +41,16 @@ public class CreativeTabForestry extends CreativeTabs { Item iconItem; switch (icon) { case 1: - iconItem = GameRegistry.findItem("Forestry", "for.beeDroneGE"); + iconItem = GameRegistry.findItem("Forestry", "beeDroneGE"); break; case 2: - iconItem = GameRegistry.findItem("Forestry", "for.sapling"); + iconItem = GameRegistry.findItem("Forestry", "sapling"); break; case 3: - iconItem = GameRegistry.findItem("Forestry", "for.butterflyGE"); + iconItem = GameRegistry.findItem("Forestry", "butterflyGE"); break; default: - iconItem = GameRegistry.findItem("Forestry", "for.fertilizerCompound"); + iconItem = GameRegistry.findItem("Forestry", "fertilizerCompound"); break; } if (iconItem == null)