Guest User

Untitled

a guest
Jun 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import java.util.Random;
  4.  
  5. public class BlockeasterEgg1 extends Block
  6. {
  7. public BlockeasterEgg1(int i, int j)
  8. {
  9. super(i, j, Material.pumpkin);
  10. }
  11.  
  12. public void onBlockAdded(World world, int i, int j, int k)
  13. {
  14. world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
  15. }
  16.  
  17. public void onNeighborBlockChange(World world, int i, int j, int k, int l)
  18. {
  19. world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
  20. }
  21.  
  22. public void updateTick(World world, int i, int j, int k, Random random)
  23. {
  24. fallIfPossible(world, i, j, k);
  25. }
  26.  
  27. private void fallIfPossible(World world, int i, int j, int k)
  28. {
  29. int l = i;
  30. int i1 = j;
  31. int j1 = k;
  32. if (BlockSand.canFallBelow(world, l, i1 - 1, j1) && i1 >= 0)
  33. {
  34. byte byte0 = 32;
  35. if (BlockSand.fallInstantly || !world.checkChunksExist(i - byte0, j - byte0, k - byte0, i + byte0, j + byte0, k + byte0))
  36. {
  37. world.setBlockWithNotify(i, j, k, 0);
  38. for (; BlockSand.canFallBelow(world, i, j - 1, k) && j > 0; j--) { }
  39. if (j > 0)
  40. {
  41. world.setBlockWithNotify(i, j, k, blockID);
  42. }
  43. }
  44. else
  45. {
  46. EntityFallingSand entityfallingsand = new EntityFallingSand(world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, blockID);
  47. world.spawnEntityInWorld(entityfallingsand);
  48. }
  49. }
  50. }
  51.  
  52. public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
  53. {
  54. teleportNearby(world, i, j, k);
  55. return true;
  56. }
  57.  
  58. public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
  59. {
  60. teleportNearby(world, i, j, k);
  61. }
  62.  
  63. private void teleportNearby(World world, int i, int j, int k)
  64. {
  65. if (world.getBlockId(i, j, k) != blockID)
  66. {
  67. return;
  68. }
  69. if (world.multiplayerWorld)
  70. {
  71. return;
  72. }
  73. for (int l = 0; l < 1000; l++)
  74. {
  75. int i1 = (i + world.rand.nextInt(16)) - world.rand.nextInt(16);
  76. int j1 = (j + world.rand.nextInt(8)) - world.rand.nextInt(8);
  77. int k1 = (k + world.rand.nextInt(16)) - world.rand.nextInt(16);
  78. if (world.getBlockId(i1, j1, k1) == 0)
  79. {
  80. world.setBlockAndMetadataWithNotify(i1, j1, k1, blockID, world.getBlockMetadata(i, j, k));
  81. world.setBlockWithNotify(i, j, k, 0);
  82. char c = '\200';
  83. for (int l1 = 0; l1 < c; l1++)
  84. {
  85. double d = world.rand.nextDouble();
  86. float f = (world.rand.nextFloat() - 0.5F) * 0.2F;
  87. float f1 = (world.rand.nextFloat() - 0.5F) * 0.2F;
  88. float f2 = (world.rand.nextFloat() - 0.5F) * 0.2F;
  89. double d1 = (double)i1 + (double)(i - i1) * d + (world.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
  90. double d2 = ((double)j1 + (double)(j - j1) * d + world.rand.nextDouble() * 1.0D) - 0.5D;
  91. double d3 = (double)k1 + (double)(k - k1) * d + (world.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
  92. world.spawnParticle("portal", d1, d2, d3, f, f1, f2);
  93. }
  94.  
  95. return;
  96. }
  97. }
  98. }
  99.  
  100. public int tickRate()
  101. {
  102. return 3;
  103. }
  104.  
  105. public boolean canPlaceBlockAt(World world, int i, int j, int k)
  106. {
  107. return super.canPlaceBlockAt(world, i, j, k);
  108. }
  109.  
  110. public boolean isOpaqueCube()
  111. {
  112. return false;
  113. }
  114.  
  115. public boolean renderAsNormalBlock()
  116. {
  117. return false;
  118. }
  119.  
  120. public int getRenderType()
  121. {
  122. return 27;
  123. }
  124. }
  125.  
  126. /*
  127. package net.minecraft.src;
  128. import java.util.Random;
  129.  
  130. public class BlockBLueP extends Block
  131. {
  132. protected BlockBLueP(int i, int j)
  133. {
  134. super(i,j,Material.wood);
  135. }
  136.  
  137. public int idDropped(int i, Random random)
  138. {
  139. return Block.bedrock.blockID;
  140. }
  141.  
  142. public int quantityDropped(Random random)
  143. {
  144. return 1;
  145. }
  146. }
  147. */
Add Comment
Please, Sign In to add comment