Advertisement
Gamebuster

MainClass 3

May 27th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     @EventHandler
  2.     public void init(FMLInitializationEvent event){
  3.         registerBlock(new PetrifiedLog(), "petrifiedWood");
  4.         OreDictionary.registerOre("stone", PetrifiedLog.block);
  5.     }
  6.    
  7.     @EventHandler
  8.     public void postInit(FMLPostInitializationEvent event){
  9.        
  10.     }
  11.    
  12.     void registerBlock(Block block, String registryName){
  13.        
  14.         block.setRegistryName(registryName);
  15.         block.setUnlocalizedName(block.getRegistryName().toString());
  16.        
  17.         ItemBlock item = new ItemBlock(block);
  18.        
  19.         item.setRegistryName(registryName);
  20.         item.setUnlocalizedName(block.getRegistryName().toString());
  21.         GameRegistry.register(block);
  22.         GameRegistry.register(item);
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement