Advertisement
Guest User

Untitled

a guest
Sep 8th, 2011
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. package net.minecraft.src;
  2. import java.util.Random;
  3.  
  4.  
  5. public class BlockStepBase extends Block
  6. {
  7. public BlockStepBase(int i, int j)
  8. {
  9. super(i,j,Material.ground);
  10. if(i==110)
  11. {
  12. setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
  13. }
  14. setLightOpacity(255);
  15. }
  16. public int getBlockTextureFromSideAndMetadata(int i, int j)
  17. {
  18. switch(j)
  19. {
  20. case 0://first metadata
  21. return mod_Block.blockBaseTexture;
  22. case 1://second metadata
  23. return mod_Block.blockBlank1Texture;
  24. case 2:
  25. return mod_Block.blockBlank2Texture;
  26. default://any other metadata
  27. return mod_Block.blockBaseTexture;
  28. }
  29. }
  30. public boolean isOpaqueCube()
  31. {
  32. return false;
  33. }
  34. public int getRenderBlockPass()
  35. {
  36. return 1;
  37. }
  38. public int idDropped(int i, Random random)
  39. {
  40. return 110;
  41. }
  42. public int quantityDropped(Random random)
  43. {
  44. if(blockID==110)
  45. {
  46. return 1;
  47. }
  48. return 2;
  49. }
  50.  
  51. public void onBlockAdded(World world, int i, int j, int k)
  52. {
  53. if(blockID != 110)
  54. {
  55. super.onBlockAdded(world, i, j, k);
  56. }
  57. int l = world.getBlockId(i, j - 1, k);
  58. int i1 = world.getBlockMetadata(i, j, k);
  59. int j1 = world.getBlockMetadata(i, j - 1, k);
  60. if(i1 != j1)
  61. {
  62. return;
  63. }
  64. if(l == 110)
  65. {
  66. world.setBlockWithNotify(i, j, k, 0);
  67. world.setBlockAndMetadataWithNotify(i, j - 1, k, 111, i1);
  68. }
  69. }
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement