Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public class ModBlocks
  2. {
  3.  
  4. public static Block square;
  5.  
  6. public static void init()
  7. {
  8. square = new BlockSquare();
  9. }
  10.  
  11. public static void register()
  12. {
  13. registerBlock(square);
  14. }
  15.  
  16. public static void registerRenders()
  17. {
  18. registerRender(square);
  19. }
  20.  
  21. private static void registerBlock(Block block)
  22. {
  23. GameRegistry.register(block);
  24. ItemBlock itemBlock = new ItemBlock(block);
  25. itemBlock.setRegistryName(block.getRegistryName());
  26. GameRegistry.register(itemBlock);
  27. }
  28.  
  29. private static void registerRender(Block block)
  30. {
  31. ModelLoader.setCustomModelResourceLocation(new ItemBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement