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:
parent
76ffd19bc5
commit
bdee7e3c5b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue