From 170ccfa42e36f04306820fbc3ef8a8ce3cf75010 Mon Sep 17 00:00:00 2001 From: RoseGoldIsntGay Date: Wed, 27 Jul 2022 21:47:43 +0300 Subject: last update for a while imma be real with y'all this is really old changes i never pushed to git so forgive me if the changelog is partial added an autoclicker that probably gets u banned added auto leave limbo added three weirdos auto solver added block size modifiers for dungeons i changed a log of stuff probably bug fixes have fun --- src/main/java/rosegoldaddons/Config.java | 119 +++++++- src/main/java/rosegoldaddons/Main.java | 204 +++++++++---- .../rosegoldaddons/events/MillisecondEvent.java | 13 + .../rosegoldaddons/events/PlayerMoveEvent.java | 12 + .../rosegoldaddons/events/ScreenClosedEvent.java | 10 + .../rosegoldaddons/features/ArmorStandESPs.java | 1 - .../rosegoldaddons/features/AutoArrowAlign.java | 4 +- .../java/rosegoldaddons/features/AutoClicker.java | 80 +++++ .../rosegoldaddons/features/AutoLeaveLimbo.java | 37 +++ .../java/rosegoldaddons/features/AutoSlayer.java | 66 +++- .../rosegoldaddons/features/AutoThreeWeirdos.java | 169 +++++++++++ .../rosegoldaddons/features/CustomItemMacro.java | 6 - .../java/rosegoldaddons/features/DungeonESP.java | 20 +- .../rosegoldaddons/features/EndermanMacro.java | 260 ++++++++++++++-- .../features/ForagingIslandMacro.java | 5 +- .../rosegoldaddons/features/HardstoneAura.java | 134 ++++++--- .../java/rosegoldaddons/features/PrecEyeMacro.java | 5 + src/main/java/rosegoldaddons/features/SexAura.java | 75 ++++- .../features/StrandedVillagerMacro.java | 333 +++++++++++++++++++++ .../java/rosegoldaddons/mixins/MixinEntity.java | 4 +- .../rosegoldaddons/mixins/MixinEntityPlayer.java | 3 +- .../rosegoldaddons/mixins/MixinEntityPlayerSP.java | 30 ++ .../rosegoldaddons/mixins/MixinFMLHandShake.java | 24 ++ .../rosegoldaddons/mixins/MixinRenderString.java | 30 +- .../mixins/MixinRendererLivingEntity.java | 2 +- .../mixins/blocksize/MixinBlock.java | 49 +++ .../mixins/blocksize/MixinBlockLever.java | 29 ++ .../mixins/blocksize/MixinButton.java | 28 ++ .../mixins/blocksize/MixinChest.java | 28 ++ .../mixins/blocksize/MixinCrops.java | 26 ++ .../mixins/blocksize/MixinSkull.java | 31 ++ .../java/rosegoldaddons/utils/OpenSkyblockGui.java | 250 +++++++++++++++- .../java/rosegoldaddons/utils/RenderUtils.java | 20 +- src/main/java/rosegoldaddons/utils/Rotation.java | 44 --- .../java/rosegoldaddons/utils/ScoreboardUtils.java | 29 +- .../java/rosegoldaddons/utils/ShadyRotation.java | 55 +++- src/main/resources/mixins.rosegoldaddons.json | 13 +- 37 files changed, 2010 insertions(+), 238 deletions(-) create mode 100644 src/main/java/rosegoldaddons/events/MillisecondEvent.java create mode 100644 src/main/java/rosegoldaddons/events/PlayerMoveEvent.java create mode 100644 src/main/java/rosegoldaddons/events/ScreenClosedEvent.java create mode 100644 src/main/java/rosegoldaddons/features/AutoClicker.java create mode 100644 src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java create mode 100644 src/main/java/rosegoldaddons/features/AutoThreeWeirdos.java create mode 100644 src/main/java/rosegoldaddons/features/PrecEyeMacro.java create mode 100644 src/main/java/rosegoldaddons/features/StrandedVillagerMacro.java create mode 100644 src/main/java/rosegoldaddons/mixins/MixinEntityPlayerSP.java create mode 100644 src/main/java/rosegoldaddons/mixins/MixinFMLHandShake.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinBlock.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinBlockLever.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinButton.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinChest.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinCrops.java create mode 100644 src/main/java/rosegoldaddons/mixins/blocksize/MixinSkull.java delete mode 100644 src/main/java/rosegoldaddons/utils/Rotation.java (limited to 'src/main') diff --git a/src/main/java/rosegoldaddons/Config.java b/src/main/java/rosegoldaddons/Config.java index f9e11d0..ab13719 100644 --- a/src/main/java/rosegoldaddons/Config.java +++ b/src/main/java/rosegoldaddons/Config.java @@ -3,6 +3,8 @@ package rosegoldaddons; import gg.essential.vigilance.Vigilant; import gg.essential.vigilance.data.*; import org.jetbrains.annotations.NotNull; +import rosegoldaddons.utils.ChatUtils; +import rosegoldaddons.utils.OpenSkyblockGui; import java.io.File; import java.util.Comparator; @@ -97,7 +99,7 @@ public class Config extends Vigilant { category = "Foraging", subcategory = "General", max = 500) public int postrodDelay = 150; - @Property(type = PropertyType.SWITCH, name = "Radomize Delay", description = "Add slight randomization to delay", + @Property(type = PropertyType.SWITCH, name = "Randomize Delay", description = "Add slight randomization to delay", category = "Foraging", subcategory = "General") public boolean randomizeForaging = false; @@ -121,6 +123,10 @@ public class Config extends Vigilant { category = "Mining", subcategory = "General", options = {"Closest Block", "Facing Axis"}) public int hardIndex = 0; + @Property(type = PropertyType.SWITCH, name = "Server Side Rotations", description = "Hardstone nuker's chest solver will use server side rotations for opening treasure chests", + category = "Mining", subcategory = "General") + public boolean serverSideChest = false; + @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; @@ -149,7 +155,6 @@ public class Config extends Vigilant { category = "Farming", subcategory = "General", options = {"40 BPS", "80 BPS"}) public int farmSpeedIndex = 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; @@ -183,17 +188,89 @@ public class Config extends Vigilant { public int pinglessSpeed = 0; @Property(type = PropertyType.SWITCH, name = "Auto Slayer", description = "Automatically use batphone", - category = "RoseGoldAddons", subcategory = "General") + category = "Slayer", subcategory = "General") public boolean autoSlayer = false; @Property(type = PropertyType.SWITCH, name = "Click Maddox", description = "Automatically click maddox on boss kill", - category = "RoseGoldAddons", subcategory = "General") + category = "Slayer", 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"}) + category = "Slayer", 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 = "Force Slayer", description = "Starts a slayer quest if you dont have one, restarts if it is not done after 5 minutes", + category = "Slayer", subcategory = "General") + public boolean forceSlayer = false; + + @Property(type = PropertyType.SELECTOR, name = "Anti Racism", description = "Prevent racist messages from showing up in chat", + category = "RoseGoldAddons", subcategory = "General", options = {"Censor", "Block", "None"}) + public int antiRacism = 0; + + @Property(type = PropertyType.SWITCH, name = "Pause All Macros", description = "Pause all macros on world change", + category = "Macros", subcategory = "General") + public boolean pauseAllWorldChange = false; + + @Property(type = PropertyType.SWITCH, name = "Auto Leave Limbo", description = "Automatically leaves limbo", + category = "Macros", subcategory = "General") + public boolean autoLeaveLimbo = false; + + @Property(type = PropertyType.SWITCH, name = "Join SkyBlock", description = "Automatically joins skyblock after leaving limbo", + category = "Macros", subcategory = "General") + public boolean autoLimboSB = true; + + @Property(type = PropertyType.SWITCH, name = "Enderman Move Macro", description = "Add primitive movement to enderman macro", + category = "Macros", subcategory = "Enderman") + public boolean endermanMove = false; + + @Property(type = PropertyType.SWITCH, name = "Enderman Lobby", description = "Go to lobby instead of island when switching lobbies", + category = "Macros", subcategory = "Enderman") + public boolean endermanLobby = false; + + @Property(type = PropertyType.SWITCH, name = "Randomization", description = "Random head movements when not shooting endermen", + category = "Macros", subcategory = "Enderman") + public boolean endermanRandom = false; + + @Property(type = PropertyType.SWITCH, name = "Right Click", description = "Right click instead of shifting", + category = "Macros", subcategory = "Enderman") + public boolean endermanRC = false; + + @Property(type = PropertyType.SWITCH, name = "Special Zealot Right Click", description = "Right click on special zealots (spirit sceptre recommended)", + category = "Macros", subcategory = "Enderman") + public boolean zealotRC = false; + + @Property(type = PropertyType.SWITCH, name = "Zealot Only", description = "Only target zealots", + category = "Macros", subcategory = "Enderman") + public boolean zealotOnly = false; + + @Property(type = PropertyType.SLIDER, name = "Lobby Swap Timer", description = "How many minutes to wait until finding a new lobby", + category = "Macros", subcategory = "Enderman", max = 30) + public int endermanTimer = 10; + + @Property(type = PropertyType.SWITCH, name = "Ironman Mode", description = "Lobby swap without using the bazaar", + category = "Macros", subcategory = "Enderman") + public boolean endermanIronman = false; + + @Property(type = PropertyType.SELECTOR, name = "Shifting / Right Click Speed", description = "Determine the speed of the enderman macro", + category = "Macros", subcategory = "Enderman", options = {"x2", "x1", "x0.5", "x0.25"}) + public int endermanSpeed = 1; + + @Property(type = PropertyType.SLIDER, name = "Stuck Distance", description = "Distance to block to turn away (square)", + category = "Macros", subcategory = "Enderman", max = 10) + public int endermanStuckDist = 3; + + @Property(type = PropertyType.SELECTOR, name = "Type", description = "Choose a type", + category = "Macros", subcategory = "Stranded Villagers", options = {"Cocoa", "Potato", "Sugar Cane", "Ender Pearls"}) + public int strandedType = 0; + + @Property(type = PropertyType.SLIDER, name = "Interaction Delay", description = "How many ticks to wait next interaction", + category = "Macros", subcategory = "Stranded Villagers", max = 20) + public int strandedCropDebounc = 10; + + @Property(type = PropertyType.SLIDER, name = "GUI Interaction Delay", description = "How many ticks to wait next GUI interaction", + category = "Macros", subcategory = "Stranded Villagers", max = 10) + public int strandedGUIDebounc = 5; + @Property(type = PropertyType.SELECTOR, name = "Custom Name Type", description = "ignore if you dont know what these mean", category = "RoseGoldAddons", subcategory = "General", options = {"MixinEntityPlayer", "MixinEntityPlayer + MixinEntity"}) public int nameRenderType = 0; @@ -218,6 +295,38 @@ public class Config extends Vigilant { category = "ESP", subcategory = "General") public boolean nucleusESP = false; + @Property(type = PropertyType.SWITCH, name = "Big Blocks", description = "Change levers, buttons, chests and Redstone Key skulls to 1x1x1", + category = "Dungeons", subcategory = "General") + public boolean dungeonBlocksBig = false; + + @Property(type = PropertyType.SWITCH, name = "Auto 3 Weirdos", description = "beta", + category = "Dungeons", subcategory = "General") + public boolean autoThreeWeirdos = false; + + @Property(type = PropertyType.SWITCH, name = "Force Dungeon", description = "", + category = "testing", subcategory = "General") + public boolean forceDungeon = false; + + @Property(type = PropertyType.BUTTON, name = "Sell All", description = "", + category = "testing", subcategory = "General") + public void sellAllTest() { + ChatUtils.sendMessage("Selling All!"); + Main.mc.thePlayer.sendChatMessage("/bz"); + OpenSkyblockGui.sellAll = true; + } + + @Property(type = PropertyType.SWITCH, name = "KeyBoard Event Cancel", description = "", + category = "testing", subcategory = "General") + public boolean stopKeyboard = false; + + @Property(type = PropertyType.SELECTOR, name = "Auto Click Mode", description = "", + category = "Macros", subcategory = "General", options = {"Right Click", "Left Click"}) + public int autoClickerMode = 0; + + @Property(type = PropertyType.SLIDER, name = "Auto Click CPS", description = "", + category = "Macros", subcategory = "General", min = 1, max = 1000) + public int autoClickerCPS = 10; + public Config() { 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 ebdb7d7..5a6d256 100644 --- a/src/main/java/rosegoldaddons/Main.java +++ b/src/main/java/rosegoldaddons/Main.java @@ -6,6 +6,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.event.ClickEvent; @@ -24,6 +25,7 @@ import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.lwjgl.input.Keyboard; import rosegoldaddons.commands.*; +import rosegoldaddons.events.MillisecondEvent; import rosegoldaddons.features.*; import rosegoldaddons.utils.*; @@ -32,10 +34,18 @@ import java.net.URL; import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Paths; +import java.time.Duration; +import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; -@Mod(modid = "timechanger", name = "RoseGoldAddons", version = "2.1") +@Mod(modid = Main.MOD_ID, name = "RoseGoldAddons", version = "2.9.0") public class Main { + public static final String MOD_ID = "RoseGoldAddons"; + + private static final boolean stranded = false; + public static GuiScreen display = null; public static Config configFile = Config.INSTANCE; public static KeyBinding[] keyBinds = new KeyBinding[20]; @@ -54,13 +64,14 @@ public class Main { 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; private static boolean oldanim = false; + public static boolean oringo = false; public static boolean init = false; public static boolean mithrilMacro = false; private boolean issue = false; public static boolean pauseCustom = false; + public static boolean strandedVillagers = false; public static final Minecraft mc = Minecraft.getMinecraft(); public static JsonObject rga; @@ -69,6 +80,9 @@ public class Main { private String[] cumsters = null; private String[] ILILILLILILLILILILL = null; + public static String[] cheatar = null; + public static ArrayList blacklist = new ArrayList<>(); + public static HashMap nameCache = new HashMap<>(); public static HashMap rankCache = new HashMap<>(); public static ArrayList hashedCache = new ArrayList<>(); @@ -79,6 +93,7 @@ public class Main { public void onFMLInitialization(FMLPreInitializationEvent event) { File directory = new File(event.getModConfigurationDirectory(), "rosegoldaddons"); if (!directory.exists()) { + directory.mkdirs(); } @@ -92,7 +107,6 @@ public class Main { @Mod.EventHandler public void init(FMLInitializationEvent event) { - if (issue) return; MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new AutoReady()); MinecraftForge.EVENT_BUS.register(new OpenSkyblockGui()); @@ -124,6 +138,11 @@ public class Main { MinecraftForge.EVENT_BUS.register(new ShadyRotation()); MinecraftForge.EVENT_BUS.register(new DungeonESP()); MinecraftForge.EVENT_BUS.register(new ScoreboardUtils()); + MinecraftForge.EVENT_BUS.register(new PrecEyeMacro()); + MinecraftForge.EVENT_BUS.register(new StrandedVillagerMacro()); + MinecraftForge.EVENT_BUS.register(new AutoLeaveLimbo()); + MinecraftForge.EVENT_BUS.register(new AutoThreeWeirdos()); + MinecraftForge.EVENT_BUS.register(new AutoClicker()); configFile.initialize(); ClientCommandHandler.instance.registerCommand(new OpenSettings()); ClientCommandHandler.instance.registerCommand(new Rosedrobe()); @@ -134,41 +153,58 @@ public class Main { ClientCommandHandler.instance.registerCommand(new AllEntities()); ClientCommandHandler.instance.registerCommand(new SexPlayer()); - JsonArray funnynames = rga.get("funnynames").getAsJsonArray(); - cumsters = new String[funnynames.size()]; - Iterator fn = funnynames.iterator(); - int count = 0; - while(fn.hasNext()) { - JsonElement name = fn.next(); - cumsters[count] = name.getAsString(); - count++; - } - JsonArray funnymessages = rga.get("funnymessages").getAsJsonArray(); - ILILILLILILLILILILL = new String[funnymessages.size()]; - Iterator fm = funnymessages.iterator(); - count = 0; - while(fm.hasNext()) { - JsonElement message = fm.next(); - ILILILLILILLILILILL[count] = message.getAsString(); - count++; - } + if(!issue) { + JsonArray funnynames = rga.get("funnynames").getAsJsonArray(); + cumsters = new String[funnynames.size()]; + Iterator fn = funnynames.iterator(); + int count = 0; + while (fn.hasNext()) { + JsonElement name = fn.next(); + cumsters[count] = name.getAsString(); + count++; + } + JsonArray funnymessages = rga.get("funnymessages").getAsJsonArray(); + ILILILLILILLILILILL = new String[funnymessages.size()]; + Iterator fm = funnymessages.iterator(); + count = 0; + while (fm.hasNext()) { + JsonElement message = fm.next(); + ILILILLILILLILILILL[count] = message.getAsString(); + count++; + } - JsonObject replacions = rga.get("replacions").getAsJsonObject(); - Set> set = replacions.entrySet(); + JsonArray cheaters = rga.get("cheaters").getAsJsonArray(); + cheatar = new String[cheaters.size()]; + Iterator ch = cheaters.iterator(); + count = 0; + while (ch.hasNext()) { + JsonElement name = ch.next(); + cheatar[count] = name.getAsString(); + count++; + } - set.forEach(stringJsonElementEntry -> { - names.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§")); - System.out.println(stringJsonElementEntry.getKey()+": "+stringJsonElementEntry.getValue().getAsString().replace("&", "§")); - }); + JsonObject replacions = rga.get("replacions").getAsJsonObject(); + Set> set = replacions.entrySet(); - replacions = rga.get("ranks").getAsJsonObject(); - set = replacions.entrySet(); + set.forEach(stringJsonElementEntry -> { + names.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§")); + System.out.println(stringJsonElementEntry.getKey() + ": " + stringJsonElementEntry.getValue().getAsString().replace("&", "§")); + }); - set.forEach(stringJsonElementEntry -> { - ranks.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§")); - System.out.println(stringJsonElementEntry.getKey()+": "+stringJsonElementEntry.getValue().getAsString().replace("&", "§")); - }); - init = true; + replacions = rga.get("ranks").getAsJsonObject(); + set = replacions.entrySet(); + + set.forEach(stringJsonElementEntry -> { + ranks.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§")); + System.out.println(stringJsonElementEntry.getKey() + ": " + stringJsonElementEntry.getValue().getAsString().replace("&", "§")); + }); + + JsonArray jsonArray = rga.get("blacklist").getAsJsonArray(); + for(JsonElement jsonElement : jsonArray) { + blacklist.add(jsonElement.getAsString()); + } + init = true; + } try { Reader reader = Files.newBufferedReader(Paths.get("./config/rosegoldaddons/rcmacros.json")); @@ -208,7 +244,7 @@ public class Main { 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[3] = new KeyBinding("Powder Chest 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"); @@ -222,13 +258,15 @@ public class Main { 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"); - keyBinds[18] = new KeyBinding("Mithril Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); - keyBinds[19] = new KeyBinding("Peek Custom Names", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[17] = new KeyBinding("Mithril Macro Toggle", Keyboard.KEY_NONE, "RoseGoldAddons - Mining"); + keyBinds[18] = new KeyBinding("Toggle Custom Names", Keyboard.KEY_NONE, "RoseGoldAddons"); + keyBinds[19] = new KeyBinding("Toggle Stranded Villager Trading", Keyboard.KEY_NONE, "RoseGoldAddons"); for (KeyBinding keyBind : keyBinds) { ClientRegistry.registerKeyBinding(keyBind); } + + AutoClicker.init(); } @Mod.EventHandler @@ -237,19 +275,36 @@ public class Main { if (modContainer.getModId().equals("oldanimations")) { oldanim = true; } + if (modContainer.getModId().equals("examplemod")) { + oringo = true; + } }); + + LocalDateTime now = LocalDateTime.now(); + LocalDateTime firstRun = now.withSecond(0).plusMinutes(1); + Duration initialDelay = Duration.between(now, firstRun); + Executors.newScheduledThreadPool(1).scheduleAtFixedRate(() -> { + System.out.println("Reset hashed cache!"); + hashedCache.clear(); + }, initialDelay.getSeconds(), 600, TimeUnit.SECONDS); + + Executors.newScheduledThreadPool(1).scheduleAtFixedRate(() -> MinecraftForge.EVENT_BUS.post(new MillisecondEvent()), initialDelay.getSeconds(), 1, TimeUnit.MILLISECONDS); + } @SubscribeEvent public void onWorldChange(WorldEvent.Unload event) { - if(forageOnIsland || nukeWood || nukeCrops || mithrilNuker || gemNukeToggle || mithrilMacro) { - ChatUtils.sendMessage("§cDetected World Change, Stopping All Macros"); - forageOnIsland = false; - nukeWood = false; - nukeCrops = false; - mithrilNuker = false; - gemNukeToggle = false; - mithrilMacro = false; + if(configFile.pauseAllWorldChange) { + if (forageOnIsland || nukeWood || nukeCrops || mithrilNuker || gemNukeToggle || mithrilMacro || autoHardStone) { + ChatUtils.sendMessage("§cDetected World Change, Stopping All Macros"); + forageOnIsland = false; + nukeWood = false; + nukeCrops = false; + mithrilNuker = false; + gemNukeToggle = false; + mithrilMacro = false; + autoHardStone = false; + } } } @@ -258,8 +313,8 @@ public class Main { if (event.phase != TickEvent.Phase.START) return; if(mc.thePlayer == null || mc.theWorld == null) return; if(firstLoginThisSession) { - ChatComponentText msg1 = new ChatComponentText("§0§7Thanks to ShadyAddons:§b https://cheatersgetbanned.me"); - msg1.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://cheatersgetbanned.me")); + ChatComponentText msg1 = new ChatComponentText("§0§7Thanks to ShadyAddons:§b https://shadyaddons.com/"); + msg1.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://shadyaddons.com/")); 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§7Thanks to pizza boy (Pizza Client):§b https://github.com/PizzaboiBestLegit/Pizza-Client"); @@ -271,7 +326,13 @@ public class Main { mc.thePlayer.addChatMessage(msg3); mc.thePlayer.addChatMessage(msg4); if(oldanim) { - ChatUtils.sendMessage("§l§4Old Animations Mod was detected in your mods folder. This mod breaks some key RoseGoldAddons features, please uninstall it before asking for support as it is known to cause a lot of issues. Thanks."); + ChatUtils.sendMessage("§l§cOld Animations Mod was detected in your mods folder. This mod breaks some key RoseGoldAddons features, please uninstall it before asking for support as it is known to cause a lot of issues. Thanks."); + } + if(oringo) { + ChatUtils.sendMessage("§l§cDetected Oringo Client loaded, server side rotations will not work during this session if oringo version is before 1.7.0."); + } + if(issue) { + ChatUtils.sendMessage("§l§cAn error has occurred while retrieving info from the RoseGoldAddons database, certain features will not work during this session"); } firstLoginThisSession = false; } @@ -288,15 +349,10 @@ public class Main { } } - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - pauseCustom = keyBinds[19].isKeyDown(); - } - @SubscribeEvent public void key(InputEvent.KeyInputEvent event) { int rnd = new Random().nextInt(configFile.skiblock); - if(rnd == 0 && configFile.funnyStuff) { + if(rnd == 0 && configFile.funnyStuff && init) { mc.thePlayer.addChatMessage(new ChatComponentText((cumsters[new Random().nextInt(cumsters.length)].replace("&","§")+"§7: "+i(ILILILLILILLILILILL[new Random().nextInt(ILILILLILILLILILILL.length)])))); } if (keyBinds[0].isPressed()) { @@ -306,12 +362,30 @@ public class Main { } else if (keyBinds[1].isPressed()) { endermanMacro = !endermanMacro; String str = endermanMacro ? "§aZealot Macro Activated" : "§cZealot Macro Deactivated"; + EndermanMacro.ticks = 0; ChatUtils.sendMessage(str); + if(endermanMacro) { + EndermanMacro.ms = System.currentTimeMillis(); + if(configFile.endermanMove) { + if(Main.configFile.endermanIronman) { + ChatUtils.sendMessage("Needed: " + "§6Precursor Eye§f, §b/warp drag§f, Chest near island spawn"); + } else { + if (Main.configFile.endermanTimer != 0) { + ChatUtils.sendMessage("Needed: " + "§6Precursor Eye§f, §b/warp drag§f, §b/bz"); + } else { + ChatUtils.sendMessage("Needed: " + "§6Precursor Eye§f"); + } + } + ChatUtils.sendMessage("Recommended to hold a §6Spirit Sceptre"); + } else { + ChatUtils.sendMessage("Needed: "+"§6Precursor Eye"); + } + } } else if (keyBinds[2].isPressed()) { AutoArrowAlign.cheat(); } else if (keyBinds[3].isPressed()) { powderMacro = !powderMacro; - String str = powderMacro ? "§aPowder Macro Activated" : "§cPowder Macro Deactivated"; + String str = powderMacro ? "§aPowder Chest Macro Activated" : "§cPowder Chest Macro Deactivated"; ChatUtils.sendMessage(str); } else if (keyBinds[4].isPressed()) { AOTSMacro = !AOTSMacro; @@ -364,13 +438,23 @@ public class Main { 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); - } else if(keyBinds[18].isPressed()) { mithrilMacro = !mithrilMacro; String str = mithrilMacro ? "§aMithril Macro Activated" : "§cMithril Macro Deactivated"; ChatUtils.sendMessage(str); + } else if(keyBinds[18].isPressed()) { + pauseCustom = !pauseCustom; + ChatUtils.sendMessage(pauseCustom ? "§cCustom Names Deactivated" : "§aCustom Names Activated"); + } else if(keyBinds[19].isPressed()) { + if(stranded) { + strandedVillagers = !strandedVillagers; + StrandedVillagerMacro.drop = false; + StrandedVillagerMacro.dropped = false; + StrandedVillagerMacro.trade = false; + StrandedVillagerMacro.traded = false; + StrandedVillagerMacro.emptySack = false; + StrandedVillagerMacro.emptied = false; + ChatUtils.sendMessage(strandedVillagers ? "§aStranded Villager Trading Activated" : "§cStranded Villager Trading Deactivated"); + } } } diff --git a/src/main/java/rosegoldaddons/events/MillisecondEvent.java b/src/main/java/rosegoldaddons/events/MillisecondEvent.java new file mode 100644 index 0000000..4ea5160 --- /dev/null +++ b/src/main/java/rosegoldaddons/events/MillisecondEvent.java @@ -0,0 +1,13 @@ +package rosegoldaddons.events; + +import net.minecraftforge.fml.common.eventhandler.Event; + +import java.time.LocalDateTime; + +public class MillisecondEvent extends Event { + public LocalDateTime dateTime; + + public MillisecondEvent() { + dateTime = LocalDateTime.now(); + } +} \ No newline at end of file diff --git a/src/main/java/rosegoldaddons/events/PlayerMoveEvent.java b/src/main/java/rosegoldaddons/events/PlayerMoveEvent.java new file mode 100644 index 0000000..cab6637 --- /dev/null +++ b/src/main/java/rosegoldaddons/events/PlayerMoveEvent.java @@ -0,0 +1,12 @@ +package rosegoldaddons.events; + +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class PlayerMoveEvent extends Event { + @Cancelable + public static class Pre extends Event {} + + public static class Post extends Event {} +} diff --git a/src/main/java/rosegoldaddons/events/ScreenClosedEvent.java b/src/main/java/rosegoldaddons/events/ScreenClosedEvent.java new file mode 100644 index 0000000..bee57c4 --- /dev/null +++ b/src/main/java/rosegoldaddons/events/ScreenClosedEvent.java @@ -0,0 +1,10 @@ +package rosegoldaddons.events; + +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class ScreenClosedEvent extends Event { + + public ScreenClosedEvent() {} +} diff --git a/src/main/java/rosegoldaddons/features/ArmorStandESPs.java b/src/main/java/rosegoldaddons/features/ArmorStandESPs.java index f726052..b937f8a 100644 --- a/src/main/java/rosegoldaddons/features/ArmorStandESPs.java +++ b/src/main/java/rosegoldaddons/features/ArmorStandESPs.java @@ -1,6 +1,5 @@ package rosegoldaddons.features; -import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.entity.boss.EntityWither; diff --git a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java index db9650f..de502c4 100644 --- a/src/main/java/rosegoldaddons/features/AutoArrowAlign.java +++ b/src/main/java/rosegoldaddons/features/AutoArrowAlign.java @@ -32,7 +32,7 @@ public class AutoArrowAlign { private static final Map clicksPerFrame = new HashMap<>(); private static final Map toClickMap = new HashMap<>(); private static boolean init = false; - private static final BlockPos topLeft = new BlockPos(196, 125, 278); + private static final BlockPos topLeft = new BlockPos(196 - 100, 125, 278 - 100); /*@SubscribeEvent public void debugging(TickEvent.ClientTickEvent event) { @@ -336,6 +336,6 @@ public class AutoArrowAlign { private static boolean isInSection3() { int x = Main.mc.thePlayer.getPosition().getX(); int z = Main.mc.thePlayer.getPosition().getZ(); - return x < 218 && z > 251 && x > 196 && z < 319; + return x < (218 - 200) && z > (251 - 200) && x > (196 - 200) && z < (319 - 200); } } diff --git a/src/main/java/rosegoldaddons/features/AutoClicker.java b/src/main/java/rosegoldaddons/features/AutoClicker.java new file mode 100644 index 0000000..0411df3 --- /dev/null +++ b/src/main/java/rosegoldaddons/features/AutoClicker.java @@ -0,0 +1,80 @@ +package rosegoldaddons.features; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.InputEvent; +import org.lwjgl.input.Keyboard; +import rosegoldaddons.Main; +import rosegoldaddons.events.MillisecondEvent; +import rosegoldaddons.utils.ChatUtils; + +import java.lang.reflect.Method; + +public class AutoClicker { + private static final KeyBinding keyBinding = new KeyBinding("Auto Clicker", Keyboard.KEY_NONE, "RoseGoldAddons - Combat"); + private boolean toggled = false; + private int count = 0; + private long startedAt = 0; + private long lastClickTime = 0; + + @SubscribeEvent + public void onMillisecond(MillisecondEvent event) { + if(!toggled) return; + if(System.currentTimeMillis() - lastClickTime < (long) (1000 / Main.configFile.autoClickerCPS)) return; + switch (Main.configFile.autoClickerMode) { + case 1: + MovingObjectPosition movingObjectPosition = Main.mc.objectMouseOver; + if (movingObjectPosition != null && movingObjectPosition.entityHit != null) { + Main.mc.playerController.attackEntity(Main.mc.thePlayer, movingObjectPosition.entityHit); + Main.mc.thePlayer.swingItem(); + count++; + } else if (movingObjectPosition != null) { + Main.mc.thePlayer.swingItem(); + } + break; + case 0: + rightClick(); + count++; + break; + } + lastClickTime = System.currentTimeMillis(); + } + + @SubscribeEvent + public void onKeyInput(InputEvent.KeyInputEvent event) { + int eventKey = Keyboard.getEventKey(); + if(eventKey != keyBinding.getKeyCode()) return; + if(Keyboard.isKeyDown(eventKey)) { + if(!toggled) { + toggled = true; + count = 0; + startedAt = System.currentTimeMillis(); + } + } else { + toggled = false; + ChatUtils.sendMessage(String.format("%s Clicks in %s milliseconds", count, System.currentTimeMillis() - startedAt)); + } + } + + public static void init() { + ClientRegistry.registerKeyBinding(keyBinding); + } + + public static void rightClick() { + try { + Method rightClickMouse; + try { + rightClickMouse = Minecraft.class.getDeclaredMethod("func_147121_ag"); + } catch (NoSuchMethodException e) { + rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse"); + } + rightClickMouse.setAccessible(true); + rightClickMouse.invoke(Main.mc); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java b/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java new file mode 100644 index 0000000..407965f --- /dev/null +++ b/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java @@ -0,0 +1,37 @@ +package rosegoldaddons.features; + +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import rosegoldaddons.Main; +import rosegoldaddons.utils.ScoreboardUtils; + +public class AutoLeaveLimbo { + private int deb = 0; + private boolean playSb = false; + private int prev = 0; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if(!Main.configFile.autoLeaveLimbo || Main.endermanMacro) return; + if(event.phase == TickEvent.Phase.END) return; + if(deb > 0) deb--; + if(deb != 0) return; + deb = 20; + if(ScoreboardUtils.inLimbo) { + if(prev < 10) { + prev++; + } else { + Main.mc.thePlayer.sendChatMessage("/l"); + prev = 0; + playSb = true; + return; + } + } else { + prev = 0; + } + if(!ScoreboardUtils.inSkyblock && playSb && Main.configFile.autoLimboSB) { + Main.mc.thePlayer.sendChatMessage("/play sb"); + playSb = false; + } + } +} diff --git a/src/main/java/rosegoldaddons/features/AutoSlayer.java b/src/main/java/rosegoldaddons/features/AutoSlayer.java index 64b173a..09c7c51 100644 --- a/src/main/java/rosegoldaddons/features/AutoSlayer.java +++ b/src/main/java/rosegoldaddons/features/AutoSlayer.java @@ -25,6 +25,8 @@ public class AutoSlayer { private static boolean openMaddox = false; private static boolean startSlayer = false; private static boolean waitingForMaddox = false; + private static boolean restart = false; + private static int countdown = 0; private static int slayerSlot = 0; private static int slotLevel = 0; private static int debounce = 0; @@ -46,12 +48,12 @@ public class AutoSlayer { } @SubscribeEvent - public void onInteract(InputEvent.KeyInputEvent event) { + public void interactHandler(TickEvent.ClientTickEvent event) { + if(Main.mc.thePlayer == null || Main.mc.theWorld == null) return; + if(ScoreboardUtils.inPrivateIsland) 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!")) { + if (Main.configFile.forceSlayer) { + if (!ScoreboardUtils.scoreboardContains("Slay the boss!") && !ScoreboardUtils.scoreboardContains("Kills") && !ScoreboardUtils.scoreboardContains("Combat XP")) { int maddox = findItemInHotbar("Batphone"); if (maddox != -1) { ItemStack item = Main.mc.thePlayer.inventory.getStackInSlot(maddox); @@ -60,7 +62,44 @@ public class AutoSlayer { Main.mc.playerController.sendUseItem(Main.mc.thePlayer, Main.mc.theWorld, item); Main.mc.thePlayer.inventory.currentItem = save; waitingForMaddox = true; - break; + restart = false; + } + } + if (ScoreboardUtils.scoreboardContains("Slay the boss!")) { + if (!restart) { + countdown = 800; + restart = true; + } else { + if (countdown > 0) { + if (countdown % 40 == 0) { + ChatUtils.sendMessage("§ccountdown: " + countdown / 40); + } + countdown--; + } else { + int maddox = findItemInHotbar("Batphone"); + if (maddox != -1) { + 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; + restart = false; + } + } + } + } + } else { + if (ScoreboardUtils.scoreboardContains("Boss slain!")) { + int maddox = findItemInHotbar("Batphone"); + if (maddox != -1) { + 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; + restart = false; } } } @@ -133,13 +172,26 @@ public class AutoSlayer { List chestInventory = ((GuiChest) Main.mc.currentScreen).inventorySlots.inventorySlots; if (!chestInventory.get(13).getHasStack()) return; if (chestInventory.get(13).getStack().getDisplayName().contains("Ongoing")) { - + if (Main.configFile.forceSlayer) { + clickSlot(13, 2, 0); + clickSlot(11, 2, 1); + clickSlot(slayerSlot, 2, 2); + clickSlot(slotLevel, 2, 3); + clickSlot(11, 2, 4); //confirm + debounce = 80; + } } else if (chestInventory.get(13).getStack().getDisplayName().contains("Complete")) { clickSlot(13, 2, 0); clickSlot(slayerSlot, 2, 1); clickSlot(slotLevel, 2, 2); clickSlot(11, 2, 3); //confirm debounce = 80; + } else if (chestInventory.get(13).getStack().getDisplayName().contains("Failed")) { + clickSlot(13, 2, 0); + clickSlot(slayerSlot, 2, 1); + clickSlot(slotLevel, 2, 2); + clickSlot(11, 2, 3); //confirm + debounce = 80; } else { clickSlot(slayerSlot, 2, 0); clickSlot(slotLevel, 2, 1); diff --git a/src/main/java/rosegoldaddons/features/AutoThreeWeirdos.java b/src/main/java/rosegoldaddons/features/AutoThreeWeirdos.java new file mode 100644 index 0000000..d96e804 --- /dev/null +++ b/src/main/java/rosegoldaddons/features/AutoThreeWeirdos.java @@ -0,0 +1,169 @@ +package rosegoldaddons.features; + +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.StringUtils; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import rosegoldaddons.Main; +import rosegoldaddons.utils.ChatUtils; +import rosegoldaddons.utils.ScoreboardUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +/* + * Solver blatantly copied from DSM: https://github.com/bowser0000/SkyblockMod + */ + +public class AutoThreeWeirdos { + private static final ArrayList solutions = new ArrayList<>(Arrays.asList( + "The reward is not in my chest!", + "At least one of them is lying, and the reward is not in", + "My chest doesn't have the reward. We are all telling the truth", + "My chest has the reward and I'm telling the truth", + "The reward isn't in any of our chests", + "Both of them are telling the truth." + )); + + private static final ArrayList weirdos = new ArrayList<>(Arrays.asList( + "Baxter", "Benson", "Eveleth", "Hope", "Luverne", "Madelia", "Rose", "Victoria", "Morris", "Carver", "Ardis", "Lino", + "Elmo", "Virginia", "Montgomery", "Winona", "Melrose", "Marshall", "Hugo", "Willmar", "Ramsey" + )); + + private static BlockPos riddleChest = null; + private static boolean talked = false; + private static boolean opened = false; + private static int debounce = 0; + + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if(!Main.configFile.autoThreeWeirdos || opened || !ScoreboardUtils.inDungeon) return; + String message = removeFormatting(event.message.getUnformattedText()); + if (message.startsWith("[NPC]")) { + for (String solution : solutions) { + if (message.contains(solution)) { + String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); + if (riddleChest == null) { + List entities = Main.mc.theWorld.getLoadedEntityList(); + for (Entity entity : entities) { + if (entity == null || !entity.hasCustomName()) continue; + if (entity.getCustomNameTag().contains(npcName)) { + BlockPos npcLocation = new BlockPos(entity.posX, 69, entity.posZ); + if (Main.mc.theWorld.getBlockState(npcLocation.north()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.north(); + } else if (Main.mc.theWorld.getBlockState(npcLocation.east()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.east(); + } else if (Main.mc.theWorld.getBlockState(npcLocation.south()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.south(); + } else if (Main.mc.theWorld.getBlockState(npcLocation.west()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.west(); + } else { + ChatUtils.sendMessage("Could not find correct riddle chest."); + } + break; + } + } + } + break; + } + } + } + else if(message.startsWith("PUZZLE") && message.contains("wasn't fooled by")) { + opened = true; + talked = true; + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if(!Main.configFile.autoThreeWeirdos || opened || !ScoreboardUtils.inDungeon) return; + if(Main.mc.theWorld == null || Main.mc.thePlayer == null) return; + if(event.phase == TickEvent.Phase.END) return; + if(debounce > 0) debounce--; + if(debounce != 0) return; + if(!talked) { + debounce = 5; + if(!allWeirdosInRange()) return; + interactWithWeirdos(); + talked = true; + } else { + if(riddleChest != null) { + debounce = 10; + interactWithChest(); + } + } + } + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + riddleChest = null; + opened = false; + talked = false; + } + + private static boolean allWeirdosInRange() { + int count = 0; + List entities = Main.mc.theWorld.getLoadedEntityList(); + for (Entity entity : entities) { + if (entity == null || !entity.hasCustomName()) continue; + String name = removeFormatting(entity.getCustomNameTag()); + if(weirdos.contains(name)) { + float range = entity.getDistanceToEntity(Main.mc.thePlayer); + if(range < 4) { + count++; + } + } + } + if(count == 1 || count == 2) { + ChatUtils.sendMessage("Detected an incorrect amount of weirdos in range, try moving closer or DMing RoseGold#5441 the names of the weirdos"); + } + return count == 3 || count == 2; + } + + private static void interactWithWeirdos() { + List entities = Main.mc.theWorld.getLoadedEntityList(); + for (Entity entity : entities) { + if (entity == null || !entity.hasCustomName()) continue; + String name = removeFormatting(entity.getCustomNameTag()); + if(weirdos.contains(name)) { + interactWithEntity(entity); + } + } + } + + private static void interactWithChest() { + Vec3 playerPos = Main.mc.thePlayer.getPositionEyes(1f); + if(playerPos.distanceTo(new Vec3(riddleChest.getX() + 0.5, riddleChest.getY() + 0.5, riddleChest.getZ() + 0.5)) > 5) { + ChatUtils.sendMessage("§cWalk closer to chest!"); + } + if(Main.mc.playerController.onPlayerRightClick( + Main.mc.thePlayer, + Main.mc.theWorld, + Main.mc.thePlayer.inventory.getCurrentItem(), + riddleChest, + EnumFacing.fromAngle(Main.mc.thePlayer.rotationYaw), + new Vec3(Math.random(), Math.random(), Math.random()) + )) { + Main.mc.thePlayer.swingItem(); + opened = true; + } + } + + private static void interactWithEntity(Entity entity) { + PlayerControllerMP playerControllerMP = Main.mc.playerController; + playerControllerMP.interactWithEntitySendPacket(Main.mc.thePlayer, entity); + } + + private static String removeFormatting(String input) { + return input.replaceAll("§[0-9a-fk-or]", ""); + } + +} diff --git a/src/main/java/rosegoldaddons/features/CustomItemMacro.java b/src/main/java/rosegoldaddons/features/CustomItemMacro.java index 37b4ce3..7f6e179 100644 --- a/src/main/java/rosegoldaddons/features/CustomItemMacro.java +++ b/src/main/java/rosegoldaddons/features/CustomItemMacro.java @@ -1,18 +1,12 @@ package rosegoldaddons.features; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -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.commands.UseCooldown; -import java.lang.reflect.Method; - public class CustomItemMacro { private Thread thread; private int milis = 0; diff --git a/src/main/java/rosegoldaddons/features/DungeonESP.java b/src/main/java/rosegoldaddons/features/DungeonESP.java index b611fe9..958a5e3 100644 --- a/src/main/java/rosegoldaddons/features/DungeonESP.java +++ b/src/main/java/rosegoldaddons/features/DungeonESP.java @@ -1,7 +1,6 @@ package rosegoldaddons.features; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.passive.EntityBat; import net.minecraft.entity.player.EntityPlayer; @@ -9,9 +8,9 @@ import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; import rosegoldaddons.Main; import rosegoldaddons.events.RenderLivingEntityEvent; -import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.RenderUtils; import rosegoldaddons.utils.ScoreboardUtils; @@ -23,6 +22,7 @@ import java.util.List; public class DungeonESP { private static HashMap highlightedEntities = new HashMap<>(); private static HashSet checkedStarNameTags = new HashSet<>(); + private int ticks = 0; private static void highlightEntity(Entity entity, Color color) { highlightedEntities.put(entity, color); @@ -55,11 +55,10 @@ public class DungeonESP { @SubscribeEvent public void onRenderEntityLiving(RenderLivingEntityEvent event) { - if (!ScoreboardUtils.inDungeon || !Main.configFile.dungeonESP || checkedStarNameTags.contains(event.entity)) - return; + if (!ScoreboardUtils.inDungeon || !Main.configFile.dungeonESP || checkedStarNameTags.contains(event.entity)) return; if (event.entity instanceof EntityArmorStand) { - if (event.entity.hasCustomName() && event.entity.getCustomNameTag().contains("✯")) { - List possibleEntities = event.entity.getEntityWorld().getEntitiesInAABBexcluding(event.entity, event.entity.getEntityBoundingBox().expand(0, 3, 0), entity -> !(entity instanceof EntityArmorStand)); + if (event.entity.hasCustomName() && (event.entity.getCustomNameTag().contains("✯") || event.entity.getCustomNameTag().contains("__rga"))) { + List possibleEntities = event.entity.getEntityWorld().getEntitiesInAABBexcluding(event.entity, event.entity.getEntityBoundingBox().offset(0, -1, 0), entity -> !(entity instanceof EntityArmorStand)); if (!possibleEntities.isEmpty()) { highlightEntity(possibleEntities.get(0), Color.ORANGE); } @@ -79,6 +78,15 @@ public class DungeonESP { } } + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if(ticks % 40 == 0) { + checkedStarNameTags.clear(); + ticks = 0; + } + ticks++; + } + @SubscribeEvent public void onWorldLoad(WorldEvent.Load event) { highlightedEntities.clear(); diff --git a/src/main/java/rosegoldaddons/features/EndermanMacro.java b/src/main/java/rosegoldaddons/features/EndermanMacro.java index 0e99af4..ecd82d2 100644 --- a/src/main/java/rosegoldaddons/features/EndermanMacro.java +++ b/src/main/java/rosegoldaddons/features/EndermanMacro.java @@ -1,62 +1,280 @@ package rosegoldaddons.features; -import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBanner; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiIngameMenu; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; 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.ShadyRotation; +import rosegoldaddons.utils.*; import java.awt.*; +import java.util.List; +import java.util.Random; public class EndermanMacro { + private final KeyBinding sneak = Minecraft.getMinecraft().gameSettings.keyBindSneak; + private final KeyBinding walkForward = Minecraft.getMinecraft().gameSettings.keyBindForward; + private final KeyBinding jump = Minecraft.getMinecraft().gameSettings.keyBindJump; + private final KeyBinding sprint = Minecraft.getMinecraft().gameSettings.keyBindSprint; + public static long ms = -1; private static Entity enderman; + public static int ticks = 0; + public static int pausedTicks = 0; + private boolean sneaking = false; + private boolean moving = false; + private boolean pauseMacro = false; + private boolean sold = false; + private boolean stored = false; + private boolean sentl = false; + private int totalShifts = 0; + private int mainDeb = 0; @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase == TickEvent.Phase.END) return; + if (pauseMacro) return; + ticks++; if (!Main.configFile.EndermanESP && !Main.endermanMacro) return; - if(event.phase == TickEvent.Phase.END) return; + if (ticks % Math.pow(2, Main.configFile.endermanSpeed) != 0) return; + if (Main.mc.currentScreen != null && !(Main.mc.currentScreen instanceof GuiIngameMenu) && !(Main.mc.currentScreen instanceof GuiChat)) return; + if(mainDeb != 0) return; + sold = false; + stored = false; enderman = getClosestEnderman(); - if(enderman != null && Main.endermanMacro && !ShadyRotation.running) { - ShadyRotation.smoothLook(ShadyRotation.getRotationToEntity(enderman), Main.configFile.smoothLookVelocity, () -> { - KeyBinding.setKeyBindState(Main.mc.gameSettings.keyBindSneak.getKeyCode(), true); - KeyBinding.setKeyBindState(Main.mc.gameSettings.keyBindSneak.getKeyCode(), false); + if (Main.endermanMacro && !ShadyRotation.running) { + if (enderman != null) { + ShadyRotation.smoothLook( + ShadyRotation.getRotationToEntity(enderman), + Main.configFile.smoothLookVelocity, + () -> { + if (!sneaking && totalShifts % 2 == 0) { + if(Main.mc.thePlayer.inventory.getStackInSlot(Main.mc.thePlayer.inventory.currentItem) != null) { + if(Main.configFile.endermanRC || (Main.configFile.zealotRC && enderman instanceof EntityEnderman && ((EntityEnderman) enderman).getHeldBlockState().getBlock() == Blocks.end_portal_frame)) + Main.mc.playerController.sendUseItem(Main.mc.thePlayer, Main.mc.theWorld, Main.mc.thePlayer.inventory.getStackInSlot(Main.mc.thePlayer.inventory.currentItem)); + } + if(!Main.configFile.endermanRC) KeyBinding.setKeyBindState(sneak.getKeyCode(), true); + KeyBinding.setKeyBindState(jump.getKeyCode(), true); + totalShifts++; + sneaking = true; + } + }); + } else { + KeyBinding.setKeyBindState(jump.getKeyCode(), true); + if(Main.configFile.zealotOnly) { + if(ScoreboardUtils.inLimbo) { + mainDeb = 20; + Main.mc.thePlayer.sendChatMessage("/l"); + return; + } + if(!ScoreboardUtils.inSkyblock) { + mainDeb = 20; + Main.mc.thePlayer.sendChatMessage("/play sb"); + return; + } + if (!ScoreboardUtils.inDragonNest) { + mainDeb = 20; + Main.mc.thePlayer.sendChatMessage("/warp drag"); + return; + } + } + if(Main.configFile.endermanRandom && !ShadyRotation.runningAsync) { + ShadyRotation.smoothLook( + new ShadyRotation.Rotation(new Random().nextInt(30), Main.mc.thePlayer.rotationYaw + new Random().nextInt(80)-40), + 10, + () -> {}, + true + ); + } + } + } + } - if(!Main.mc.thePlayer.movementInput.sneak) { - Main.mc.getNetHandler().addToSendQueue(new C0BPacketEntityAction(Main.mc.thePlayer, C0BPacketEntityAction.Action.START_SNEAKING)); - Main.mc.thePlayer.movementInput.sneak = true; + @SubscribeEvent + public void movementControl(TickEvent.ClientTickEvent event) { +