Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. package de.zickzack.base.modules.impl;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import de.zickzack.base.modules.Module;
  6. import net.minecraft.block.BlockAir;
  7. import net.minecraft.block.BlockGlass;
  8. import net.minecraft.block.BlockLeavesBase;
  9. import net.minecraft.block.state.IBlockState;
  10. import net.minecraft.entity.player.EntityPlayer;
  11. import net.minecraft.network.play.client.C03PacketPlayer;
  12. import net.minecraft.network.play.client.C0APacketAnimation;
  13. import net.minecraft.util.BlockPos;
  14. import net.minecraft.util.EnumFacing;
  15. import net.minecraft.util.Vec3;
  16.  
  17. public class Tower extends Module{
  18.  
  19. private int delay;
  20. private boolean jump;
  21.  
  22. public Tower() {
  23. super("Tower", "I", 0xFFFFFF, "Tower dich");
  24. }
  25.  
  26. public void onUpdate()
  27. {
  28. EntityPlayer p = mc.thePlayer;
  29. if (this.delay > 2) {
  30. this.delay -= 1;
  31. }
  32. if ((p.onGround) && (this.delay <= 2)) {
  33. this.jump = true;
  34. }
  35. if ((this.jump) && (this.delay <= 80))
  36. {
  37. BlockPos above = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY + 2.0D, mc.thePlayer.posZ);
  38. IBlockState aboveState = p.worldObj.getBlockState(above);
  39. if ((mc.thePlayer.onGround) && (
  40. ((aboveState.getBlock() instanceof BlockAir)) || ((aboveState.getBlock() instanceof BlockLeavesBase)) ||
  41. ((aboveState.getBlock() instanceof BlockGlass))))
  42. {
  43. mc.thePlayer.motionY = 0.2D;
  44.  
  45. p.setPositionAndUpdate(mc.thePlayer.posX, mc.thePlayer.posY + 1.0D, mc.thePlayer.posZ);
  46. }
  47. ArrayList<BlockPos> collisionBlocks = getCollisionBlocks();
  48. for (BlockPos pos : collisionBlocks)
  49. {
  50. IBlockState state = p.worldObj.getBlockState(pos);
  51. if ((state.getBlock() instanceof BlockAir))
  52. {
  53. mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
  54. mc.thePlayer.posY, mc.thePlayer.posZ, false));
  55. mc.thePlayer.sendQueue.netManager
  56. .sendPacket(new C03PacketPlayer.C05PacketPlayerLook(0.0F, 90.0F, true));
  57. mc.playerController.func_178890_a(mc.thePlayer, mc.theWorld,
  58. mc.thePlayer.inventory.getCurrentItem(), pos.add(0, -1, 0), EnumFacing.UP,
  59. new Vec3(pos.getX(), pos.getY(), pos.getZ()));
  60. mc.thePlayer.swingItem();
  61. mc.thePlayer.sendQueue.addToSendQueue(new C0APacketAnimation());
  62.  
  63. this.delay = 1;
  64. }
  65. }
  66. }
  67. }
  68.  
  69. public void onEnable()
  70. {
  71. mc.gameSettings.keyBindSneak.pressed = true;
  72. super.onEnable();
  73. }
  74.  
  75. public void onDisable()
  76. {
  77. mc.timer.timerSpeed = 1.0F;
  78. mc.gameSettings.keyBindSneak.pressed = false;
  79. super.onDisable();
  80. }
  81.  
  82. private ArrayList<BlockPos> getCollisionBlocks()
  83. {
  84. ArrayList<BlockPos> collidedBlocks = new ArrayList();
  85. EntityPlayer p = mc.thePlayer;
  86. for (int var3 = (int)Math.floor(p.posX); var3 <= (int)Math.floor(p.posX); var3++) {
  87. for (int var4 = (int)p.posY - 1; var4 <= (int)p.posY; var4++) {
  88. for (int var5 = (int)Math.floor(p.posZ); var5 <= (int)Math.floor(p.posZ); var5++)
  89. {
  90. BlockPos blockPos = new BlockPos(var3, var4, var5);
  91. try
  92. {
  93. if ((var4 > p.posY - 2.0D) && (var4 <= p.posY - 1.0D)) {
  94. collidedBlocks.add(blockPos);
  95. }
  96. }
  97. catch (Throwable localThrowable) {}
  98. }
  99. }
  100. }
  101. return collidedBlocks;
  102. }
  103.  
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement