mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
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:
1 parent
42f1d87955
commit
11ac46daeb
1 file changed
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user