TitanChase

Untitled

Mar 11th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public class CoreBlocks
  2. {
  3. public static CoreBlock TestBlock;
  4.  
  5. public static void init()
  6. {
  7. if (CoreSettings.Debug.EnableTestBlock.Value)
  8. {
  9. TestBlock = register(new TestBlock());
  10. }
  11. }
  12.  
  13. protected static <T extends Block> T register(T block, ItemBlock itemBlock)
  14. {
  15. Registrar.Register(block);
  16. Registrar.Register(itemBlock);
  17.  
  18. if (block instanceof CoreBlock)
  19. {
  20. ((CoreBlock) block).registerItemModel(itemBlock);
  21. }
  22.  
  23. return block;
  24. }
  25.  
  26. protected static <T extends Block> T register(T block)
  27. {
  28. ItemBlock itemBlock = new ItemBlock(block);
  29. itemBlock.setRegistryName(block.getRegistryName());
  30. return register(block, itemBlock);
  31. }
  32. }
Add Comment
Please, Sign In to add comment