From c2fce94d6b19ce521eea22ad6859e19b33418907 Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Sat, 9 Mar 2013 14:06:12 +0400 Subject: [PATCH] Fixes GameRegistry.registerBlock --- fml/common/cpw/mods/fml/common/registry/GameRegistry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fml/common/cpw/mods/fml/common/registry/GameRegistry.java b/fml/common/cpw/mods/fml/common/registry/GameRegistry.java index 3e8f5b4fe..c504fac29 100644 --- a/fml/common/cpw/mods/fml/common/registry/GameRegistry.java +++ b/fml/common/cpw/mods/fml/common/registry/GameRegistry.java @@ -213,15 +213,17 @@ public class GameRegistry assert itemclass != null : "registerBlock: itemclass cannot be null"; int blockItemId = block.field_71990_ca - 256; Constructor itemCtor; + Item i; try { itemCtor = itemclass.getConstructor(int.class); + i = itemCtor.newInstance(blockItemId); } catch (NoSuchMethodException e) { itemCtor = itemclass.getConstructor(int.class, Block.class); + i = itemCtor.newInstance(blockItemId, block); } - Item i = itemCtor.newInstance(blockItemId, block); GameRegistry.registerItem(i,name, modId); } catch (Exception e)