Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. package jcm2606.thaumicmachina.block;
  2.  
  3. import jcm2606.thaumicmachina.ThaumicMachina;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.block.material.Material;
  6. import net.minecraft.client.renderer.texture.IIconRegister;
  7. import net.minecraft.util.IIcon;
  8. import cpw.mods.fml.relauncher.Side;
  9. import cpw.mods.fml.relauncher.SideOnly;
  10.  
  11. public class TMBlock extends Block
  12. {
  13. public IIcon customIcon;
  14.  
  15. public String name;
  16. public String texture;
  17.  
  18. public boolean useIconIndex = true;
  19. public int renderID = 0;
  20. public boolean renderAsNormalBlock = true;
  21. public boolean isOpaqueCube = true;
  22.  
  23. public TMBlock(String name, Material mat)
  24. {
  25. super(mat);
  26.  
  27. this.name = this.texture = name;
  28.  
  29. this.setBlockName(name);
  30.  
  31. this.setCreativeTab(ThaumicMachina.tab);
  32. }
  33.  
  34. public TMBlock(String name, Material mat, String texture)
  35. {
  36. super(mat);
  37.  
  38. this.name = name;
  39. this.texture = texture;
  40.  
  41. this.setBlockName(name);
  42.  
  43. this.setCreativeTab(ThaumicMachina.tab);
  44. }
  45.  
  46. @Override
  47. @SideOnly(Side.CLIENT)
  48. public void registerBlockIcons(IIconRegister register)
  49. {
  50. this.customIcon = register.registerIcon("thaumicmachina:" + this.texture);
  51. }
  52.  
  53. @Override
  54. @SideOnly(Side.CLIENT)
  55. public IIcon getIcon(int side, int meta)
  56. {
  57. return this.customIcon;
  58. }
  59.  
  60. @Override
  61. public int getRenderType()
  62. {
  63. return this.renderID;
  64. }
  65.  
  66. @Override
  67. public boolean isOpaqueCube()
  68. {
  69. return this.isOpaqueCube;
  70. }
  71.  
  72. @Override
  73. public boolean renderAsNormalBlock()
  74. {
  75. return this.renderAsNormalBlock;
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement