Fixing the GameRegistry. Now it is possible to register a Block with a BlockItem using following code:

MyBlock myBlock = new MyBlock();
GameRegistry.registerBlock(myBlock, MyBlockItem.class, "myBlock");
where MyBlockItem class has one constructor with signature:
public MyBlockItem(int id, Block block)
This commit is contained in:
Marcin Sciesinski 2013-04-21 19:01:18 +01:00
parent 76ffd19bc5
commit bdee7e3c5b
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ public class GameRegistry
}
catch (NoSuchMethodException e)
{
itemCtor = itemclass.getConstructor(int.class, Block.class);
itemCtor = itemclass.getConstructor(int.class, net.minecraft.block.Block.class);
i = itemCtor.newInstance(blockItemId, block);
}
GameRegistry.registerItem(i,name, modId);