mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Merge pull request #195 from RainWarrior/snapshot15
Fixes GameRegistry.registerBlock
This commit is contained in:
commit
3f197d0b30
1 file changed
+3
-1
@@ -213,15 +213,17 @@ public class GameRegistry
|
||||
assert itemclass != null : "registerBlock: itemclass cannot be null";
|
||||
int blockItemId = block.field_71990_ca - 256;
|
||||
Constructor<? extends ItemBlock> 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)
|
||||
|
||||
Reference in new issue
Block a user