diff options
| author | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-01-27 20:44:16 +0200 |
|---|---|---|
| committer | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-01-27 20:44:16 +0200 |
| commit | f4b58abbda168b01513a5ac2ba2870bc00df7074 (patch) | |
| tree | 2f237367764c74bba1f912acec1da281a2b74d24 /src/main/java/rosegoldaddons/features | |
| parent | fdc569f2ab7674d850d25b41519b4e3da244dd00 (diff) | |
| download | RGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.tar.gz RGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.tar.bz2 RGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.zip | |
2.7.0-pre2
Diffstat (limited to 'src/main/java/rosegoldaddons/features')
26 files changed, 554 insertions, 284 deletions
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<Entity> getAllEntitiesInRange() { ArrayList<Entity> 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<Slot> 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<String> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Entity> getAllBloodMobs() { ArrayList<Entity> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + List<Slot> 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<Slot> inventory = Minecraft.getMinecraft().thePlayer.inventoryContainer.inventorySlots; + List<Slot> 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<Vec3> stands = new ArrayList<Vec3>(); 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<Vec3> dirts = new ArrayList<Vec3>(); 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.po |
