diff --git a/src/main/java/biomesoplenty/api/BOPBlockHelper.java b/src/main/java/biomesoplenty/api/BOPBlockHelper.java index c1b8e4a4e..bf46b08f9 100644 --- a/src/main/java/biomesoplenty/api/BOPBlockHelper.java +++ b/src/main/java/biomesoplenty/api/BOPBlockHelper.java @@ -9,7 +9,11 @@ public class BOPBlockHelper { public static Block get(String name) { - return GameRegistry.findBlock(BOPModInfo.modID, name); + Block block = GameRegistry.findBlock(BOPModInfo.modID, name); + + if (block == null) throw new RuntimeException("The referenced block is null!"); + + return GameRegistry.findBlock(BOPModInfo.modID, name); } public static String getUniqueName(Block block) diff --git a/src/main/java/biomesoplenty/api/BOPItemHelper.java b/src/main/java/biomesoplenty/api/BOPItemHelper.java index d9cd1fa25..67b79a92a 100644 --- a/src/main/java/biomesoplenty/api/BOPItemHelper.java +++ b/src/main/java/biomesoplenty/api/BOPItemHelper.java @@ -1,5 +1,6 @@ package biomesoplenty.api; +import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; @@ -19,7 +20,11 @@ public class BOPItemHelper public static Item get(String name) { - return GameRegistry.findItem(BOPModInfo.modID, name); + Item item = GameRegistry.findItem(BOPModInfo.modID, name); + + if (item == null) throw new RuntimeException("The referenced item is null!"); + + return GameRegistry.findItem(BOPModInfo.modID, name); } public static String getUniqueName(Item item) diff --git a/src/main/java/biomesoplenty/common/core/BOPCrafting.java b/src/main/java/biomesoplenty/common/core/BOPCrafting.java index 33b1e13b1..917d7678d 100644 --- a/src/main/java/biomesoplenty/common/core/BOPCrafting.java +++ b/src/main/java/biomesoplenty/common/core/BOPCrafting.java @@ -259,7 +259,7 @@ public class BOPCrafting GameRegistry.addRecipe(new ItemStack(BOPBlockHelper.get("planks"), 1, 10), new Object[] {"##", "##", '#', BOPBlockHelper.get("bamboo")}); GameRegistry.addRecipe(new ItemStack(BOPItemHelper.get("jarEmpty"), 3, 0), new Object[] {"# #", "# #", "###", '#', Blocks.glass}); - GameRegistry.addShapelessRecipe(new ItemStack(BOPItemHelper.get("food"), 1, 10), new Object[] {new ItemStack(BOPItemHelper.get("misc"), 1, 11), new ItemStack(Items.potionitem, 1, 0), new ItemStack(BOPBlockHelper.get("flowers2"), 1, 6), new ItemStack(BOPBlockHelper.get("coral"), 1, 3), new ItemStack(BOPBlockHelper.get("plants"), 1, 15), new ItemStack(BOPItemHelper.get("misc"), 1, 4), new ItemStack(BOPItemHelper.get("jarFilled"), 1, 0), new ItemStack(BOPItemHelper.get("food"), 1, 0), Items.sugar}); + GameRegistry.addShapelessRecipe(new ItemStack(BOPItemHelper.get("food"), 1, 10), new Object[] {new ItemStack(BOPItemHelper.get("misc"), 1, 11), new ItemStack(Items.potionitem, 1, 0), new ItemStack(BOPBlockHelper.get("flowers2"), 1, 6), new ItemStack(BOPBlockHelper.get("coral1"), 1, 11), new ItemStack(BOPBlockHelper.get("plants"), 1, 15), new ItemStack(BOPItemHelper.get("misc"), 1, 4), new ItemStack(BOPItemHelper.get("jarFilled"), 1, 0), new ItemStack(BOPItemHelper.get("food"), 1, 0), Items.sugar}); GameRegistry.addRecipe(new ItemStack(BOPBlockHelper.get("flesh"), 1, 0), new Object[] {"##", "##", '#', new ItemStack(BOPItemHelper.get("misc"), 1, 3)}); GameRegistry.addRecipe(new ItemStack(Items.rotten_flesh, 1, 0), new Object[] {"FFF", "FPF", "FFF", 'F', new ItemStack(BOPItemHelper.get("misc"), 1, 3), 'P', new ItemStack(BOPItemHelper.get("jarFilled"), 1, 1)});