Advertisement
Guest User

Untitled

a guest
May 2nd, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3) braces deadcode fieldsfirst
  4.  
  5. package net.minecraft.src;
  6.  
  7.  
  8. // Referenced classes of package net.minecraft.src:
  9. // Entity, MathHelper, World, Block,
  10. // BlockPistonMoving, BlockSand, NBTTagCompound
  11.  
  12. public class ExplosivesPlusEntityFallingBlocks extends Entity
  13. {
  14.  
  15. public int blockID;
  16. public int fallTime;
  17. public Entity nova;
  18.  
  19. public ExplosivesPlusEntityFallingBlocks(World world)
  20. {
  21. super(world);
  22. fallTime = 0;
  23. }
  24.  
  25. public ExplosivesPlusEntityFallingBlocks(World world, Entity bomb, double d, double d1, double d2)
  26. {
  27. super(world);
  28. fallTime = 0;
  29. preventEntitySpawning = true;
  30. setSize(0.98F, 0.98F);
  31. yOffset = height / 2.0F;
  32. setPosition(d + 0.5, d1, d2 + 0.5);
  33. motionX = 0.0D;
  34. motionY = 0.0D;
  35. motionZ = 0.0D;
  36. prevPosX = d;
  37. prevPosY = d1;
  38. prevPosZ = d2;
  39. nova = bomb;
  40. }
  41.  
  42. protected boolean canTriggerWalking()
  43. {
  44. return false;
  45. }
  46.  
  47. protected void entityInit()
  48. {
  49. }
  50.  
  51. public boolean canBeCollidedWith()
  52. {
  53. return false;
  54. }
  55.  
  56. public void onUpdate()
  57. {
  58. if(blockID == 0)
  59. {
  60. setDead();
  61. System.out.println("Fail Type 2");
  62. return;
  63. }
  64. prevPosX = posX;
  65. prevPosY = posY;
  66. prevPosZ = posZ;
  67. fallTime++;
  68. motionY -= mod_ExplosivesPlus.FallingBlockSpeed; // motionY -= 0.009999999105930328D;
  69. moveEntity(motionX, motionY, motionZ);
  70. motionX *= 0.98000001907348633D;
  71. motionY *= 0.98000001907348633D;
  72. motionZ *= 0.98000001907348633D;
  73. int i = MathHelper.floor_double(posX);
  74. int j = MathHelper.floor_double(posY);
  75. int k = MathHelper.floor_double(posZ);
  76. if(fallTime == 1 && worldObj.getBlockId(i, j, k) == blockID)
  77. {
  78. //worldObj.setBlockWithNotify(i, j, k, 0);
  79. } else
  80.  
  81. if(fallTime == 1 && !mod_ExplosivesPlus.HighYieldNova)
  82. {
  83. setDead();
  84. System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield");
  85.  
  86. }
  87.  
  88. if(onGround)
  89.  
  90. {
  91.  
  92. motionX *= 0.69999998807907104D;
  93. motionZ *= 0.69999998807907104D;
  94. motionY *= -0.5D;
  95.  
  96. if(worldObj.getBlockId(i, j, k) != Block.pistonMoving.blockID)
  97. {
  98. setPosition(i, j, k);
  99. setDead();
  100. worldObj.setBlockWithNotify(i, j, k, blockID);
  101.  
  102.  
  103.  
  104. }
  105.  
  106. }
  107. }
  108.  
  109. protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
  110. {
  111. nbttagcompound.setByte("Tile", (byte)blockID);
  112. }
  113.  
  114. protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
  115. {
  116. blockID = nbttagcompound.getByte("Tile") & 0xff;
  117. }
  118.  
  119. public float getShadowSize()
  120. {
  121. return 0.0F;
  122. }
  123.  
  124. public World getWorld()
  125. {
  126. return worldObj;
  127. }
  128. @Override
  129. public boolean canBePushed(){
  130. return false;
  131. }
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement