Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //other stuff is before this, no errors occur there
- @EventHandler
- public void init(FMLInitializationEvent event){
- registerBlock(new PetrifiedLog(), "logPetrified"); //register the names of the block and item form of petrified log
- OreDictionary.registerOre("stone", new PetrifiedLog()); //line 37, register the log in the oreDictionary, fails here
- }
- @EventHandler
- public void postInit(FMLPostInitializationEvent event){
- }
- void registerBlock(Block block, String registryName){
- //set the names for the block
- block.setRegistryName(registryName);
- block.setUnlocalizedName(block.getRegistryName().toString());
- //get the item
- ItemBlock item = new ItemBlock(block);
- //set the names for the item
- item.setRegistryName(registryName);
- item.setUnlocalizedName(block.getRegistryName().toString());
- //register the block and item in the game registry, this has nothing to do with the OreDictionary
- GameRegistry.register(block);
- GameRegistry.register(item);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement