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 --- src/main/java/rosegoldaddons/Config.java | 4 + src/main/java/rosegoldaddons/Main.java | 38 +++-- .../java/rosegoldaddons/commands/AllEntities.java | 3 +- .../java/rosegoldaddons/commands/Backpack.java | 4 +- .../java/rosegoldaddons/commands/LobbySwap.java | 3 +- .../java/rosegoldaddons/commands/Rosedrobe.java | 4 +- src/main/java/rosegoldaddons/commands/Rosepet.java | 3 +- .../java/rosegoldaddons/commands/SexPlayer.java | 5 +- .../java/rosegoldaddons/commands/UseCooldown.java | 9 +- .../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 +-- .../rosegoldaddons/mixins/MixinRenderString.java | 1 + src/main/java/rosegoldaddons/utils/BlockUtils.java | 155 ++++++++++++++++++++ src/main/java/rosegoldaddons/utils/ChatUtils.java | 5 +- .../java/rosegoldaddons/utils/OpenSkyblockGui.java | 14 +- .../java/rosegoldaddons/utils/PlayerUtils.java | 10 +- .../java/rosegoldaddons/utils/RenderUtils.java | 54 +++++-- src/main/java/rosegoldaddons/utils/Rotation.java | 44 ++++++ .../java/rosegoldaddons/utils/RotationUtils.java | 141 +++++++++++------- .../java/rosegoldaddons/utils/ScoreboardUtils.java | 5 +- 44 files changed, 945 insertions(+), 395 deletions(-) delete mode 100644 src/main/java/rosegoldaddons/features/DamagePerSecond.java create mode 100644 src/main/java/rosegoldaddons/features/MithrilMacro.java create mode 100644 src/main/java/rosegoldaddons/utils/BlockUtils.java create mode 100644 src/main/java/rosegoldaddons/utils/Rotation.java (limited to 'src/main/java') diff --git a/src/main/java/rosegoldaddons/Config.java b/src/main/java/rosegoldaddons/Config.java index c0a0908..f3394e1 100644 --- a/src/main/java/rosegoldaddons/Config.java +++ b/src/main/java/rosegoldaddons/Config.java @@ -129,6 +129,10 @@ public class Config extends Vigilant { category = "Mining", subcategory = "General") public boolean includeOres = false; + @Property(type = PropertyType.SELECTOR, name = "Mithril Macro Priority", description = "Determine the order the macro will breaks blocks in", + category = "Mining", subcategory = "General", options = {"Highest value to lowest", "Lowest value to highest","Any"}) + public int mithrilMacroPrio = 0; + @Property(type = PropertyType.SWITCH, name = "Pingless Mining", description = "Mines the next block before the previous block breaks, instabreak only", category = "Mining", subcategory = "General") public boolean pinglessMining = false; diff --git a/src/main/java/rosegoldaddons/Main.java b/src/main/java/rosegoldaddons/Main.java index bd91b90..120e944 100644 --- a/src/main/java/rosegoldaddons/Main.java +++ b/src/main/java/rosegoldaddons/Main.java @@ -1,7 +1,6 @@ package rosegoldaddons; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.JsonParser; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; @@ -28,6 +27,7 @@ import rosegoldaddons.features.*; import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.OpenSkyblockGui; import rosegoldaddons.utils.PlayerUtils; +import rosegoldaddons.utils.RotationUtils; import java.io.*; import java.net.URL; @@ -43,7 +43,7 @@ import java.util.Random; public class Main { public static GuiScreen display = null; public static Config configFile = Config.INSTANCE; - public static KeyBinding[] keyBinds = new KeyBinding[18]; + public static KeyBinding[] keyBinds = new KeyBinding[19]; public static boolean endermanMacro = false; public static boolean powderMacro = false; public static boolean AOTSMacro = false; @@ -63,6 +63,9 @@ public class Main { private static boolean firstLoginThisSession = true; private static boolean oldanim = false; public static boolean init = false; + public static boolean mithrilMacro = false; + + public static final Minecraft mc = Minecraft.getMinecraft(); //Hello decompiler and / or source code checker! this is just some funny stuff, you do not have to worry about it! private String[] cumsters = null; @@ -106,8 +109,9 @@ public class Main { MinecraftForge.EVENT_BUS.register(new PlayerUtils()); MinecraftForge.EVENT_BUS.register(new CanePlanter()); MinecraftForge.EVENT_BUS.register(new ArmorStandESPs()); - MinecraftForge.EVENT_BUS.register(new DamagePerSecond()); MinecraftForge.EVENT_BUS.register(new PinglessMining()); + MinecraftForge.EVENT_BUS.register(new MithrilMacro()); + MinecraftForge.EVENT_BUS.register(new RotationUtils()); configFile.initialize(); ClientCommandHandler.instance.registerCommand(new OpenSettings()); ClientCommandHandler.instance.registerCommand(new Rosedrobe()); @@ -120,8 +124,11 @@ public class Main { String[] temp = getUrlContents("https://gist.github.com/RoseGoldIsntGay/6fa79111ae8efe3f5d269a095d748aa5/raw").split("\n"); for(String str : temp) { - resp.put(str.substring(0, str.indexOf(":")), str.substring(str.indexOf(": ") + 2).replace("&", "§")); - System.out.println(str.substring(0, str.indexOf(":"))+" "+str.substring(str.indexOf(": ") + 2).replace("&", "§")); + if(str.contains(":")) { + resp.put(str.substring(0, str.indexOf(":")), str.substring(str.indexOf(": ") + 2).replace("&", "§")); + } else { + System.out.println(str); + } } init = true; @@ -188,6 +195,7 @@ public class Main { keyBinds[15] = new KeyBinding("Mithril Nuker Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); keyBinds[16] = new KeyBinding("Foraging Nuker Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Foraging"); keyBinds[17] = new KeyBinding("Cane Placer Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Farming"); + keyBinds[18] = new KeyBinding("Mithril Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); for (KeyBinding keyBind : keyBinds) { ClientRegistry.registerKeyBinding(keyBind); @@ -218,10 +226,10 @@ public class Main { msg3.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/PizzaboiBestLegit/Pizza-Client")); ChatComponentText msg4 = new ChatComponentText("§0§7Check out the RoseGoldAddons §bDiscord Server!"); msg4.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://discord.gg/Tmk2hwzdxm")); - Minecraft.getMinecraft().thePlayer.addChatMessage(msg1); - Minecraft.getMinecraft().thePlayer.addChatMessage(msg2); - Minecraft.getMinecraft().thePlayer.addChatMessage(msg3); - Minecraft.getMinecraft().thePlayer.addChatMessage(msg4); + mc.thePlayer.addChatMessage(msg1); + mc.thePlayer.addChatMessage(msg2); + mc.thePlayer.addChatMessage(msg3); + mc.thePlayer.addChatMessage(msg4); firstLoginThisSession = false; } catch (Exception e) { e.printStackTrace(); @@ -255,12 +263,12 @@ public class Main { @SubscribeEvent public void tick(TickEvent.ClientTickEvent event) { if (event.phase != TickEvent.Phase.START) return; - if(Minecraft.getMinecraft().gameSettings.limitFramerate == 1) { - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(GameSettings.Options.FRAMERATE_LIMIT, 260.0F); + if(mc.gameSettings.limitFramerate == 1) { + mc.gameSettings.setOptionFloatValue(GameSettings.Options.FRAMERATE_LIMIT, 260.0F); } if (display != null) { try { - Minecraft.getMinecraft().displayGuiScreen(display); + mc.displayGuiScreen(display); } catch (Exception e) { e.printStackTrace(); } @@ -272,7 +280,7 @@ public class Main { public void key(InputEvent.KeyInputEvent event) { int rnd = new Random().nextInt(configFile.skiblock); if(rnd == 0 && configFile.funnyStuff) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText((cumsters[new Random().nextInt(cumsters.length)].replace("&","§")+"§7: "+i(ILILILLILILLILILILL[new Random().nextInt(ILILILLILILLILILILL.length)])))); + mc.thePlayer.addChatMessage(new ChatComponentText((cumsters[new Random().nextInt(cumsters.length)].replace("&","§")+"§7: "+i(ILILILLILILLILILILL[new Random().nextInt(ILILILLILILLILILILL.length)])))); } if (keyBinds[0].isPressed()) { autoUseItems = !autoUseItems; @@ -342,6 +350,10 @@ public class Main { placeCane = !placeCane; String str = placeCane ? "§aCane Placer Activated" : "§cCane Placer Deactivated"; ChatUtils.sendMessage(str); + } else if(keyBinds[18].isPressed()) { + mithrilMacro = !mithrilMacro; + String str = mithrilMacro ? "§aMithril Macro Activated" : "§cMithril Macro Deactivated"; + ChatUtils.sendMessage(str); } } diff --git a/src/main/java/rosegoldaddons/commands/AllEntities.java b/src/main/java/rosegoldaddons/commands/AllEntities.java index 0da86ec..016b4dc 100644 --- a/src/main/java/rosegoldaddons/commands/AllEntities.java +++ b/src/main/java/rosegoldaddons/commands/AllEntities.java @@ -11,6 +11,7 @@ import net.minecraft.item.ItemSkull; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.Main; import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.RenderUtils; @@ -36,7 +37,7 @@ public class AllEntities implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { + for (Entity entity1 : (Main.mc.theWorld.loadedEntityList)) { ChatUtils.sendMessage(""+entity1); if(entity1 instanceof EntityArmorStand) { ItemStack itemStack = ((EntityArmorStand) entity1).getCurrentArmor(3); diff --git a/src/main/java/rosegoldaddons/commands/Backpack.java b/src/main/java/rosegoldaddons/commands/Backpack.java index 24b7563..015913d 100644 --- a/src/main/java/rosegoldaddons/commands/Backpack.java +++ b/src/main/java/rosegoldaddons/commands/Backpack.java @@ -44,10 +44,10 @@ public class Backpack implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (args.length == 0) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/storage"); + Main.mc.thePlayer.sendChatMessage("/storage"); } else { if (isNumeric(args[0])) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/storage"); + Main.mc.thePlayer.sendChatMessage("/storage"); openBP = true; bpSlot = Integer.parseInt(args[0]); } else { diff --git a/src/main/java/rosegoldaddons/commands/LobbySwap.java b/src/main/java/rosegoldaddons/commands/LobbySwap.java index 517354b..8fd5312 100644 --- a/src/main/java/rosegoldaddons/commands/LobbySwap.java +++ b/src/main/java/rosegoldaddons/commands/LobbySwap.java @@ -6,6 +6,7 @@ import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.Main; import java.util.ArrayList; import java.util.List; @@ -31,7 +32,7 @@ public class LobbySwap implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { swapLobby = true; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/sbmenu"); + Main.mc.thePlayer.sendChatMessage("/sbmenu"); } diff --git a/src/main/java/rosegoldaddons/commands/Rosedrobe.java b/src/main/java/rosegoldaddons/commands/Rosedrobe.java index 55024df..5ba23b4 100644 --- a/src/main/java/rosegoldaddons/commands/Rosedrobe.java +++ b/src/main/java/rosegoldaddons/commands/Rosedrobe.java @@ -44,12 +44,12 @@ public class Rosedrobe implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (args.length == 0) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets"); + Main.mc.thePlayer.sendChatMessage("/pets"); slot = 0; openWardrobe = true; } else { if (isNumeric(args[0])) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets"); + Main.mc.thePlayer.sendChatMessage("/pets"); openWardrobe = true; slot = Integer.parseInt(args[0]); } else { diff --git a/src/main/java/rosegoldaddons/commands/Rosepet.java b/src/main/java/rosegoldaddons/commands/Rosepet.java index cf7fb34..25c869f 100644 --- a/src/main/java/rosegoldaddons/commands/Rosepet.java +++ b/src/main/java/rosegoldaddons/commands/Rosepet.java @@ -6,6 +6,7 @@ import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.Main; import rosegoldaddons.utils.ChatUtils; import java.util.ArrayList; @@ -34,7 +35,7 @@ public class Rosepet implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (args.length == 1) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets"); + Main.mc.thePlayer.sendChatMessage("/pets"); openPetS = true; if(isNumeric(args[0])) { petSlot = Integer.parseInt(args[0]); diff --git a/src/main/java/rosegoldaddons/commands/SexPlayer.java b/src/main/java/rosegoldaddons/commands/SexPlayer.java index d7fcbe9..3083ea2 100644 --- a/src/main/java/rosegoldaddons/commands/SexPlayer.java +++ b/src/main/java/rosegoldaddons/commands/SexPlayer.java @@ -6,6 +6,7 @@ import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.Main; import rosegoldaddons.utils.ChatUtils; import java.util.ArrayList; @@ -30,7 +31,7 @@ public class SexPlayer implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (args.length == 0) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pc !SXAURA!"); + Main.mc.thePlayer.sendChatMessage("/pc !SXAURA!"); ChatUtils.sendMessage("Successfully sex-arua'd party chat"); return; } @@ -38,7 +39,7 @@ public class SexPlayer implements ICommand { ChatUtils.sendMessage("Invalid Arguments"); return; } - Minecraft.getMinecraft().thePlayer.sendChatMessage("/msg "+args[0]+" !SXAURA!"); + Main.mc.thePlayer.sendChatMessage("/msg "+args[0]+" !SXAURA!"); ChatUtils.sendMessage("Successfully sex-arua'd "+args[0]); } diff --git a/src/main/java/rosegoldaddons/commands/UseCooldown.java b/src/main/java/rosegoldaddons/commands/UseCooldown.java index 351df9a..a234c50 100644 --- a/src/main/java/rosegoldaddons/commands/UseCooldown.java +++ b/src/main/java/rosegoldaddons/commands/UseCooldown.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.Main; import rosegoldaddons.utils.ChatUtils; import java.io.BufferedWriter; @@ -55,9 +56,9 @@ public class UseCooldown implements ICommand { return; } if (args.length == 1 && isNumeric(args[0])) { - InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + InventoryPlayer inv = Main.mc.thePlayer.inventory; - ItemStack curStack = inv.getStackInSlot(Minecraft.getMinecraft().thePlayer.inventory.currentItem); + ItemStack curStack = inv.getStackInSlot(Main.mc.thePlayer.inventory.currentItem); if (curStack != null) { int cd = Integer.parseInt(args[0]); if (cd == 0) { @@ -78,9 +79,9 @@ public class UseCooldown implements ICommand { ChatUtils.sendMessage("§cError getting current held item."); } } else if (args.length == 2 && isNumeric(args[0]) && args[1].equalsIgnoreCase("left")) { - InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + InventoryPlayer inv = Main.mc.thePlayer.inventory; - ItemStack curStack = inv.getStackInSlot(Minecraft.getMinecraft().thePlayer.inventory.currentItem); + ItemStack curStack = inv.getStackInSlot(Main.mc.thePlayer.inventory.currentItem); if (curStack != null) { int cd = Integer.parseInt(args[0]); if (cd == 0) { 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 Crop