Advertisement
thecodewarrior

Untitled

Feb 4th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package catwalks.item;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.item.ItemBlock;
  5.  
  6. public class ItemBlockCatwalk extends ItemBlock {
  7. public ItemBlockCatwalk(Block block)
  8. {
  9. super(block);
  10. this.setMaxDamage(0);
  11. this.setHasSubtypes(true);
  12. }
  13.  
  14. /**
  15. * Converts the given ItemStack damage value into a metadata value to be placed in the world when this Item is
  16. * placed as a Block (mostly used with ItemBlocks).
  17. */
  18. public int getMetadata(int damage)
  19. {
  20. return damage;
  21. }
  22.  
  23. }
  24.  
  25.  
  26. (extends BlockExtended)
  27. public BlockCatwalk() {
  28. super(Material.iron, "catwalk", ItemBlockCatwalk.class);
  29.  
  30. (extends BlockBase)
  31. public BlockExtended(Material materialIn, String name, Class<? extends ItemBlock> clazz) {
  32. super(materialIn, name, clazz);
  33. }
  34.  
  35. public BlockBase(Material materialIn, String name, Class<? extends ItemBlock> clazz) {
  36. super(materialIn);
  37. setUnlocalizedName(name);
  38. setRegistryName(name);
  39. setCreativeTab(CatwalksMod.tab);
  40. if(clazz == null) {
  41. GameRegistry.registerBlock(this);
  42. } else {
  43. GameRegistry.registerBlock(this, clazz);
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement