Advertisement
Gamebuster

MainClass 2

May 26th, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. //other stuff is before this, no errors occur there
  2.     @EventHandler
  3.     public void init(FMLInitializationEvent event){
  4.         registerBlock(new PetrifiedLog(), "logPetrified"); //register the names of the block and item form of petrified log
  5.         OreDictionary.registerOre("stone", new PetrifiedLog()); //line 37, register the log in the oreDictionary, fails here
  6.     }
  7.    
  8.     @EventHandler
  9.     public void postInit(FMLPostInitializationEvent event){
  10.        
  11.     }
  12.    
  13.     void registerBlock(Block block, String registryName){
  14.         //set the names for the block
  15.         block.setRegistryName(registryName);
  16.         block.setUnlocalizedName(block.getRegistryName().toString());
  17.  
  18.         //get the item
  19.         ItemBlock item = new ItemBlock(block);
  20.  
  21.         //set the names for the item
  22.         item.setRegistryName(registryName);
  23.         item.setUnlocalizedName(block.getRegistryName().toString());
  24.  
  25.         //register the block and item in the game registry, this has nothing to do with the OreDictionary
  26.         GameRegistry.register(block);
  27.         GameRegistry.register(item);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement