From f4b58abbda168b01513a5ac2ba2870bc00df7074 Mon Sep 17 00:00:00 2001 From: RoseGoldIsntGay Date: Thu, 27 Jan 2022 20:44:16 +0200 Subject: 2.7.0-pre2 --- .../rosegoldaddons/features/ArmorStandESPs.java | 2 +- .../rosegoldaddons/features/AutoArrowAlign.java | 20 +-- .../java/rosegoldaddons/features/AutoReady.java | 14 +- .../java/rosegoldaddons/features/AutoSlayer.java | 27 ++-- .../rosegoldaddons/features/BloodTriggerBot.java | 10 +- .../java/rosegoldaddons/features/BrewingMacro.java | 52 +++---- .../java/rosegoldaddons/features/CanePlanter.java | 18 +-- .../java/rosegoldaddons/features/CropNuker.java | 118 +++++++++------ .../rosegoldaddons/features/CustomItemMacro.java | 16 +- .../rosegoldaddons/features/DamagePerSecond.java | 12 -- .../rosegoldaddons/features/EndermanMacro.java | 8 +- .../java/rosegoldaddons/features/EntityReach.java | 16 +- .../features/ForagingIslandMacro.java | 66 ++++----- .../rosegoldaddons/features/ForagingNuker.java | 10 +- .../java/rosegoldaddons/features/GemstoneAura.java | 22 +-- .../java/rosegoldaddons/features/GhostMacro.java | 6 +- .../rosegoldaddons/features/HardstoneAura.java | 161 ++++++++++++++++----- .../java/rosegoldaddons/features/MithrilMacro.java | 133 +++++++++++++++++ .../java/rosegoldaddons/features/MithrilNuker.java | 22 +-- .../java/rosegoldaddons/features/NecronAimbot.java | 4 +- .../rosegoldaddons/features/PartyUntransfer.java | 8 +- .../rosegoldaddons/features/PingWorldChange.java | 2 +- .../rosegoldaddons/features/PinglessMining.java | 31 ++-- .../java/rosegoldaddons/features/PowderMacro.java | 12 +- src/main/java/rosegoldaddons/features/SexAura.java | 28 +++- .../rosegoldaddons/features/SwordSwapping.java | 20 +-- 26 files changed, 554 insertions(+), 284 deletions(-) delete mode 100644 src/main/java/rosegoldaddons/features/DamagePerSecond.java create mode 100644 src/main/java/rosegoldaddons/features/MithrilMacro.java (limited to 'src/main/java/rosegoldaddons/features') diff --git a/src/main/java/rosegoldaddons/features/ArmorStandESPs.java b/src/main/java/rosegoldaddons/features/ArmorStandESPs.java index c0958bb..54616e7 100644 --- a/src/main/java/rosegoldaddons/features/ArmorStandESPs.java +++ b/src/main/java/rosegoldaddons/features/ArmorStandESPs.java @@ -42,7 +42,7 @@ public class ArmorStandESPs { private static ArrayList getAllEntitiesInRange() { ArrayList entities = new ArrayList<>(); - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (!(entity1 instanceof EntityItem) && !(entity1 instanceof EntityXPOrb) &&!(entity1 instanceof EntityWither) && !(entity1 instanceof EntityPlayerSP)) { entities.add(entity1); } diff --git a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java index e4c9c14..db9650f 100644 --- a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java +++ b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java @@ -62,7 +62,7 @@ public class AutoArrowAlign { public void onRender(RenderWorldLastEvent event) { if (!Main.configFile.autoArrowAlign) return; itemFrames.clear(); - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (entity1 instanceof EntityItemFrame) { itemFrames.add(entity1); } @@ -126,8 +126,8 @@ public class AutoArrowAlign { Thread.sleep(500); if(finalSave != null) { interactWithEntity(finalSave); - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.sendUseItem(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.getHeldItem()); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.sendUseItem(Main.mc.thePlayer, Main.mc.theWorld, Main.mc.thePlayer.getHeldItem()); } } catch (Exception e) { e.printStackTrace(); @@ -317,25 +317,25 @@ public class AutoArrowAlign { rightClickMouse = Minecraft.class.getDeclaredMethod("func_147121_ag"); } rightClickMouse.setAccessible(true); - rightClickMouse.invoke(Minecraft.getMinecraft()); + rightClickMouse.invoke(Main.mc); } catch (Exception e) { e.printStackTrace(); } } private static void interactWithEntity(Entity entity) { - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.interactWithEntitySendPacket(Minecraft.getMinecraft().thePlayer, entity); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.interactWithEntitySendPacket(Main.mc.thePlayer, entity); } private static void interactWithEntity2(Entity entity) { - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.isPlayerRightClickingOnEntity(Minecraft.getMinecraft().thePlayer, entity, Minecraft.getMinecraft().objectMouseOver); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.isPlayerRightClickingOnEntity(Main.mc.thePlayer, entity, Main.mc.objectMouseOver); } private static boolean isInSection3() { - int x = Minecraft.getMinecraft().thePlayer.getPosition().getX(); - int z = Minecraft.getMinecraft().thePlayer.getPosition().getZ(); + int x = Main.mc.thePlayer.getPosition().getX(); + int z = Main.mc.thePlayer.getPosition().getZ(); return x < 218 && z > 251 && x > 196 && z < 319; } } diff --git a/src/main/java/rosegoldaddons/features/AutoReady.java b/src/main/java/rosegoldaddons/features/AutoReady.java index f28910e..675d9f1 100644 --- a/src/main/java/rosegoldaddons/features/AutoReady.java +++ b/src/main/java/rosegoldaddons/features/AutoReady.java @@ -22,8 +22,8 @@ public class AutoReady { static int windowId; private static void interactWithEntity(Entity entity) { - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.interactWithEntitySendPacket(Minecraft.getMinecraft().thePlayer, entity); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.interactWithEntitySendPacket(Main.mc.thePlayer, entity); } @SubscribeEvent @@ -34,7 +34,7 @@ public class AutoReady { checkingEntities = true; Thread.sleep(500); Entity mort = null; - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (entity1.getName().contains("Mort")) { mort = entity1; interactWithEntity(mort); @@ -64,7 +64,7 @@ public class AutoReady { if (container instanceof ContainerChest) { String chestName = ((ContainerChest) container).getLowerChestInventory().getDisplayName().getUnformattedText(); List invSlots = container.inventorySlots; - //Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(chestName)); + //Main.mc.thePlayer.addChatMessage(new ChatComponentText(chestName)); if (chestName.contains("Start Dungeon?")) { int i; for(i = 0; i < invSlots.size(); i++) { @@ -79,7 +79,7 @@ public class AutoReady { for(i = 0; i < invSlots.size(); i++) { if(!invSlots.get(i).getHasStack()) continue; String slotName = StringUtils.stripControlCodes(invSlots.get(i).getStack().getDisplayName()); - if(slotName.contains(Minecraft.getMinecraft().thePlayer.getName())) { + if(slotName.contains(Main.mc.thePlayer.getName())) { i += 9; if(invSlots.get(i).getHasStack()) { if (StringUtils.stripControlCodes(invSlots.get(i).getStack().getDisplayName()).equals("Not Ready")) { @@ -94,7 +94,7 @@ public class AutoReady { } private void clickSlot(Slot slot) { - windowId = Minecraft.getMinecraft().thePlayer.openContainer.windowId; - Minecraft.getMinecraft().playerController.windowClick(windowId, slot.slotNumber, 1, 0, Minecraft.getMinecraft().thePlayer); + windowId = Main.mc.thePlayer.openContainer.windowId; + Main.mc.playerController.windowClick(windowId, slot.slotNumber, 1, 0, Main.mc.thePlayer); } } diff --git a/src/main/java/rosegoldaddons/features/AutoSlayer.java b/src/main/java/rosegoldaddons/features/AutoSlayer.java index bcea552..64b173a 100644 --- a/src/main/java/rosegoldaddons/features/AutoSlayer.java +++ b/src/main/java/rosegoldaddons/features/AutoSlayer.java @@ -15,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import rosegoldaddons.Main; +import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.ScoreboardUtils; import java.util.List; @@ -26,6 +27,7 @@ public class AutoSlayer { private static boolean waitingForMaddox = false; private static int slayerSlot = 0; private static int slotLevel = 0; + private static int debounce = 0; @SubscribeEvent public void chat(ClientChatReceivedEvent event) { @@ -45,18 +47,18 @@ public class AutoSlayer { @SubscribeEvent public void onInteract(InputEvent.KeyInputEvent event) { - if (!Main.configFile.autoSlayer || !Main.configFile.clickMaddox || waitingForMaddox) return; + if (!Main.configFile.autoSlayer || !Main.configFile.clickMaddox || waitingForMaddox || debounce != 0) return; List scoreboard = ScoreboardUtils.getSidebarLines(); for (String line : scoreboard) { String cleanedLine = ScoreboardUtils.cleanSB(line); if (cleanedLine.contains("Boss slain!")) { int maddox = findItemInHotbar("Batphone"); if (maddox != -1) { - ItemStack item = Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(maddox); - int save = Minecraft.getMinecraft().thePlayer.inventory.currentItem; - Minecraft.getMinecraft().thePlayer.inventory.currentItem = maddox; - Minecraft.getMinecraft().playerController.sendUseItem(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, item); - Minecraft.getMinecraft().thePlayer.inventory.currentItem = save; + ItemStack item = Main.mc.thePlayer.inventory.getStackInSlot(maddox); + int save = Main.mc.thePlayer.inventory.currentItem; + Main.mc.thePlayer.inventory.currentItem = maddox; + Main.mc.playerController.sendUseItem(Main.mc.thePlayer, Main.mc.theWorld, item); + Main.mc.thePlayer.inventory.currentItem = save; waitingForMaddox = true; break; } @@ -67,8 +69,11 @@ public class AutoSlayer { @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { if (!Main.configFile.autoSlayer) return; + if (debounce > 0) { + debounce--; + } if (!openMaddox) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand); + Main.mc.thePlayer.sendChatMessage(lastMaddoxCommand); switch (Main.configFile.slayerTypeIndex) { case 1: slayerSlot = 10; //zombie @@ -125,7 +130,7 @@ public class AutoSlayer { if (container instanceof ContainerChest) { String chestName = ((ContainerChest) container).getLowerChestInventory().getDisplayName().getUnformattedText(); if (chestName.contains("Slayer")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; if (!chestInventory.get(13).getHasStack()) return; if (chestInventory.get(13).getStack().getDisplayName().contains("Ongoing")) { @@ -134,10 +139,12 @@ public class AutoSlayer { clickSlot(slayerSlot, 2, 1); clickSlot(slotLevel, 2, 2); clickSlot(11, 2, 3); //confirm + debounce = 80; } else { clickSlot(slayerSlot, 2, 0); clickSlot(slotLevel, 2, 1); clickSlot(11, 2, 2); //confirm + debounce = 80; } slayerSlot = 0; slotLevel = 0; @@ -149,7 +156,7 @@ public class AutoSlayer { } private static int findItemInHotbar(String name) { - InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + InventoryPlayer inv = Main.mc.thePlayer.inventory; for (int i = 0; i < 9; i++) { ItemStack curStack = inv.getStackInSlot(i); if (curStack != null) { @@ -162,6 +169,6 @@ public class AutoSlayer { } private void clickSlot(int slot, int type, int windowAdd) { - Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().thePlayer.openContainer.windowId + windowAdd, slot, type, 0, Minecraft.getMinecraft().thePlayer); + Main.mc.playerController.windowClick(Main.mc.thePlayer.openContainer.windowId + windowAdd, slot, type, 0, Main.mc.thePlayer); } } diff --git a/src/main/java/rosegoldaddons/features/BloodTriggerBot.java b/src/main/java/rosegoldaddons/features/BloodTriggerBot.java index 7f5909d..1620794 100644 --- a/src/main/java/rosegoldaddons/features/BloodTriggerBot.java +++ b/src/main/java/rosegoldaddons/features/BloodTriggerBot.java @@ -21,14 +21,14 @@ public class BloodTriggerBot { if (event.phase == TickEvent.Phase.END) return; for (Entity entity : getAllBloodMobs()) { if (isLookingAtAABB(entity.getEntityBoundingBox(), 1F)) { - Minecraft.getMinecraft().thePlayer.swingItem(); + Main.mc.thePlayer.swingItem(); } } } private static boolean isLookingAtAABB(AxisAlignedBB aabb, float partialTicks) { - Vec3 position = new Vec3(Minecraft.getMinecraft().thePlayer.posX, (Minecraft.getMinecraft().thePlayer.posY + Minecraft.getMinecraft().thePlayer.getEyeHeight()), Minecraft.getMinecraft().thePlayer.posZ); - Vec3 look = Minecraft.getMinecraft().thePlayer.getLook(partialTicks); + Vec3 position = new Vec3(Main.mc.thePlayer.posX, (Main.mc.thePlayer.posY + Main.mc.thePlayer.getEyeHeight()), Main.mc.thePlayer.posZ); + Vec3 look = Main.mc.thePlayer.getLook(partialTicks); look = scaleVec(look, 0.5F); for (int i = 0; i < 64; i++) { if (aabb.minX <= position.xCoord && aabb.maxX >= position.xCoord && aabb.minY <= position.yCoord && aabb.maxY >= position.yCoord && aabb.minZ <= position.zCoord && aabb.maxZ >= position.zCoord) { @@ -42,8 +42,8 @@ public class BloodTriggerBot { private static ArrayList getAllBloodMobs() { ArrayList bloodMobs = new ArrayList<>(); - if (Minecraft.getMinecraft().theWorld == null) return bloodMobs; - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + if (Main.mc.theWorld == null) return bloodMobs; + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (entity1 instanceof EntityOtherPlayerMP && !entity1.isDead) { for (String name : names) { if (entity1.getName().contains(name)) { diff --git a/src/main/java/rosegoldaddons/features/BrewingMacro.java b/src/main/java/rosegoldaddons/features/BrewingMacro.java index f7febb3..e2fc381 100644 --- a/src/main/java/rosegoldaddons/features/BrewingMacro.java +++ b/src/main/java/rosegoldaddons/features/BrewingMacro.java @@ -32,16 +32,16 @@ public class BrewingMacro { public void onTick(TickEvent.ClientTickEvent event) { if (!Main.brewingMacro || !Main.configFile.openstand || Main.configFile.alchindex != 0) return; if (event.phase == TickEvent.Phase.END) { - if (Minecraft.getMinecraft().currentScreen == null && stand != null && !sell) { - if (Minecraft.getMinecraft().playerController.onPlayerRightClick( - Minecraft.getMinecraft().thePlayer, - Minecraft.getMinecraft().theWorld, - Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), + if (Main.mc.currentScreen == null && stand != null && !sell) { + if (Main.mc.playerController.onPlayerRightClick( + Main.mc.thePlayer, + Main.mc.theWorld, + Main.mc.thePlayer.inventory.getCurrentItem(), stand, - EnumFacing.fromAngle(Minecraft.getMinecraft().thePlayer.rotationYaw), + EnumFacing.fromAngle(Main.mc.thePlayer.rotationYaw), new Vec3(Math.random(), Math.random(), Math.random()) )) { - Minecraft.getMinecraft().thePlayer.swingItem(); + Main.mc.thePlayer.swingItem(); } } } @@ -60,7 +60,7 @@ public class BrewingMacro { try { if (Main.configFile.alchindex == 0) { if (chestName.contains("Brewing Stand")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if ((slot.getStack().getDisplayName().contains("Speed") || slot.getStack().getDisplayName().contains("Weakness")) && slot.slotNumber < 54) { @@ -68,7 +68,7 @@ public class BrewingMacro { Thread.sleep(sleep); if (isInventoryFull()) { sell = true; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/sbmenu"); + Main.mc.thePlayer.sendChatMessage("/sbmenu"); } } } @@ -78,7 +78,7 @@ public class BrewingMacro { Thread.sleep(sleep); clickSlot(22, 0, 0); } else if (chestName.contains("Trades")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if ((slot.getStack().getDisplayName().contains("Speed") || slot.getStack().getDisplayName().contains("Weakness")) && slot.slotNumber >= 54) { @@ -86,13 +86,13 @@ public class BrewingMacro { Thread.sleep(sleep); } } - Minecraft.getMinecraft().thePlayer.closeScreen(); + Main.mc.thePlayer.closeScreen(); sell = false; } } } else if (Main.configFile.alchindex == 1) { if (chestName.contains("Brewing Stand")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if (!chestInventory.get(42).getHasStack()) { @@ -103,12 +103,12 @@ public class BrewingMacro { } } if (Main.configFile.alchclose) { - Minecraft.getMinecraft().thePlayer.closeScreen(); + Main.mc.thePlayer.closeScreen(); } } } else if (Main.configFile.alchindex == 2) { if (chestName.contains("Brewing Stand")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if (!chestInventory.get(13).getHasStack()) { @@ -123,12 +123,12 @@ public class BrewingMacro { } } if (Main.configFile.alchclose) { - Minecraft.getMinecraft().thePlayer.closeScreen(); + Main.mc.thePlayer.closeScreen(); } } } else if (Main.configFile.alchindex == 3) { if (chestName.contains("Brewing Stand")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if (!chestInventory.get(13).getHasStack()) { @@ -143,12 +143,12 @@ public class BrewingMacro { } } if (Main.configFile.alchclose) { - Minecraft.getMinecraft().thePlayer.closeScreen(); + Main.mc.thePlayer.closeScreen(); } } } else if (Main.configFile.alchindex == 4) { if (chestName.contains("Brewing Stand")) { - List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; for (Slot slot : chestInventory) { if (!slot.getHasStack()) continue; if (!chestInventory.get(13).getHasStack()) { @@ -163,7 +163,7 @@ public class BrewingMacro { } } if (Main.configFile.alchclose) { - Minecraft.getMinecraft().thePlayer.closeScreen(); + Main.mc.thePlayer.closeScreen(); } } } @@ -188,7 +188,7 @@ public class BrewingMacro { } private boolean isInventoryFull() { - List inventory = Minecraft.getMinecraft().thePlayer.inventoryContainer.inventorySlots; + List inventory = Main.mc.thePlayer.inventoryContainer.inventorySlots; for (Slot slot : inventory) { if (!slot.getHasStack() && slot.slotNumber > 8) { return false; @@ -199,16 +199,16 @@ public class BrewingMacro { private BlockPos closestStand() { int r = 6; - if (Minecraft.getMinecraft().thePlayer == null) return null; - BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + if (Main.mc.thePlayer == null) return null; + BlockPos playerPos = Main.mc.thePlayer.getPosition(); playerPos.add(0, 1, 0); - Vec3 playerVec = Minecraft.getMinecraft().thePlayer.getPositionVector(); + Vec3 playerVec = Main.mc.thePlayer.getPositionVector(); Vec3i vec3i = new Vec3i(r, r, r); ArrayList stands = new ArrayList(); if (playerPos != null) { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); - //Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(blockState.getBlock().toString())); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); + //Main.mc.thePlayer.addChatMessage(new ChatComponentText(blockState.getBlock().toString())); if (blockState.getBlock() == Blocks.brewing_stand) { stands.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } @@ -230,6 +230,6 @@ public class BrewingMacro { } private void clickSlot(int slot, int type, int mode) { - Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().thePlayer.openContainer.windowId, slot, type, mode, Minecraft.getMinecraft().thePlayer); + Main.mc.playerController.windowClick(Main.mc.thePlayer.openContainer.windowId, slot, type, mode, Main.mc.thePlayer); } } diff --git a/src/main/java/rosegoldaddons/features/CanePlanter.java b/src/main/java/rosegoldaddons/features/CanePlanter.java index 0a93a85..5f656d9 100644 --- a/src/main/java/rosegoldaddons/features/CanePlanter.java +++ b/src/main/java/rosegoldaddons/features/CanePlanter.java @@ -25,24 +25,24 @@ public class CanePlanter { int cane = findItemInHotbar("Cane"); BlockPos dirt = furthestEmptyDirt(); if (cane != -1 && dirt != null) { - ItemStack item = Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(cane); - Minecraft.getMinecraft().thePlayer.inventory.currentItem = cane; - Minecraft.getMinecraft().playerController.onPlayerRightClick(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, item, dirt, EnumFacing.UP, Minecraft.getMinecraft().thePlayer.getLookVec()); + ItemStack item = Main.mc.thePlayer.inventory.getStackInSlot(cane); + Main.mc.thePlayer.inventory.currentItem = cane; + Main.mc.playerController.onPlayerRightClick(Main.mc.thePlayer, Main.mc.theWorld, item, dirt, EnumFacing.UP, Main.mc.thePlayer.getLookVec()); } } private BlockPos furthestEmptyDirt() { int r = 5; - BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + BlockPos playerPos = Main.mc.thePlayer.getPosition(); playerPos.add(0, 1, 0); - Vec3 playerVec = Minecraft.getMinecraft().thePlayer.getPositionVector(); + Vec3 playerVec = Main.mc.thePlayer.getPositionVector(); Vec3i vec3i = new Vec3i(r, r, r); ArrayList dirts = new ArrayList(); if (playerPos != null) { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); - IBlockState blockState2 = Minecraft.getMinecraft().theWorld.getBlockState(blockPos.add(0, 1, 0)); - //Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(blockState.getBlock().toString())); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); + IBlockState blockState2 = Main.mc.theWorld.getBlockState(blockPos.add(0, 1, 0)); + //Main.mc.thePlayer.addChatMessage(new ChatComponentText(blockState.getBlock().toString())); if (blockState.getBlock() == Blocks.dirt && blockState2.getBlock() == Blocks.air) { dirts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } @@ -64,7 +64,7 @@ public class CanePlanter { } private static int findItemInHotbar(String name) { - InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + InventoryPlayer inv = Main.mc.thePlayer.inventory; for (int i = 0; i < 9; i++) { ItemStack curStack = inv.getStackInSlot(i); if (curStack != null) { diff --git a/src/main/java/rosegoldaddons/features/CropNuker.java b/src/main/java/rosegoldaddons/features/CropNuker.java index fc00737..915acae 100644 --- a/src/main/java/rosegoldaddons/features/CropNuker.java +++ b/src/main/java/rosegoldaddons/features/CropNuker.java @@ -22,15 +22,15 @@ public class CropNuker { private static int ticks = 0; @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { + public void onTick(TickEvent.PlayerTickEvent event) { //if(event.phase == TickEvent.Phase.END) return; - if (!Main.nukeCrops || Minecraft.getMinecraft().thePlayer == null) { + if (!Main.nukeCrops || Main.mc.thePlayer == null) { broken.clear(); return; } crop = closestCrop(); if (crop != null) { - Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, crop, EnumFacing.DOWN)); + Main.mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, crop, EnumFacing.DOWN)); PlayerUtils.swingItem(); broken.add(crop); } @@ -46,11 +46,11 @@ public class CropNuker { } private BlockPos closestCrop() { - if(Minecraft.getMinecraft().theWorld == null) return null; + if(Main.mc.theWorld == null) return null; double r = 6; - BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + BlockPos playerPos = Main.mc.thePlayer.getPosition(); playerPos = playerPos.add(0, 1, 0); - Vec3 playerVec = Minecraft.getMinecraft().thePlayer.getPositionVector(); + Vec3 playerVec = Main.mc.thePlayer.getPositionVector(); Vec3i vec3i = new Vec3i(r, r, r); if (Main.configFile.farmShapeIndex == 1) { vec3i = new Vec3i(r, 2, r); @@ -61,16 +61,16 @@ public class CropNuker { switch (Main.configFile.farmNukeIndex) { case 0: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.nether_wart || blockState.getBlock() == Blocks.potatoes || blockState.getBlock() == Blocks.wheat || blockState.getBlock() == Blocks.carrots || blockState.getBlock() == Blocks.pumpkin || blockState.getBlock() == Blocks.melon_block || blockState.getBlock() == Blocks.brown_mushroom || blockState.getBlock() == Blocks.red_mushroom || blockState.getBlock() == Blocks.cocoa) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -107,26 +107,62 @@ public class CropNuker { break; case 1: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3iCane), playerPos.subtract(vec3iCane))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.reeds || blockState.getBlock() == Blocks.cactus) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if (Main.configFile.farmShapeIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } else if (Main.configFile.farmShapeIndex == 1) { + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); + switch (dir) { + case NORTH: + if (blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if (blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if (blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if (blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } break; case 2: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.nether_wart) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -163,16 +199,16 @@ public class CropNuker { break; case 3: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.wheat) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -209,16 +245,16 @@ public class CropNuker { break; case 4: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.carrots) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -255,16 +291,16 @@ public class CropNuker { break; case 5: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.potatoes) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -301,16 +337,16 @@ public class CropNuker { break; case 6: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.pumpkin) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -347,16 +383,16 @@ public class CropNuker { break; case 7: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.melon_block) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { @@ -393,16 +429,16 @@ public class CropNuker { break; case 8: for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); + IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.cocoa) { if (Main.configFile.farmShapeIndex == 0) { if (!broken.contains(blockPos)) { warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); } } else if (Main.configFile.farmShapeIndex == 1) { - EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); - int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); - int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + EnumFacing dir = Main.mc.thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Main.mc.thePlayer.posX); + int z = (int) Math.floor(Main.mc.thePlayer.posZ); switch (dir) { case NORTH: if (blockPos.getZ() < z && blockPos.getX() == x) { diff --git a/src/main/java/rosegoldaddons/features/CustomItemMacro.java b/src/main/java/rosegoldaddons/features/CustomItemMacro.java index 41ba9a7..b776f86 100644 --- a/src/main/java/rosegoldaddons/features/CustomItemMacro.java +++ b/src/main/java/rosegoldaddons/features/CustomItemMacro.java @@ -23,13 +23,13 @@ public class CustomItemMacro { if (thread == null || !thread.isAlive()) { thread = new Thread(() -> { try { - int prevItem = Minecraft.getMinecraft().thePlayer.inventory.currentItem; + int prevItem = Main.mc.thePlayer.inventory.currentItem; for (String i : UseCooldown.RCitems.keySet()) { if (milis % Math.floor(UseCooldown.RCitems.get(i)/100) == 0) { int slot = findItemInHotbar(i); if (slot != -1) { - Minecraft.getMinecraft().thePlayer.inventory.currentItem = slot; - Minecraft.getMinecraft().playerController.sendUseItem(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(slot)); + Main.mc.thePlayer.inventory.currentItem = slot; + Main.mc.playerController.sendUseItem(Main.mc.thePlayer, Main.mc.theWorld, Main.mc.thePlayer.inventory.getStackInSlot(slot)); } } } @@ -37,13 +37,13 @@ public class CustomItemMacro { if (milis % Math.floor(UseCooldown.LCitems.get(i)/100) == 0) { int slot = findItemInHotbar(i); if (slot != -1) { - Minecraft.getMinecraft().thePlayer.inventory.currentItem = slot; + Main.mc.thePlayer.inventory.currentItem = slot; Thread.sleep(100); click(); } } } - Minecraft.getMinecraft().thePlayer.inventory.currentItem = prevItem; + Main.mc.thePlayer.inventory.currentItem = prevItem; milis++; Thread.sleep(100); } catch (Exception e) { @@ -63,15 +63,15 @@ public class CustomItemMacro { clickMouse = Minecraft.class.getDeclaredMethod("clickMouse"); } clickMouse.setAccessible(true); - clickMouse.invoke(Minecraft.getMinecraft()); + clickMouse.invoke(Main.mc); } catch (Exception e) { e.printStackTrace(); }*/ - Minecraft.getMinecraft().thePlayer.swingItem(); + Main.mc.thePlayer.swingItem(); } private static int findItemInHotbar(String name) { - InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + InventoryPlayer inv = Main.mc.thePlayer.inventory; for (int i = 0; i < 9; i++) { ItemStack curStack = inv.getStackInSlot(i); if (curStack != null) { diff --git a/src/main/java/rosegoldaddons/features/DamagePerSecond.java b/src/main/java/rosegoldaddons/features/DamagePerSecond.java deleted file mode 100644 index e0d990f..0000000 --- a/src/main/java/rosegoldaddons/features/DamagePerSecond.java +++ /dev/null @@ -1,12 +0,0 @@ -package rosegoldaddons.features; - -import net.minecraft.client.Minecraft; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class DamagePerSecond { - @SubscribeEvent - public void onEntityJoin(EntityJoinWorldEvent event) { - - } -} diff --git a/src/main/java/rosegoldaddons/features/EndermanMacro.java b/src/main/java/rosegoldaddons/features/EndermanMacro.java index 5e88e74..b0ff72a 100644 --- a/src/main/java/rosegoldaddons/features/EndermanMacro.java +++ b/src/main/java/rosegoldaddons/features/EndermanMacro.java @@ -34,10 +34,10 @@ public class EndermanMacro { private static Entity getClosestEnderman() { Entity eman = null; double closest = 9999; - if(Minecraft.getMinecraft().theWorld == null) return null; - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { - if (entity1 instanceof EntityEnderman && !(((EntityEnderman) entity1).getHealth() == 0) && Minecraft.getMinecraft().thePlayer.canEntityBeSeen(entity1)) { - double dist = entity1.getDistanceSq(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posY, Minecraft.getMinecraft().thePlayer.posZ); + if(Main.mc.theWorld == null) return null; + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { + if (entity1 instanceof EntityEnderman && !(((EntityEnderman) entity1).getHealth() == 0) && Main.mc.thePlayer.canEntityBeSeen(entity1)) { + double dist = entity1.getDistance(Main.mc.thePlayer.posX, Main.mc.thePlayer.posY, Main.mc.thePlayer.posZ); if (dist < closest) { if(Main.configFile.macroRadius != 0 && dist < Main.configFile.macroRadius) { closest = dist; diff --git a/src/main/java/rosegoldaddons/features/EntityReach.java b/src/main/java/rosegoldaddons/features/EntityReach.java index f59c37a..21a4691 100644 --- a/src/main/java/rosegoldaddons/features/EntityReach.java +++ b/src/main/java/rosegoldaddons/features/EntityReach.java @@ -96,7 +96,7 @@ public class EntityReach { private static Entity getClosestArmorStand(Entity entity) { Entity closest = null; double smallest = 9999; - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (entity1 instanceof EntityArmorStand) { double dist = entity.getDistanceToEntity(entity1); if(dist < smallest) { @@ -109,8 +109,8 @@ public class EntityReach { } private static boolean isLookingAtAABB(AxisAlignedBB aabb, RenderWorldLastEvent event) { - Vec3 position = new Vec3(Minecraft.getMinecraft().thePlayer.posX, (Minecraft.getMinecraft().thePlayer.posY + Minecraft.getMinecraft().thePlayer.getEyeHeight()), Minecraft.getMinecraft().thePlayer.posZ); - Vec3 look = Minecraft.getMinecraft().thePlayer.getLook(event.partialTicks); + Vec3 position = new Vec3(Main.mc.thePlayer.posX, (Main.mc.thePlayer.posY + Main.mc.thePlayer.getEyeHeight()), Main.mc.thePlayer.posZ); + Vec3 look = Main.mc.thePlayer.getLook(event.partialTicks); look = scaleVec(look, 0.2F); for (int i = 0; i < 320; i++) { if (aabb.minX <= position.xCoord && aabb.maxX >= position.xCoord && aabb.minY <= position.yCoord && aabb.maxY >= position.yCoord && aabb.minZ <= position.zCoord && aabb.maxZ >= position.zCoord) { @@ -124,7 +124,7 @@ public class EntityReach { private static ArrayList getAllEntitiesInRange() { ArrayList entities = new ArrayList<>(); - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { if (!(entity1 instanceof EntityItem) && !(entity1 instanceof EntityXPOrb) &&!(entity1 instanceof EntityWither) && !(entity1 instanceof EntityPlayerSP)) { entities.add(entity1); } @@ -133,13 +133,13 @@ public class EntityReach { } private static void interactWithEntity(Entity entity) { - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.interactWithEntitySendPacket(Minecraft.getMinecraft().thePlayer, entity); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.interactWithEntitySendPacket(Main.mc.thePlayer, entity); } private static void interactWithEntity2(Entity entity) { - PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; - playerControllerMP.isPlayerRightClickingOnEntity(Minecraft.getMinecraft().thePlayer, entity, Minecraft.getMinecraft().objectMouseOver); + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.isPlayerRightClickingOnEntity(Main.mc.thePlayer, entity, Main.mc.objectMouseOver); } diff --git a/src/main/java/rosegoldaddons/features/ForagingIslandMacro.java b/src/main/java/rosegoldaddons/features/ForagingIslandMacro.java index c284e92..e06d7ea 100644 --- a/src/main/java/rosegoldaddons/features/ForagingIslandMacro.java +++ b/src/main/java/rosegoldaddons/features/ForagingIslandMacro.java @@ -30,7 +30,7 @@ public class ForagingIslandMacro { thread = new Thread(() -> { try { BlockPos furthestDirt = furthestEmptyDirt(); - //Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("furthest dirt "+furthestDirt)); + //Main.mc.thePlayer.addChatMessage(new ChatComponentText("furthest dirt "+furthestDirt)); int sapling = findItemInHotbar("Jungle Sapling"); if(sapling == -1) { sapling = findItemInHotbar("Oak Sapling"); @@ -60,16 +60,16 @@ public class ForagingIslandMacro { RotationUtils.facePos(new Vec3(furthestDirt.getX() + 0.5, furthestDirt.getY() - 0.5, furthestDirt.getZ() + 0.5)); Thread.sleep(Main.configFile.smoothLookVelocity * 2L); if (sapling != -1) { - if (Minecraft.getMinecraft().objectMouseOver.typeOfHit.toString().equals("BLOCK")) { - BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos(); - Block block = Minecraft.getMinecraft().theWorld.getBlockState(pos).getBlock(); + if (Main.mc.objectMouseOver.typeOfHit.toString().equals("BLOCK")) { + BlockPos pos = Main.mc.objectMouseOver.getBlockPos(); + Block block = Main.mc.theWorld.getBlockState(pos).getBlock(); if (block == Blocks.sapling) { click(); Thread.sleep(20); } } - Minecraft.getMinecraft().thePlayer.inventory.currentItem = sapling; - //Minecraft.getMinecraft().playerController.onPlayerRightClick(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), furthestDirt, EnumFacing.NORTH, Minecraft.getMinecraft().objectMouseOver.hitVec); + Main.mc.thePlayer.inventory.currentItem = sapling; + //Main.mc.playerController.onPlayerRightClick(Main.mc.thePlayer, Main.mc.theWorld, Main.mc.thePlayer.inventory.getCurrentItem(), furthestDirt, EnumFacing.NORTH, Main.mc.objectMouseOver.hitVec); rightClick(); } } else { @@ -77,7 +77,7 @@ public class ForagingIslandMacro { if (dirt != null) { RotationUtils.facePos(new Vec3(dirt.getX() + 0.5, dirt.getY(), dirt.getZ() + 0.5)); if (bonemeal != -1 && treecap != -1) { - Minecraft.getMinecraft().thePlayer.inventory.currentItem = bonemeal; + Main.mc.thePlayer.inventory.currentItem = bonemeal; Random rand = new Random(); int toAdd = 0; if(Main.configFile.randomizeForaging) { @@ -87,13 +87,13 @@ public class ForagingIslandMacro { Thread.sleep(Math.round(150*(1+(toAdd/100)))); rightClick(); rightClick(); - Minecraft.getMinecraft().thePlayer.inventory.currentItem = treecap; + Main.mc.thePlayer.inventory.currentItem = treecap; Thread.sleep(Math.round(Main.configFile.treecapDelay*(1+(toAdd/100)))); - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode(), true); + KeyBinding.setKeyBindState(Main.mc.gameSettings.keyBindAttack.getKeyCode(), true); Thread.sleep(Math.round(150*(1+(toAdd/100)))); - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode(), false); + KeyBinding.setKeyBindState(Main.mc.gameSettings.keyBindAttack.getKeyCode(), false); Thread.sleep(Math.round(25*(1+(toAdd/100)))); - Minecraft.getMinecraft().thePlayer.inventory.currentItem = rod; + Main.mc.thePlayer.inventory.currentItem = rod; Thread.sleep(Math.round(Main.configFile.prerodDelay*(1+(toAdd/100)))); rightClick(); Thread.sleep(Math.round(Main.configFile.postrodDelay*(1+(toAdd/100)))); @@ -124,9 +124,9 @@ public class ForagingIslandMacro { new Thread(() -> { try { Thread.sleep(rand2); - Minecraft.getMinecraft().thePlayer.sendChatMessage("/ac "+responses[rand]); + Main.mc.thePlayer.sendChatMessage("/ac "+responses[rand]); Thread.sleep(rand2*2); - Minecraft.getMinecraft().getNetHandler().getNetworkManager().closeChannel(new ChatComponentText("Antisus activated lets hope you didnt get banned")); + Main.mc.getNetHandler().getNetworkManager().closeChannel(new ChatComponentText("Antisus activated lets hope you didnt get banned")); } catch (Exception exception) { exception.printStackTrace(); } @@ -137,16 +137,16 @@ public class ForagingIslandMacro { private BlockPos furthestEmptyDirt() { int r = 5; - BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + BlockPos playerPos = Main.mc.thePlayer.getPosition(); playerPos.add(0, 1, 0); - Vec3 playerVec = Minecraft.getMinecraft().thePlayer.getPositionVector(); + Vec3 playerVec = Main.mc.thePlayer.getPositionVector(); Vec3i vec3i = new Vec3i(r, r, r); ArrayList dirts = new ArrayList(); if (playerPos != null) { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { - IBlockState blo