Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. package me.ihaq.iClient.modules.World;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import de.Hero.settings.Setting;
  6. import me.ihaq.iClient.Envy;
  7. import me.ihaq.iClient.event.EventTarget;
  8. import me.ihaq.iClient.event.events.move.EventPostMotionUpdates;
  9. import me.ihaq.iClient.event.events.move.EventPreMotionUpdates;
  10. import me.ihaq.iClient.event.events.render.EventRender3D;
  11. import me.ihaq.iClient.event.events.update.EventUpdate;
  12. import me.ihaq.iClient.modules.Module;
  13. import me.ihaq.iClient.utils.EntityUtils;
  14. import net.minecraft.block.Block;
  15. import net.minecraft.client.Minecraft;
  16. import net.minecraft.init.Blocks;
  17. import net.minecraft.network.Packet;
  18. import net.minecraft.network.play.client.C07PacketPlayerDigging;
  19. import net.minecraft.util.BlockPos;
  20. import net.minecraft.util.EnumFacing;
  21.  
  22. public class Breaker extends Module {
  23.  
  24. private int xPos;
  25. private int yPos;
  26. private int zPos;
  27. private int radius = 5;
  28. private BlockPos bPos;
  29.  
  30. public Breaker() {
  31. super("Breaker", Keyboard.KEY_NONE, Category.WORLD, "");
  32. Envy.SETTINGS_MANAGER.rSetting(new Setting("Radius", this, radius, 1, 7, true));
  33. Envy.SETTINGS_MANAGER.rSetting(new Setting("Bed", this, true));
  34. Envy.SETTINGS_MANAGER.rSetting(new Setting("Egg", this, true));
  35. }
  36.  
  37. @EventTarget
  38. public void onRender(EventRender3D e) {
  39. if (!this.isToggled()) {
  40. return;
  41. }
  42. setMode("\u00A7f: " + radius);
  43.  
  44. }
  45.  
  46. @EventTarget
  47. public void onPreMotion(EventPreMotionUpdates event) {
  48. if (!this.isToggled()) {
  49. return;
  50. }
  51. for (int x = -radius; x < radius; ++x) {
  52. for (int y = radius; y > -radius; --y) {
  53. for (int z = -radius; z < radius; ++z) {
  54. this.xPos = (int) Minecraft.thePlayer.posX + x;
  55. this.yPos = (int) Minecraft.thePlayer.posY + y;
  56. this.zPos = (int) Minecraft.thePlayer.posZ + z;
  57. BlockPos blockPos = new BlockPos(this.xPos, this.yPos, this.zPos);
  58. Block block = mc.theWorld.getBlockState(blockPos).getBlock();
  59. if (block.getBlockState().getBlock() == Blocks.bed
  60. && Envy.SETTINGS_MANAGER.getSettingByName("Bed").getValBoolean()
  61. || block.getBlockState().getBlock() == Blocks.dragon_egg
  62. && Envy.SETTINGS_MANAGER.getSettingByName("Egg").getValBoolean()) {
  63. this.bPos = blockPos;
  64. float[] values = EntityUtils.getBlockRotations(xPos, yPos, zPos, EnumFacing.NORTH);
  65. event.yaw = values[0];
  66. event.pitch = values[1];
  67. }
  68. }
  69. }
  70. }
  71. }
  72.  
  73. @EventTarget
  74. public void onPreMotion(EventPostMotionUpdates event) {
  75. if (!this.isToggled()) {
  76. return;
  77. }
  78.  
  79. if (this.bPos != null) {
  80. Minecraft.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(
  81. C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, this.bPos, EnumFacing.NORTH));
  82. Minecraft.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(
  83. C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, this.bPos, EnumFacing.NORTH));
  84. this.bPos = null;
  85. }
  86.  
  87. }
  88.  
  89. @EventTarget
  90. public void onUpdate(EventUpdate event) {
  91. radius = (int) Envy.SETTINGS_MANAGER.getSettingByName("Radius").getValDouble();
  92. }
  93.  
  94. @Override
  95. public void onEnable() {
  96. Envy.tellPlayer("This module is currently buggy please avoid using it.");
  97. }
  98.  
  99. @Override
  100. public void onDisable() {
  101. // TODO Auto-generated method stub
  102.  
  103. }
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement