Advertisement
dennisb

BlockWhiteBlock

Jun 21st, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. package denbukki.blocks;
  2.  
  3. import cpw.mods.fml.relauncher.Side;
  4. import cpw.mods.fml.relauncher.SideOnly;
  5.  
  6. import java.util.List;
  7.  
  8. import net.minecraft.block.Block;
  9. import net.minecraft.block.material.MapColor;
  10. import net.minecraft.block.material.Material;
  11. import net.minecraft.client.renderer.texture.IIconRegister;
  12. import net.minecraft.creativetab.CreativeTabs;
  13. import net.minecraft.item.Item;
  14. import net.minecraft.item.ItemDye;
  15. import net.minecraft.item.ItemStack;
  16. import net.minecraft.util.IIcon;
  17.  
  18. public class BlockWhiteBlock extends Block
  19. {
  20. @SideOnly(Side.CLIENT)
  21. private IIcon[] field_150033_a;
  22. private static final String __OBFID = "CL_00000217";
  23.  
  24. public BlockWhiteBlock(Material p_i45398_1_)
  25. {
  26. super(p_i45398_1_);
  27.  
  28. }
  29.  
  30. /**
  31. * Gets the block's texture. Args: side, meta
  32. */
  33. @SideOnly(Side.CLIENT)
  34. public IIcon getIcon(int p_149691_1_, int p_149691_2_)
  35. {
  36. return this.field_150033_a[p_149691_2_ % this.field_150033_a.length];
  37. }
  38.  
  39. /**
  40. * Determines the damage on the item the block drops. Used in cloth and wood.
  41. */
  42. public int damageDropped(int p_149692_1_)
  43. {
  44. return p_149692_1_;
  45. }
  46.  
  47. public static int func_150032_b(int p_150032_0_)
  48. {
  49. return func_150031_c(p_150032_0_);
  50. }
  51.  
  52. public static int func_150031_c(int p_150031_0_)
  53. {
  54. return ~p_150031_0_ & 15;
  55. }
  56.  
  57. /**
  58. * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
  59. */
  60. @SideOnly(Side.CLIENT)
  61. public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_)
  62. {
  63. for (int i = 0; i < 16; ++i)
  64. {
  65. p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));
  66. }
  67. }
  68.  
  69. @SideOnly(Side.CLIENT)
  70. public void registerBlockIcons(IIconRegister p_149651_1_)
  71. {
  72. this.field_150033_a = new IIcon[16];
  73.  
  74. for (int i = 0; i < this.field_150033_a.length; ++i)
  75. {
  76. this.field_150033_a[i] = p_149651_1_.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150031_c(i)]);
  77. }
  78. }
  79.  
  80. public MapColor getMapColor(int p_149728_1_)
  81. {
  82. return MapColor.getMapColorForBlockColored(p_149728_1_);
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement