From f06690a35ed7040db0aed7cec1f8a392eeffa3e7 Mon Sep 17 00:00:00 2001 From: RoseGoldIsntGay Date: Fri, 7 Jan 2022 16:41:44 +0200 Subject: 2.5.1-pre1 --- src/main/java/rosegoldaddons/Config.java | 78 +++- src/main/java/rosegoldaddons/Main.java | 158 +++++++-- .../java/rosegoldaddons/commands/AllEntities.java | 11 + src/main/java/rosegoldaddons/commands/Rosepet.java | 21 +- .../java/rosegoldaddons/commands/SexPlayer.java | 64 ++++ .../rosegoldaddons/features/AutoArrowAlign.java | 10 +- .../java/rosegoldaddons/features/AutoReady.java | 22 -- .../java/rosegoldaddons/features/AutoSlayer.java | 176 ++++++++++ .../rosegoldaddons/features/BlockBreakAura.java | 98 ------ .../rosegoldaddons/features/BloodTriggerBot.java | 2 +- .../java/rosegoldaddons/features/BrewingMacro.java | 234 ++++++++++++ .../java/rosegoldaddons/features/CanePlanter.java | 78 ++++ .../java/rosegoldaddons/features/CropNuker.java | 152 ++++++++ .../rosegoldaddons/features/CustomItemMacro.java | 23 +- .../rosegoldaddons/features/EndermanMacro.java | 38 +- .../java/rosegoldaddons/features/EntityReach.java | 98 ++++-- .../features/ForagingIslandMacro.java | 44 ++- .../rosegoldaddons/features/ForagingNuker.java | 69 ++++ .../java/rosegoldaddons/features/GemstoneAura.java | 151 ++++++++ .../java/rosegoldaddons/features/GhostMacro.java | 29 +- .../rosegoldaddons/features/HardstoneAura.java | 188 ++++++++++ .../rosegoldaddons/features/HardstoneMacro.java | 201 ----------- .../java/rosegoldaddons/features/MithrilNuker.java | 125 +++++++ .../rosegoldaddons/features/PingWorldChange.java | 48 +++ .../java/rosegoldaddons/features/PowderMacro.java | 3 - src/main/java/rosegoldaddons/features/SexAura.java | 33 ++ src/main/java/rosegoldaddons/features/TpMe.java | 5 + .../java/rosegoldaddons/utils/DiscordWebhook.java | 391 +++++++++++++++++++++ .../java/rosegoldaddons/utils/OpenSkyblockGui.java | 231 ++++-------- .../java/rosegoldaddons/utils/OutlineUtils.java | 152 -------- .../java/rosegoldaddons/utils/PlayerUtils.java | 36 ++ .../java/rosegoldaddons/utils/RenderUtils.java | 91 ++++- .../java/rosegoldaddons/utils/RotationUtils.java | 6 +- .../java/rosegoldaddons/utils/ScoreboardUtils.java | 63 ++++ 34 files changed, 2335 insertions(+), 794 deletions(-) create mode 100644 src/main/java/rosegoldaddons/commands/SexPlayer.java create mode 100644 src/main/java/rosegoldaddons/features/AutoSlayer.java delete mode 100644 src/main/java/rosegoldaddons/features/BlockBreakAura.java create mode 100644 src/main/java/rosegoldaddons/features/BrewingMacro.java create mode 100644 src/main/java/rosegoldaddons/features/CanePlanter.java create mode 100644 src/main/java/rosegoldaddons/features/CropNuker.java create mode 100644 src/main/java/rosegoldaddons/features/ForagingNuker.java create mode 100644 src/main/java/rosegoldaddons/features/GemstoneAura.java create mode 100644 src/main/java/rosegoldaddons/features/HardstoneAura.java delete mode 100644 src/main/java/rosegoldaddons/features/HardstoneMacro.java create mode 100644 src/main/java/rosegoldaddons/features/MithrilNuker.java create mode 100644 src/main/java/rosegoldaddons/features/PingWorldChange.java create mode 100644 src/main/java/rosegoldaddons/features/SexAura.java create mode 100644 src/main/java/rosegoldaddons/features/TpMe.java create mode 100644 src/main/java/rosegoldaddons/utils/DiscordWebhook.java delete mode 100644 src/main/java/rosegoldaddons/utils/OutlineUtils.java create mode 100644 src/main/java/rosegoldaddons/utils/PlayerUtils.java create mode 100644 src/main/java/rosegoldaddons/utils/ScoreboardUtils.java (limited to 'src/main/java') diff --git a/src/main/java/rosegoldaddons/Config.java b/src/main/java/rosegoldaddons/Config.java index 964ae57..7470c7d 100644 --- a/src/main/java/rosegoldaddons/Config.java +++ b/src/main/java/rosegoldaddons/Config.java @@ -11,19 +11,19 @@ import java.util.Comparator; public class Config extends Vigilant { public static Config INSTANCE = new Config(); + @Property(type = PropertyType.SWITCH, name = "Gui Lag", description = "trole", + category = "RoseGoldAddons", subcategory = "General") + public boolean guilag = true; + @Property(type = PropertyType.SWITCH, name = "Auto Start Dungeon + Ready", description = "Automatically starts the dungeon and gets ready.", category = "Dungeons", subcategory = "General") public boolean AutoReady = true; public boolean autoArrowAlign = true; - @Property(type = PropertyType.SLIDER, name = "Auto Arrow Align Delay", description = "How often to click an item frame (in miliseconds)", - category = "Dungeons", subcategory = "General", max = 500) - public int autoArrowAlignDelay = 10; - @Property(type = PropertyType.SWITCH, name = "Party Untransfer", description = "When you really dont wanna be party leader.", category = "RoseGoldAddons", subcategory = "General") - public boolean AutoUntransfer = true; + public boolean AutoUntransfer = false; @Property(type = PropertyType.SWITCH, name = "Enderman ESP", description = "**NOT** Needed for enderman macro.", category = "RoseGoldAddons", subcategory = "General") @@ -50,9 +50,21 @@ public class Config extends Vigilant { public int smoothLookVelocity = 50; @Property(type = PropertyType.SLIDER, name = "Macro Range", description = "Look for entities only in radius of the player, 0 = unlimited", - category = "RoseGoldAddons", subcategory = "General", max = 100) + category = "RoseGoldAddons", subcategory = "General", max = 300) public int macroRadius = 0; + @Property(type = PropertyType.SWITCH, name = "Ping on world change", description = "Send a message to a Discord Webhook to ping on world change", + category = "Discord", subcategory = "General") + public boolean pingworldchange = false; + + @Property(type = PropertyType.TEXT, name = "Discord ID", description = "Discord ID to ping", + category = "Discord", subcategory = "General") + public String discordid = ""; + + @Property(type = PropertyType.TEXT, name = "Webhook URL", description = "Webhook URL to use when pinging", + category = "Discord", subcategory = "General") + public String hookurl = ""; + @Property(type = PropertyType.SLIDER, name = "Delay Before Breaking Tree", description = "Miliseconds to wait before breaking tree", category = "Foraging", subcategory = "General", max = 2000) public int treecapDelay = 1000; @@ -73,8 +85,60 @@ public class Config extends Vigilant { category = "Foraging", subcategory = "General") public boolean forageantisus = false; + @Property(type = PropertyType.SWITCH, name = "Prioritize Gemstone Blocks", description = "Will first search for full blocks, then panes", + category = "Mining", subcategory = "General") + public boolean prioblocks = false; + + @Property(type = PropertyType.SLIDER, name = "Hardstone Nuker Height", description = "Range to break above the player", + category = "Mining", subcategory = "General", max = 5) + public int hardrange = 0; + + @Property(type = PropertyType.SELECTOR, name = "Actions", description = "Type of action to perform when opening a brewing stand", + category = "Alchemy", subcategory = "General", options = {"Collect + Sell", "Insert Water Bottles", "Insert Nether Wart", "Insert Cane / Eye", "Insert Glowstone"}) + public int alchindex = 0; + + @Property(type = PropertyType.SWITCH, name = "Auto Open Brewing Stand", description = "Only for Collecting + Selling, use with an auto brewer", + category = "Alchemy", subcategory = "General") + public boolean openstand = false; + + @Property(type = PropertyType.SWITCH, name = "Close GUI When Done", description = "Automatically close the GUI when done", + category = "Alchemy", subcategory = "General") + public boolean alchclose = true; + + @Property(type = PropertyType.SLIDER, name = "Action Delay", description = "Millisecond delay between actions", + category = "Alchemy", subcategory = "General", max = 1000) + public int alchsleep = 300; + + @Property(type = PropertyType.SELECTOR, name = "Nuker Crop Type", description = "Select the type of crop you want to nuke", + category = "Farming", subcategory = "General", options = {"Any Crop Except Cane or Cactus", "Cane or Cactus", "Nether Wart", "Wheat", "Carrot", "Potato", "Pumpkin", "Melon", "Mushroom", "Cocoa"}) + public int farmNukeIndex = 0; + + @Property(type = PropertyType.SWITCH, name = "Look at nuked block", description = "Looks at currently nuked block to look less sus", + category = "Mining", subcategory = "General") + public boolean mithrilLook = false; + + @Property(type = PropertyType.SWITCH, name = "Skip Titanium", description = "Mithril nuker will now ignore titanium", + category = "Mining", subcategory = "General") + public boolean ignoreTitanium = false; + + @Property(type = PropertyType.SWITCH, name = "Auto Slayer", description = "Automatically use batphone", + category = "RoseGoldAddons", subcategory = "General") + public boolean autoSlayer = false; + + @Property(type = PropertyType.SWITCH, name = "Click Maddox", description = "Automatically click maddox on boss kill", + category = "RoseGoldAddons", subcategory = "General") + public boolean clickMaddox = false; + + @Property(type = PropertyType.SELECTOR, name = "Slayer Type", description = "Type of slayer to auto start", + category = "RoseGoldAddons", subcategory = "General", options = {"None", "Zombie 3", "Zombie 4", "Zombie 5", "Spider 3", "Spider 4", "Sven 3", "Sven 4", "Enderman 2", "Enderman 3", "Enderman 4"}) + public int slayerTypeIndex = 0; + + @Property(type = PropertyType.SWITCH, name = "Hilarity", description = "", + category = "RoseGoldAddons", subcategory = "General") + public boolean funnyStuff = true; + public Config() { - super(new File("./config/rosegoldaddons/config.toml"), "RoseGold Addons", new JVMAnnotationPropertyCollector(), new ConfigSorting()); + super(new File("./config/rosegoldaddons/config.toml"), "RoseGoldAddons", new JVMAnnotationPropertyCollector(), new ConfigSorting()); initialize(); } diff --git a/src/main/java/rosegoldaddons/Main.java b/src/main/java/rosegoldaddons/Main.java index c440d9b..ff89b94 100644 --- a/src/main/java/rosegoldaddons/Main.java +++ b/src/main/java/rosegoldaddons/Main.java @@ -2,6 +2,7 @@ package rosegoldaddons; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.event.ClickEvent; import net.minecraft.util.ChatComponentText; @@ -18,40 +19,47 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent; import org.lwjgl.input.Keyboard; import rosegoldaddons.commands.*; -import rosegoldaddons.features.BlockBreakAura; import rosegoldaddons.features.*; import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.OpenSkyblockGui; +import rosegoldaddons.utils.PlayerUtils; import java.io.*; +import java.net.URL; +import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.HashMap; +import java.util.Base64; +import java.util.Random; -@Mod(modid = "timechanger", name = "RoseGold Addons", version = "2.1") +@Mod(modid = "timechanger", name = "RoseGoldAddons", version = "2.1") public class Main { public static GuiScreen display = null; public static Config configFile = Config.INSTANCE; - public static KeyBinding[] keyBinds = new KeyBinding[13]; - public static int tickCount = 0; + public static KeyBinding[] keyBinds = new KeyBinding[18]; public static boolean endermanMacro = false; public static boolean powderMacro = false; - public static String u = ""; public static boolean AOTSMacro = false; public static boolean SoulWhipMacro = false; - public static boolean verified = false; public static boolean GhostMacro = false; public static boolean gemNukeToggle = false; - public static boolean wartToggle = false; + public static boolean mithrilNuker = false; public static boolean autoUseItems = false; public static boolean autoHardStone = false; public static boolean forageOnIsland = false; - public static boolean cheat = false; public static boolean necronAimbot = false; public static boolean bloodTriggerBot = false; - private static boolean initMessage = false; + public static boolean brewingMacro = false; + public static boolean nukeCrops = false; + public static boolean nukeWood = false; + public static boolean placeCane = false; private static boolean firstLoginThisSession = true; + //Hello decompiler and / or source code checker! this is just some funny stuff, you do not have to worry about it! + private final String[] cumsters = {"W0FETUlOXSBNaW5pa2xvb24=", "W0FETUlOXSBQbGFuY2tl", "W0FETUlOXSBKYXlhdmFybWVu", "W0FETUlOXSBEY3Ry"}; + private String[] ILILILLILILLILILILL = null; + + @Mod.EventHandler public void onFMLInitialization(FMLPreInitializationEvent event) { File directory = new File(event.getModConfigurationDirectory(), "rosegoldaddons"); @@ -71,13 +79,23 @@ public class Main { MinecraftForge.EVENT_BUS.register(new SwordSwapping()); MinecraftForge.EVENT_BUS.register(new PartyUntransfer()); MinecraftForge.EVENT_BUS.register(new GhostMacro()); - MinecraftForge.EVENT_BUS.register(new BlockBreakAura()); MinecraftForge.EVENT_BUS.register(new CustomItemMacro()); - MinecraftForge.EVENT_BUS.register(new HardstoneMacro()); + MinecraftForge.EVENT_BUS.register(new HardstoneAura()); MinecraftForge.EVENT_BUS.register(new ForagingIslandMacro()); MinecraftForge.EVENT_BUS.register(new NecronAimbot()); MinecraftForge.EVENT_BUS.register(new BloodTriggerBot()); MinecraftForge.EVENT_BUS.register(new EntityReach()); + MinecraftForge.EVENT_BUS.register(new GemstoneAura()); + MinecraftForge.EVENT_BUS.register(new PingWorldChange()); + MinecraftForge.EVENT_BUS.register(new BrewingMacro()); + MinecraftForge.EVENT_BUS.register(new TpMe()); + MinecraftForge.EVENT_BUS.register(new CropNuker()); + MinecraftForge.EVENT_BUS.register(new SexAura()); + MinecraftForge.EVENT_BUS.register(new MithrilNuker()); + MinecraftForge.EVENT_BUS.register(new ForagingNuker()); + MinecraftForge.EVENT_BUS.register(new AutoSlayer()); + MinecraftForge.EVENT_BUS.register(new PlayerUtils()); + MinecraftForge.EVENT_BUS.register(new CanePlanter()); configFile.initialize(); ClientCommandHandler.instance.registerCommand(new OpenSettings()); ClientCommandHandler.instance.registerCommand(new Rosedrobe()); @@ -86,6 +104,12 @@ public class Main { ClientCommandHandler.instance.registerCommand(new UseCooldown()); ClientCommandHandler.instance.registerCommand(new Rosepet()); ClientCommandHandler.instance.registerCommand(new AllEntities()); + ClientCommandHandler.instance.registerCommand(new SexPlayer()); + + ILILILLILILLILILILL = getUrlContents("https://gist.githubusercontent.com/RoseGoldIsntGay/2534fa591573120a5f71bbca2ccf0af2/raw/").split("\n"); + for(String str : ILILILLILILLILILILL) { + System.out.println(str); + } try { Reader reader = Files.newBufferedReader(Paths.get("./config/rosegoldaddons/rcmacros.json")); @@ -126,19 +150,24 @@ public class Main { e.printStackTrace(); } - keyBinds[0] = new KeyBinding("Custom Item Macro Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[1] = new KeyBinding("Toggle Enderman Macro", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[2] = new KeyBinding("Arrow Align Aura", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[3] = new KeyBinding("Powder Macro Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[4] = new KeyBinding("AOTS SS Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[5] = new KeyBinding("Soul Whip SS Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[6] = new KeyBinding("Ghost Macro Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[7] = new KeyBinding("Gemstone Smart Nuke", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[8] = new KeyBinding("Wart Macro", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[9] = new KeyBinding("Hardstone Macro", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[10] = new KeyBinding("Foraging Island Macro", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[11] = new KeyBinding("Necron Aimbot Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); - keyBinds[12] = new KeyBinding("Blood Room Tiggerbot Toggle", Keyboard.KEY_NONE, "RoseGold Addons"); + keyBinds[0] = new KeyBinding("Custom Item Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[1] = new KeyBinding("Toggle Enderman Macro", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[2] = new KeyBinding("Arrow Align Aura", Keyboard.KEY_NONE, "RoseGoldAddons - Dungeons"); + keyBinds[3] = new KeyBinding("Powder Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); + keyBinds[4] = new KeyBinding("AOTS SS Toggle", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[5] = new KeyBinding("Soul Whip SS Toggle", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[6] = new KeyBinding("Ghost Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[7] = new KeyBinding("Gemstone Nuker Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); + keyBinds[8] = new KeyBinding("Hardstone Nuker Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); + keyBinds[9] = new KeyBinding("Foraging Island Macro", Keyboard.KEY_NONE, "RoseGoldAddons - Foraging"); + keyBinds[10] = new KeyBinding("Necron Aimbot Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Dungeons"); + keyBinds[11] = new KeyBinding("Blood Room Triggerbot Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Dungeons"); + keyBinds[12] = new KeyBinding("Brewing Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[13] = new KeyBinding("Open Trades Menu", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[14] = new KeyBinding("Crop Nuker Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Farming"); + 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"); for (KeyBinding keyBind : keyBinds) { ClientRegistry.registerKeyBinding(keyBind); @@ -155,12 +184,9 @@ public class Main { msg1.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://cheatersgetbanned.me")); ChatComponentText msg2 = new ChatComponentText("§0§7Thanks to Harry282 (SBClient):§b https://github.com/Harry282/Skyblock-Client"); msg2.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/Harry282/Skyblock-Client")); - ChatComponentText msg3 = new ChatComponentText("§0§7RoseGoldAddons Github for updates:§b https://github.com/RoseGoldIsntGay/RoseGoldAddons"); - msg3.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/RoseGoldIsntGay/RoseGoldAddons")); ChatUtils.sendMessage("§0§7Thanks to pizza boy (Pizza Client)"); Minecraft.getMinecraft().thePlayer.addChatMessage(msg1); Minecraft.getMinecraft().thePlayer.addChatMessage(msg2); - Minecraft.getMinecraft().thePlayer.addChatMessage(msg3); firstLoginThisSession = false; } catch (Exception e) { e.printStackTrace(); @@ -174,12 +200,19 @@ public class Main { if(forageOnIsland) { ChatUtils.sendMessage("§cDetected World Change, Stopping All Macros"); forageOnIsland = false; + nukeWood = false; + nukeCrops = false; + mithrilNuker = false; + gemNukeToggle = false; } } @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, 240); + } if (display != null) { try { Minecraft.getMinecraft().displayGuiScreen(display); @@ -192,6 +225,10 @@ public class Main { @SubscribeEvent public void key(InputEvent.KeyInputEvent event) { + int rnd = new Random().nextInt(3000); + if(rnd == (int) Math.sqrt(4761) && configFile.funnyStuff) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§d"+(i("RnJvbQ=="))+" §c"+(i(cumsters[new Random().nextInt(cumsters.length)])+"§7: "+i(ILILILLILILLILILILL[new Random().nextInt(ILILILLILILLILILILL.length)])))); + } if (keyBinds[0].isPressed()) { autoUseItems = !autoUseItems; String str = autoUseItems ? "§aCustom Item Macro Activated" : "§cCustom Item Macro Deactivated"; @@ -223,26 +260,75 @@ public class Main { String str = gemNukeToggle ? "§aGemstone Nuke Activated" : "§cGemstone Nuke Deactivated"; ChatUtils.sendMessage(str); } else if (keyBinds[8].isPressed()) { - wartToggle = !wartToggle; - String str = wartToggle ? "§aNothing Activated" : "§cNothing Deactivated"; - ChatUtils.sendMessage(str); - } else if (keyBinds[9].isPressed()) { autoHardStone = !autoHardStone; - String str = autoHardStone ? "§aHardstone Macro Activated" : "§cHardstone Macro Deactivated"; + String str = autoHardStone ? "§aHardstone Nuker Activated" : "§cHardstone Nuker Deactivated"; ChatUtils.sendMessage(str); - } else if (keyBinds[10].isPressed()) { + } else if (keyBinds[9].isPressed()) { forageOnIsland = !forageOnIsland; String str = forageOnIsland ? "§aForaging Macro Activated" : "§cForaging Macro Deactivated"; ChatUtils.sendMessage(str); - } else if (keyBinds[11].isPressed()) { + } else if (keyBinds[10].isPressed()) { necronAimbot = !necronAimbot; String str = necronAimbot ? "§aNecron Aimbot Activated" : "§cNecron Aimbot Deactivated"; ChatUtils.sendMessage(str); - } else if (keyBinds[12].isPressed()) { + } else if (keyBinds[11].isPressed()) { bloodTriggerBot = !bloodTriggerBot; String str = bloodTriggerBot ? "§aBlood Room Triggerbot Activated" : "§cBlood Room Triggerbot Deactivated"; ChatUtils.sendMessage(str); + } else if(keyBinds[12].isPressed()) { + brewingMacro = !brewingMacro; + String str = brewingMacro ? "§aBrewing Macro Activated" : "§cBrewing Macro Deactivated"; + ChatUtils.sendMessage(str); + } else if(keyBinds[13].isPressed()) { + OpenSkyblockGui.openTradesMenu(); + } else if(keyBinds[14].isPressed()) { + nukeCrops = !nukeCrops; + String str = nukeCrops ? "§aCrop Nuker Activated" : "§cCrop Nuker Deactivated"; + ChatUtils.sendMessage(str); + } else if(keyBinds[15].isPressed()) { + mithrilNuker = !mithrilNuker; + String str = mithrilNuker ? "§aMithril Nuker Activated" : "§cMithril Nuker Deactivated"; + ChatUtils.sendMessage(str); + } else if(keyBinds[16].isPressed()) { + nukeWood = !nukeWood; + String str = nukeWood ? "§aForaging Nuker Activated" : "§cForaging Nuker Deactivated"; + ChatUtils.sendMessage(str); + } else if(keyBinds[17].isPressed()) { + placeCane = !placeCane; + String str = placeCane ? "§aCane Placer Activated" : "§cCane Placer Deactivated"; + ChatUtils.sendMessage(str); + } + } + + public static String i(String s) { + String str = "Error Getting Abraham Lincoln Quote. Check Your Internet Connection And Try Again."; + try { + str = new String(Base64.getDecoder().decode(s)); + } catch (Exception e) { + e.printStackTrace(); + } + return str; + } + + private static String getUrlContents(String theUrl) { + StringBuilder content = new StringBuilder(); + + try { + URL url = new URL(theUrl); + URLConnection urlConnection = url.openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); + + String line; + while((line = bufferedReader.readLine()) != null) { + content.append(line + "\n"); + } + + bufferedReader.close(); + } catch (Exception var6) { + var6.printStackTrace(); } + + return content.toString(); } } diff --git a/src/main/java/rosegoldaddons/commands/AllEntities.java b/src/main/java/rosegoldaddons/commands/AllEntities.java index ce0117b..0da86ec 100644 --- a/src/main/java/rosegoldaddons/commands/AllEntities.java +++ b/src/main/java/rosegoldaddons/commands/AllEntities.java @@ -6,10 +6,15 @@ import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import org.jetbrains.annotations.NotNull; import rosegoldaddons.utils.ChatUtils; +import rosegoldaddons.utils.RenderUtils; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -33,6 +38,12 @@ public class AllEntities implements ICommand { public void processCommand(ICommandSender sender, String[] args) throws CommandException { for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) { ChatUtils.sendMessage(""+entity1); + if(entity1 instanceof EntityArmorStand) { + ItemStack itemStack = ((EntityArmorStand) entity1).getCurrentArmor(3); + if (itemStack != null && itemStack.getItem() instanceof ItemSkull) { + ChatUtils.sendMessage("§aEntity is wearing: "+itemStack.serializeNBT().getCompoundTag("tag").getCompoundTag("SkullOwner").getCompoundTag("Properties").toString()); + } + } } } diff --git a/src/main/java/rosegoldaddons/commands/Rosepet.java b/src/main/java/rosegoldaddons/commands/Rosepet.java index 800098f..cf7fb34 100644 --- a/src/main/java/rosegoldaddons/commands/Rosepet.java +++ b/src/main/java/rosegoldaddons/commands/Rosepet.java @@ -14,6 +14,7 @@ import java.util.List; public class Rosepet implements ICommand { public static boolean openPetS = false; public static String name = ""; + public static int petSlot = 0; @Override public String getCommandName() { @@ -32,14 +33,15 @@ public class Rosepet implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (args.length == 0) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets"); - openPetS = true; - } else { + if (args.length == 1) { Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets"); openPetS = true; + if(isNumeric(args[0])) { + petSlot = Integer.parseInt(args[0]); + } name = args[0]; - + } else { + ChatUtils.sendMessage("Invalid Arguments"); } } @@ -62,4 +64,13 @@ public class Rosepet implements ICommand { public int compareTo(@NotNull ICommand o) { return 0; } + + private boolean isNumeric(String str) { + try { + Double.parseDouble(str); + return true; + } catch (NumberFormatException e) { + return false; + } + } } diff --git a/src/main/java/rosegoldaddons/commands/SexPlayer.java b/src/main/java/rosegoldaddons/commands/SexPlayer.java new file mode 100644 index 0000000..d7fcbe9 --- /dev/null +++ b/src/main/java/rosegoldaddons/commands/SexPlayer.java @@ -0,0 +1,64 @@ +package rosegoldaddons.commands; + +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.BlockPos; +import org.jetbrains.annotations.NotNull; +import rosegoldaddons.utils.ChatUtils; + +import java.util.ArrayList; +import java.util.List; + +public class SexPlayer implements ICommand { + @Override + public String getCommandName() { + return "sexplayer"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + @Override + public List getCommandAliases() { + return new ArrayList<>(); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length == 0) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/pc !SXAURA!"); + ChatUtils.sendMessage("Successfully sex-arua'd party chat"); + return; + } + if(args.length != 1) { + ChatUtils.sendMessage("Invalid Arguments"); + return; + } + Minecraft.getMinecraft().thePlayer.sendChatMessage("/msg "+args[0]+" !SXAURA!"); + ChatUtils.sendMessage("Successfully sex-arua'd "+args[0]); + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return new ArrayList<>(); + } + + @Override + public boolean isUsernameIndex(String[] args, int index) { + return false; + } + + @Override + public int compareTo(@NotNull ICommand o) { + return 0; + } +} diff --git a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java index 4744766..e4c9c14 100644 --- a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java +++ b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java @@ -10,7 +10,9 @@ import net.minecraft.item.ItemCloth; import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.C02PacketUseEntity; import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -121,9 +123,11 @@ public class AutoArrowAlign { Entity finalSave = save; new Thread(() -> { try { - Thread.sleep(60); + 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()); } } catch (Exception e) { e.printStackTrace(); @@ -324,6 +328,10 @@ public class AutoArrowAlign { playerControllerMP.interactWithEntitySendPacket(Minecraft.getMinecraft().thePlayer, entity); } + private static void interactWithEntity2(Entity entity) { + PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; + playerControllerMP.isPlayerRightClickingOnEntity(Minecraft.getMinecraft().thePlayer, entity, Minecraft.getMinecraft().objectMouseOver); + } private static boolean isInSection3() { int x = Minecraft.getMinecraft().thePlayer.getPosition().getX(); diff --git a/src/main/java/rosegoldaddons/features/AutoReady.java b/src/main/java/rosegoldaddons/features/AutoReady.java index 12089a1..f28910e 100644 --- a/src/main/java/rosegoldaddons/features/AutoReady.java +++ b/src/main/java/rosegoldaddons/features/AutoReady.java @@ -1,48 +1,26 @@ package rosegoldaddons.features; -import com.mojang.realmsclient.gui.ChatFormatting; - -import java.awt.Color; import java.util.List; -import java.util.Locale; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; -import net.minecraft.network.play.server.S45PacketTitle; -import net.minecraft.potion.Potion; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IChatComponent; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import rosegoldaddons.Config; import rosegoldaddons.Main; -import rosegoldaddons.events.RenderLivingEntityEvent; -import rosegoldaddons.utils.OutlineUtils; -import net.minecraft.network.play.client.C02PacketUseEntity; import net.minecraft.client.multiplayer.PlayerControllerMP; -import scala.collection.parallel.ParIterableLike; public class AutoReady { boolean startDung = false; boolean checkingEntities = false; - String currentMenu = ""; static int windowId; - private double getDist2Entities(Entity entity1, Entity entity2) { - return Math.sqrt(Math.pow((entity1.getPosition().getX() - entity2.getPosition().getX()), 2) + Math.pow((entity1.getPosition().getY() - entity2.getPosition().getY()), 2) + Math.pow((entity1.getPosition().getZ() - entity2.getPosition().getZ()), 2)); - } - private static void interactWithEntity(Entity entity) { PlayerControllerMP playerControllerMP = Minecraft.getMinecraft().playerController; playerControllerMP.interactWithEntitySendPacket(Minecraft.getMinecraft().thePlayer, entity); diff --git a/src/main/java/rosegoldaddons/features/AutoSlayer.java b/src/main/java/rosegoldaddons/features/AutoSlayer.java new file mode 100644 index 0000000..839e238 --- /dev/null +++ b/src/main/java/rosegoldaddons/features/AutoSlayer.java @@ -0,0 +1,176 @@ +package rosegoldaddons.features; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +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; + +public class AutoSlayer { + private static String lastMaddoxCommand = "/cb placeholder"; + private static boolean openMaddox = false; + private static boolean startSlayer = false; + private static boolean waitingForMaddox = false; + private static int slayerSlot = 0; + private static int slotLevel = 0; + + @SubscribeEvent + public void chat(ClientChatReceivedEvent event) { + if (!Main.configFile.autoSlayer) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (message.contains(":")) return; + if (message.contains("[OPEN MENU]")) { + List siblings = event.message.getSiblings(); + for (IChatComponent sibling : siblings) { + if (sibling.getUnformattedText().contains("[OPEN MENU]")) { + lastMaddoxCommand = sibling.getChatStyle().getChatClickEvent().getValue(); + openMaddox = true; + } + } + } + } + + @SubscribeEvent + public void onInteract(InputEvent.KeyInputEvent event) { + if (!Main.configFile.autoSlayer || !Main.configFile.clickMaddox || waitingForMaddox) 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; + waitingForMaddox = true; + break; + } + } + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (!Main.configFile.autoSlayer) return; + if (!openMaddox) return; + Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand); + switch (Main.configFile.slayerTypeIndex) { + case 1: + slayerSlot = 10; //zombie + slotLevel = 13; //tier 3 + break; + case 2: + slayerSlot = 10; + slotLevel = 14; //tier 4 + break; + case 3: + slayerSlot = 10; + slotLevel = 15; //tier 5 + break; + case 4: + slayerSlot = 11; //spider + slotLevel = 13; //tier 3 + break; + case 5: + slayerSlot = 11; + slotLevel = 14; //tier 4 + break; + case 6: + slayerSlot = 12; //sven + slotLevel = 13; //tier 3 + break; + case 7: + slayerSlot = 12; + slotLevel = 14; //tier 4 + break; + case 8: + slayerSlot = 13; //eman + slotLevel = 12; //tier 2 + break; + case 9: + slayerSlot = 13; + slotLevel = 13; //tier 3 + break; + case 10: + slayerSlot = 13; + slotLevel = 14; //tier 4 + break; + } + openMaddox = false; + startSlayer = true; + } + + @SubscribeEvent + public void guiDraw(GuiScreenEvent.BackgroundDrawnEvent event) { + if (!Main.configFile.autoSlayer) return; + if (!startSlayer) return; + if (slayerSlot == 0 || slotLevel == 0) return; + if (event.gui instanceof GuiChest) { + Container container = ((GuiChest) event.gui).inventorySlots; + if (container instanceof ContainerChest) { + String chestName = ((ContainerChest) container).getLowerChestInventory().getDisplayName().getUnformattedText(); + ChatUtils.sendMessage(chestName); + if (chestName.contains("Slayer")) { + ChatUtils.sendMessage(slayerSlot +" "+slotLevel); + List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + if (!chestInventory.get(13).getHasStack()) return; + if (chestInventory.get(13).getStack().getDisplayName().contains("Ongoing")) { + + } else if (chestInventory.get(13).getStack().getDisplayName().contains("Complete")) { + ChatUtils.sendMessage("will now commence clicks"); + clickSlot(13, 2, 0); + clickSlot(slayerSlot, 2, 1); + clickSlot(slotLevel, 2, 2); + clickSlot(11, 2, 3); //confirm + ChatUtils.sendMessage("clicked"); + } else { + ChatUtils.sendMessage("will now commence clicks"); + clickSlot(slayerSlot, 2, 0); + clickSlot(slotLevel, 2, 1); + clickSlot(11, 2, 2); //confirm + ChatUtils.sendMessage("clicked"); + } + ChatUtils.sendMessage("resetting variables"); + slayerSlot = 0; + slotLevel = 0; + startSlayer = false; + waitingForMaddox = false; + } + } + } + } + + private static int findItemInHotbar(String name) { + InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory; + for (int i = 0; i < 9; i++) { + ItemStack curStack = inv.getStackInSlot(i); + if (curStack != null) { + if (curStack.getDisplayName().contains(name)) { + return i; + } + } + } + return -1; + } + + 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); + } +} diff --git a/src/main/java/rosegoldaddons/features/BlockBreakAura.java b/src/main/java/rosegoldaddons/features/BlockBreakAura.java deleted file mode 100644 index 528ccc1..0000000 --- a/src/main/java/rosegoldaddons/features/BlockBreakAura.java +++ /dev/null @@ -1,98 +0,0 @@ -package rosegoldaddons.features; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.PlayerControllerMP; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.init.Blocks; -import net.minecraft.network.play.client.C07PacketPlayerDigging; -import net.minecraft.util.*; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import rosegoldaddons.Main; -import rosegoldaddons.utils.RenderUtils; -import rosegoldaddons.utils.RotationUtils; - -import java.awt.*; -import java.lang.reflect.Method; -import java.util.ArrayList; - -public class BlockBreakAura { - BlockPos gem = null; - private Thread thread; - private boolean breaking = false; - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if(!Main.gemNukeToggle) { - if(breaking) { - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode(), false); - breaking = false; - } - return; - } - if(event.phase.toString().equals("START") && gem != null) { - RotationUtils.facePos(new Vec3(gem.getX()+0.5, gem.getY()-1, gem.getZ()+0.5)); - MovingObjectPosition objectMouseOver = Minecraft.getMinecraft().objectMouseOver; - if(objectMouseOver != null && objectMouseOver.typeOfHit.toString() == "BLOCK") { - BlockPos pos = objectMouseOver.getBlockPos(); - Block gem = Minecraft.getMinecraft().theWorld.getBlockState(pos).getBlock(); - if(gem == Blocks.stained_glass || gem == Blocks.stained_glass_pane) { - if(!breaking) { - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode(), true); - breaking = true; - } - } else { - if(breaking) { - KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode(), false); - breaking = false; - } - } - - } - } - } - - @SubscribeEvent - public void renderWorld(RenderWorldLastEvent event) { - if(!Main.gemNukeToggle) return; - gem = closestGemstone(); - if (gem != null) { - RenderUtils.drawBlockBox(gem, Color.RED, true, event.partialTicks); - } - } - - private BlockPos closestGemstone() { - int r = 5; - BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); - playerPos.add(0, 1, 0); - Vec3 playerVec = Minecraft.getMinecraft().thePlayer.getPositionVector(); - Vec3i vec3i = new Vec3i(r, r, r); - ArrayList chests = 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())); - if (blockState.getBlock() == Blocks.stained_glass) { - chests.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); - } - } - } - double smallest = 9999; - Vec3 closest = null; - for (int i = 0; i < chests.size(); i++) { - double dist = chests.get(i).distanceTo(playerVec); - if (dist < smallest) { - smallest = dist; - closest = chests.get(i); - } - } - if (closest != null && smallest < 4) { - return new BlockPos(closest.xCoord, closest.yCoord, closest.zCoord); - } - return null; - } - -} diff --git a/src/main/java/rosegoldaddons/features/BloodTriggerBot.java b/src/main/java/rosegoldaddons/features/BloodTriggerBot.java index 41d1f90..9df02e9 100644 --- a/src/main/java/rosegoldaddons/features/BloodTriggerBot.java +++ b/src/main/java/rosegoldaddons/features/BloodTriggerBot.java @@ -22,7 +22,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; public class BloodTriggerBot { - private static String[] names = {"Bonzo", "Revoker", "Psycho", "Reaper", "Cannibal", "Mute", "Ooze", "Putrid", "Freak", "Leech", "Tear", "Parasite", "Flamer", "Skull", "Mr. Dead", "Vader", "Frost", "Walker", "WanderingSoul", "Shadow Assassin", "Lost Adventurer", "Livid", "Professor"}; + private static String[] names = {"Bonzo", "Revoker", "Psycho", "Reaper", "Cannibal", "Mute", "Ooze", "Putrid", "Freak", "Leech", "Tear", "Parasite", "Flamer", "Skull", "Mr. Dead", "Vader", "Frost", "Walker", "WanderingSoul", "Shadow Assassin", "Lost Adventurer", "Livid", "Professor", "Spirit Bear"}; private static ArrayList bloodMobs = null; private Thread thread; diff --git a/src/main/java/rosegoldaddons/features/BrewingMacro.java b/src/main/java/rosegoldaddons/features/BrewingMacro.java new file mode 100644 index 0000000..6dffeba --- /dev/null +++ b/src/main/java/rosegoldaddons/features/BrewingMacro.java @@ -0,0 +1,234 @@ +package rosegoldaddons.features; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.Slot; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import net.minecraft.util.Vec3i; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import rosegoldaddons.Main; +import rosegoldaddons.utils.ChatUtils; +import rosegoldaddons.utils.RenderUtils; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class BrewingMacro { + private Thread thread; + private BlockPos stand; + private boolean sell = false; + + @SubscribeEvent + 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(), + stand, + EnumFacing.fromAngle(Minecraft.getMinecraft().thePlayer.rotationYaw), + new Vec3(Math.random(), Math.random(), Math.random()) + )) { + Minecraft.getMinecraft().thePlayer.swingItem(); + } + } + } + } + + @SubscribeEvent + public void guiDraw(GuiScreenEvent.BackgroundDrawnEvent event) { + if (!Main.brewingMacro) return; + if (thread == null || !thread.isAlive()) { + thread = new Thread(() -> { + try { + if (event.gui instanceof GuiChest) { + Container container = ((GuiChest) event.gui).inventorySlots; + if (container instanceof ContainerChest) { + String chestName = ((ContainerChest) container).getLowerChestInventory().getDisplayName().getUnformattedText(); + int sleep = Main.configFile.alchsleep; + if (Main.configFile.alchindex == 0) { + if (chestName.contains("Brewing Stand")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().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) { + clickSlot(slot.slotNumber, 1, 1); + Thread.sleep(sleep); + if (isInventoryFull()) { + sell = true; + Minecraft.getMinecraft().thePlayer.sendChatMessage("/sbmenu"); + } + } + } + } + if (sell) { + if (chestName.contains("SkyBlock")) { + Thread.sleep(100); + clickSlot(22, 0, 0); + } else if (chestName.contains("Trades")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().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) { + clickSlot(slot.slotNumber, 1, 0); + Thread.sleep(sleep); + } + } + Minecraft.getMinecraft().thePlayer.closeScreen(); + sell = false; + } + } + } else if (Main.configFile.alchindex == 1) { + if (chestName.contains("Brewing Stand")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + for (Slot slot : chestInventory) { + if (!slot.getHasStack()) continue; + if (!chestInventory.get(42).getHasStack()) { + if (slot.getStack().getDisplayName().contains("Water Bottle") && slot.slotNumber >= 54) { + clickSlot(slot.slotNumber, 1, 1); + Thread.sleep(sleep); + } + } + } + if(Main.configFile.alchclose) { + Minecraft.getMinecraft().thePlayer.closeScreen(); + } + } + } else if (Main.configFile.alchindex == 2) { + if (chestName.contains("Brewing Stand")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + for (Slot slot : chestInventory) { + if (!slot.getHasStack()) continue; + if (!chestInventory.get(13).getHasStack()) { + if (slot.getStack().getDisplayName().contains("Nether Wart") && slot.slotNumber >= 54) { + clickSlot(slot.slotNumber, 0, 0); + Thread.sleep(sleep/2); + clickSlot(13, 1, 0); + Thread.sleep(sleep/2); + clickSlot(slot.slotNumber, 0, 0); + break; + } + } + } + if(Main.configFile.alchclose) { + Minecraft.getMinecraft().thePlayer.closeScreen(); + } + } + } else if (Main.configFile.alchindex == 3) { + if (chestName.contains("Brewing Stand")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + for (Slot slot : chestInventory) { + if (!slot.getHasStack()) continue; + if (!chestInventory.get(13).getHasStack()) { + if ((slot.getStack().getDisplayName().contains("Sugar") || slot.getStack().getDisplayName().contains("Spider Eye")) && slot.slotNumber >= 54) { + clickSlot(slot.slotNumber, 0, 0); + Thread.sleep(sleep/2); + clickSlot(13, 1, 0); + Thread.sleep(sleep/2); + clickSlot(slot.slotNumber, 0, 0); + break; + } + } + } + if(Main.configFile.alchclose) { + Minecraft.getMinecraft().thePlayer.closeScreen(); + } + } + } else if (Main.configFile.alchindex == 4) { + if (chestName.contains("Brewing Stand")) { + List chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; + for (Slot slot : chestInventory) { + if (!slot.getHasStack()) continue; + if (!chestInventory.get(13).getHasStack()) { + if (slot.getStack().getDisplayName().contains("Glowstone") && slot.slotNumber >= 54) { + clickSlot(slot.slotNumber, 0, 0); + Thread.sleep(sleep/2); + clickSlot(13, 1, 0); + Thread.sleep(sleep/2); + clickSlot(slot.slotNumber, 0, 0); + break; + } + } + } + if(Main.configFile.alchclose) { + Minecraft.getMinecraft().thePlayer.closeScreen(); + } + } + } + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + }, "brewing"); + thread.start(); + } + } + + @SubscribeEvent + public void renderWorld(RenderWorldLastEvent event) { + if (!Main.brewingMacro) return; + stand = closestStand(); + if (stand != null) { + RenderUtils.drawBlockBox(stand, Color.YELLOW, true, event.partialTicks); + } + } + + private boolean isInventoryFull() { + List inventory = Minecraft.getMinecraft().thePlayer.inventoryContainer.inventorySlots; + for (Slot slot : inventory) { + if (!slot.getHasStack() && slot.slotNumber > 8) { + return false; + } + } + return true; + } + + private BlockPos closestStand() { + int r = 6; + if (Minecraft.getMinecraft().thePlayer == null) return null; + BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + playerPos.add(0, 1, 0); + Vec3 playerVec = Minecraft.getMinecraft().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())); + if (blockState.getBlock() == Blocks.brewing_stand) { + stands.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + } + double smallest = 9999; + Vec3 closest = null; + for (int i = 0; i < stands.size(); i++) { + double dist = stands.get(i).distanceTo(playerVec); + if (dist < smallest) { + smallest = dist; + closest = stands.get(i); + } + } + if (closest != null && smallest < 5) { + return new BlockPos(closest.xCoord, closest.yCoord, closest.zCoord); + } + return null; + } + + private void clickSlot(int slot, int type, int mode) { + Minecraft.getMinecraft().playerController.windowClick(Minecraft.getMinecraft().thePlayer.openContainer.windowId, slot, type, mode, Minecraft.getMinecraft().thePlayer); + } +} diff --git a/src/main/java/rosegoldaddons/features/CanePlanter.java b/src/main/java/rosegoldaddons/features/CanePlanter.java new file mode 100644 index 0000000..0a93a85 --- /dev/null +++ b/src/main/java/rosegoldaddons/features/CanePlanter.java @@ -0,0 +1,78 @@ +package rosegoldaddons.features; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import net.minecraft.util.Vec3i; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import rosegoldaddons.Main; + +import java.util.ArrayList; + +public class CanePlanter { + //when you're down bad + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (!Main.placeCane || event.phase == TickEvent.Phase.END) { + return; + } + 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()); + } + } + + private BlockPos furthestEmptyDirt() { + int r = 5; + BlockPos playerPos = Minecraft.getMinecraft().thePlayer.getPosition(); + playerPos.add(0, 1, 0); + Vec3 playerVec = Minecraft.getMinecraft().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); + IBl