diff --git a/src/main/java/net/shadow/client/CoffeeClientMain.java b/src/main/java/net/shadow/client/ShadowMain.java similarity index 98% rename from src/main/java/net/shadow/client/CoffeeClientMain.java rename to src/main/java/net/shadow/client/ShadowMain.java index f97fdc1..714e842 100644 --- a/src/main/java/net/shadow/client/CoffeeClientMain.java +++ b/src/main/java/net/shadow/client/ShadowMain.java @@ -28,7 +28,7 @@ import java.util.ArrayList; import java.util.List; @SuppressWarnings("ResultOfMethodCallIgnored") -public class CoffeeClientMain implements ModInitializer { +public class ShadowMain implements ModInitializer { public static final String MOD_ID = "sipoverprivate"; public static final String MOD_NAME = "SipoverPrivate"; @@ -37,7 +37,7 @@ public class CoffeeClientMain implements ModInitializer { public static final File BASE = new File(MinecraftClient.getInstance().runDirectory, "sip"); public static final List<ResourceEntry> resources = new ArrayList<>(); public static long lastScreenChange = System.currentTimeMillis(); - public static CoffeeClientMain INSTANCE; + public static ShadowMain INSTANCE; public static Thread MODULE_FTTICKER; public static Thread FAST_TICKER; public static String sessionKey = null; diff --git a/src/main/java/net/shadow/client/feature/command/impl/Bind.java b/src/main/java/net/shadow/client/feature/command/impl/Bind.java index f849b0d..ac50871 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Bind.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Bind.java @@ -1,6 +1,6 @@ package net.shadow.client.feature.command.impl; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.feature.gui.screen.BindScreen; import net.shadow.client.feature.module.Module; @@ -33,6 +33,6 @@ public class Bind extends Command { return; } BindScreen bs = new BindScreen(module); - Utils.TickManager.runInNTicks(5, () -> CoffeeClientMain.client.setScreen(bs)); + Utils.TickManager.runInNTicks(5, () -> ShadowMain.client.setScreen(bs)); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/ConfigUtils.java b/src/main/java/net/shadow/client/feature/command/impl/ConfigUtils.java index 7713739..4221624 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/ConfigUtils.java +++ b/src/main/java/net/shadow/client/feature/command/impl/ConfigUtils.java @@ -11,7 +11,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import net.minecraft.text.*; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.feature.config.SettingBase; import net.shadow.client.feature.module.Module; @@ -25,7 +25,7 @@ import java.util.List; import java.util.Objects; public class ConfigUtils extends Command { - static final File CONFIG_STORAGE = new File(CoffeeClientMain.BASE, "configs"); + static final File CONFIG_STORAGE = new File(ShadowMain.BASE, "configs"); @SuppressWarnings("ResultOfMethodCallIgnored") public ConfigUtils() { @@ -164,7 +164,7 @@ public class ConfigUtils extends Command { Style s = Style.EMPTY.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("Click to open"))) .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, out.getAbsolutePath())); t.setStyle(s); - Objects.requireNonNull(CoffeeClientMain.client.player).sendMessage(t, false); + Objects.requireNonNull(ShadowMain.client.player).sendMessage(t, false); } catch (Exception e) { error("Couldn't save config: " + e.getLocalizedMessage()); } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Effect.java b/src/main/java/net/shadow/client/feature/command/impl/Effect.java index 6011170..8098d5e 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Effect.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Effect.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.util.Utils; @@ -33,7 +33,7 @@ public class Effect extends Command { @Override public void onExecute(String[] args) { - if (CoffeeClientMain.client.player == null) { + if (ShadowMain.client.player == null) { return; } if (args.length == 0) { @@ -59,11 +59,11 @@ public class Effect extends Command { return; } StatusEffectInstance inst = new StatusEffectInstance(effect, duration, strength); - CoffeeClientMain.client.player.addStatusEffect(inst); + ShadowMain.client.player.addStatusEffect(inst); } case "clear" -> { - for (StatusEffectInstance statusEffect : CoffeeClientMain.client.player.getStatusEffects().toArray(new StatusEffectInstance[0])) { - CoffeeClientMain.client.player.removeStatusEffect(statusEffect.getEffectType()); + for (StatusEffectInstance statusEffect : ShadowMain.client.player.getStatusEffects().toArray(new StatusEffectInstance[0])) { + ShadowMain.client.player.removeStatusEffect(statusEffect.getEffectType()); } } default -> error("\"give\" and \"clear\" only pls"); diff --git a/src/main/java/net/shadow/client/feature/command/impl/FakeItem.java b/src/main/java/net/shadow/client/feature/command/impl/FakeItem.java index f861037..cf1c2fc 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/FakeItem.java +++ b/src/main/java/net/shadow/client/feature/command/impl/FakeItem.java @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.StringNbtReader; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Arrays; @@ -24,7 +24,7 @@ public class FakeItem extends Command { @Override public String[] getSuggestions(String fullCommand, String[] args) { if (args.length == 1) { - return Objects.requireNonNull(CoffeeClientMain.client.world).getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).toList().toArray(String[]::new); + return Objects.requireNonNull(ShadowMain.client.world).getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).toList().toArray(String[]::new); } else if (args.length == 2) { return new String[]{"hand", "custom:(item id) [item nbt]"}; } else if (args.length == 3 && args[1].toLowerCase().startsWith("custom:")) { @@ -51,7 +51,7 @@ public class FakeItem extends Command { nameTarget = args[0]; } PlayerEntity le = null; - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (entity instanceof PlayerEntity le1) { if (u != null && entity.getUuid().equals(u)) { le = le1; @@ -65,7 +65,7 @@ public class FakeItem extends Command { return; } if (args[1].equalsIgnoreCase("hand")) { - ItemStack main = Objects.requireNonNull(CoffeeClientMain.client.player).getMainHandStack().copy(); + ItemStack main = Objects.requireNonNull(ShadowMain.client.player).getMainHandStack().copy(); if (main.isEmpty()) { error("You're not holding anything"); return; diff --git a/src/main/java/net/shadow/client/feature/command/impl/Find.java b/src/main/java/net/shadow/client/feature/command/impl/Find.java index 4f60ba2..3cb35d2 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Find.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Find.java @@ -13,7 +13,7 @@ import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket; import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; import net.minecraft.util.Hand; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; @@ -40,8 +40,8 @@ public class Find extends Command { }); Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> { // this also functions as a tick thing so eh if (pendingBook && bookSlot != -1) { - assert CoffeeClientMain.client.player != null; - CoffeeClientMain.client.player.getInventory().selectedSlot = bookSlot; + assert ShadowMain.client.player != null; + ShadowMain.client.player.getInventory().selectedSlot = bookSlot; } }); } @@ -53,8 +53,8 @@ public class Find extends Command { sent2nd = true; return; } - assert CoffeeClientMain.client.player != null; - ItemStack current = CoffeeClientMain.client.player.getInventory().getMainHandStack(); + assert ShadowMain.client.player != null; + ItemStack current = ShadowMain.client.player.getInventory().getMainHandStack(); NbtCompound c = current.getOrCreateNbt(); if (c.contains("pages", NbtCompound.LIST_TYPE)) { NbtList l = c.getList("pages", NbtCompound.STRING_TYPE); @@ -64,7 +64,7 @@ public class Find extends Command { if (root.get("text") == null || root.get("text").getAsString().isEmpty()) { error("Couldn't find player, is the dude online?"); CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(pack3); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(pack3); pendingBook = sent2nd = false; bookSlot = -1; pe.setCancelled(true); @@ -80,14 +80,14 @@ public class Find extends Command { } else { error("Couldn't find player, is the dude online?"); CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(pack3); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(pack3); pendingBook = sent2nd = false; bookSlot = -1; } pe.setCancelled(true); } else if (pe.getPacket() instanceof ScreenHandlerSlotUpdateS2CPacket packet) { if (packet.getItemStack().getItem() == Items.WRITTEN_BOOK) { - Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND))); + Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND))); } } } @@ -102,7 +102,7 @@ public class Find extends Command { @Override public void onExecute(String[] args) { - if (!Objects.requireNonNull(CoffeeClientMain.client.interactionManager).hasCreativeInventory()) { + if (!Objects.requireNonNull(ShadowMain.client.interactionManager).hasCreativeInventory()) { error("Cant find the player, need GMC"); return; } @@ -112,13 +112,13 @@ public class Find extends Command { return; } try { - assert CoffeeClientMain.client.player != null; - String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + u + "\\\"}\"],title:\"0\",author:\"" + CoffeeClientMain.client.player.getGameProfile().getName() + "\"}"; + assert ShadowMain.client.player != null; + String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + u + "\\\"}\"],title:\"0\",author:\"" + ShadowMain.client.player.getGameProfile().getName() + "\"}"; ItemStack s = Utils.generateItemStackWithMeta(n, Items.WRITTEN_BOOK); pendingBook = true; - bookSlot = CoffeeClientMain.client.player.getInventory().selectedSlot; - CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), s); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(a); + bookSlot = ShadowMain.client.player.getInventory().selectedSlot; + CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), s); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(a); message("Finding player coords..."); } catch (Exception ignored) { error("UUID invalid"); diff --git a/src/main/java/net/shadow/client/feature/command/impl/ForEach.java b/src/main/java/net/shadow/client/feature/command/impl/ForEach.java index 04feb82..39e5d21 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/ForEach.java +++ b/src/main/java/net/shadow/client/feature/command/impl/ForEach.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.client.network.PlayerListEntry; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.util.Utils; @@ -47,12 +47,12 @@ public class ForEach extends Command { return; } message("Sending the message for every person in the player list, with " + delay + "ms delay"); - for (PlayerListEntry playerListEntry : Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).getPlayerList()) { + for (PlayerListEntry playerListEntry : Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).getPlayerList()) { if (Utils.Players.isPlayerNameValid(playerListEntry.getProfile().getName()) && !playerListEntry.getProfile().getId() - .equals(Objects.requireNonNull(CoffeeClientMain.client.player).getUuid())) { + .equals(Objects.requireNonNull(ShadowMain.client.player).getUuid())) { runner.execute(() -> { try { - CoffeeClientMain.client.player.sendChatMessage(String.join(" ", Arrays.copyOfRange(args, 1, args.length)).replaceAll("%s", playerListEntry.getProfile().getName())); + ShadowMain.client.player.sendChatMessage(String.join(" ", Arrays.copyOfRange(args, 1, args.length)).replaceAll("%s", playerListEntry.getProfile().getName())); Thread.sleep(delay); } catch (Exception ignored) { } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Gamemode.java b/src/main/java/net/shadow/client/feature/command/impl/Gamemode.java index f9a0e88..4b53650 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Gamemode.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Gamemode.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.world.GameMode; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Arrays; @@ -27,14 +27,14 @@ public class Gamemode extends Command { @Override public void onExecute(String[] args) { - if (CoffeeClientMain.client.interactionManager == null) { + if (ShadowMain.client.interactionManager == null) { return; } if (args.length == 0) { message("gamemode pls"); } else { GameMode gm = GameMode.byName(args[0]); - CoffeeClientMain.client.interactionManager.setGameMode(gm); + ShadowMain.client.interactionManager.setGameMode(gm); } } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Hologram.java b/src/main/java/net/shadow/client/feature/command/impl/Hologram.java index e937375..c116bbd 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Hologram.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Hologram.java @@ -8,7 +8,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.manager.HologramManager; @@ -66,8 +66,8 @@ public class Hologram extends Command { } } String text = String.join(" ", Arrays.copyOfRange(args, 1, args.length)); - Vec3d pos = Objects.requireNonNull(CoffeeClientMain.client.player).getPos(); - BlockPos displayable = CoffeeClientMain.client.player.getBlockPos(); + Vec3d pos = Objects.requireNonNull(ShadowMain.client.player).getPos(); + BlockPos displayable = ShadowMain.client.player.getBlockPos(); message("Armor stand config:"); message(" Text: " + text); message(" Is baby: " + (generateAsBaby ? "Yes" : "No")); @@ -79,6 +79,6 @@ public class Hologram extends Command { HologramManager.Hologram h = HologramManager.generateDefault(text, pos).isEgg(generateAsEgg).isSmall(generateAsBaby).hasGravity(makeGravity).isVisible(makeVisible).isMarker(marker); ItemStack stack = h.generate(); message("Dont forget to open your inventory before placing"); - CoffeeClientMain.client.player.getInventory().addPickBlock(stack); + ShadowMain.client.player.getInventory().addPickBlock(stack); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Inject.java b/src/main/java/net/shadow/client/feature/command/impl/Inject.java index 9aac675..b4a33f0 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Inject.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Inject.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.StringNbtReader; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Arrays; @@ -32,11 +32,11 @@ public class Inject extends Command { error("Syntax: inj [set, clear, add] (nbt)"); return; } - if (!CoffeeClientMain.client.interactionManager.hasCreativeInventory()) { + if (!ShadowMain.client.interactionManager.hasCreativeInventory()) { error("no creative mode? :megamind:"); return; } - ItemStack is = CoffeeClientMain.client.player.getInventory().getMainHandStack(); + ItemStack is = ShadowMain.client.player.getInventory().getMainHandStack(); if (is.isEmpty()) { error("hold and item shithead"); return; diff --git a/src/main/java/net/shadow/client/feature/command/impl/Invsee.java b/src/main/java/net/shadow/client/feature/command/impl/Invsee.java index 7da1cbd..fcb5fb9 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Invsee.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Invsee.java @@ -8,7 +8,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.client.gui.screen.ingame.InventoryScreen; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.util.Utils; @@ -23,7 +23,7 @@ public class Invsee extends Command { @Override public String[] getSuggestions(String fullCommand, String[] args) { if (args.length == 1) { - return Objects.requireNonNull(CoffeeClientMain.client.world).getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).toList().toArray(String[]::new); + return Objects.requireNonNull(ShadowMain.client.world).getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).toList().toArray(String[]::new); } return super.getSuggestions(fullCommand, args); } @@ -35,7 +35,7 @@ public class Invsee extends Command { return; } PlayerEntity t = null; - for (Entity player : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity player : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (player instanceof PlayerEntity player1) { if (player1.getGameProfile().getName().equalsIgnoreCase(args[0])) { t = player1; @@ -48,6 +48,6 @@ public class Invsee extends Command { return; } PlayerEntity finalT = t; - Utils.TickManager.runOnNextRender(() -> CoffeeClientMain.client.setScreen(new InventoryScreen(finalT))); + Utils.TickManager.runOnNextRender(() -> ShadowMain.client.setScreen(new InventoryScreen(finalT))); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/ItemExploit.java b/src/main/java/net/shadow/client/feature/command/impl/ItemExploit.java index 84d136b..450393f 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/ItemExploit.java +++ b/src/main/java/net/shadow/client/feature/command/impl/ItemExploit.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.command.impl; import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.internal.ReflectionException; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.feature.items.Item; import net.shadow.client.feature.items.ItemRegistry; @@ -48,7 +48,7 @@ public class ItemExploit extends Command { error("Need an exploit name"); return; } - if (!CoffeeClientMain.client.interactionManager.hasCreativeInventory()) { + if (!ShadowMain.client.interactionManager.hasCreativeInventory()) { error("No creative inventory present - can't generate"); return; } @@ -129,6 +129,6 @@ public class ItemExploit extends Command { } } // I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT I HATE MULTICONNECT - CoffeeClientMain.client.interactionManager.clickCreativeStack(meant.generate(), Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot)); + ShadowMain.client.interactionManager.clickCreativeStack(meant.generate(), Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot)); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Kickall.java b/src/main/java/net/shadow/client/feature/command/impl/Kickall.java index 82a8ded..66cb1ee 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Kickall.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Kickall.java @@ -8,7 +8,7 @@ import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket; import net.minecraft.network.packet.s2c.login.*; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.net.InetSocketAddress; @@ -20,12 +20,12 @@ public class Kickall extends Command { @Override public void onExecute(String[] args) { - InetSocketAddress sa = (InetSocketAddress) CoffeeClientMain.client.getNetworkHandler().getConnection().getAddress(); - for (PlayerListEntry playerListEntry : CoffeeClientMain.client.getNetworkHandler().getPlayerList()) { - if (playerListEntry.getProfile().equals(CoffeeClientMain.client.player.getGameProfile())) { + InetSocketAddress sa = (InetSocketAddress) ShadowMain.client.getNetworkHandler().getConnection().getAddress(); + for (PlayerListEntry playerListEntry : ShadowMain.client.getNetworkHandler().getPlayerList()) { + if (playerListEntry.getProfile().equals(ShadowMain.client.player.getGameProfile())) { continue; } - ClientConnection conn = ClientConnection.connect(sa, CoffeeClientMain.client.options.shouldUseNativeTransport()); + ClientConnection conn = ClientConnection.connect(sa, ShadowMain.client.options.shouldUseNativeTransport()); conn.setPacketListener(new ClientLoginPacketListener() { @Override public void onHello(LoginHelloS2CPacket packet) { diff --git a/src/main/java/net/shadow/client/feature/command/impl/Kill.java b/src/main/java/net/shadow/client/feature/command/impl/Kill.java index 03f7413..7dea8a6 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Kill.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Kill.java @@ -26,7 +26,7 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; @@ -55,8 +55,8 @@ public class Kill extends Command { }); Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> { // this also functions as a tick thing so eh if (pendingBook && bookSlot != -1) { - assert CoffeeClientMain.client.player != null; - CoffeeClientMain.client.player.getInventory().selectedSlot = bookSlot; + assert ShadowMain.client.player != null; + ShadowMain.client.player.getInventory().selectedSlot = bookSlot; } }); } @@ -76,8 +76,8 @@ public class Kill extends Command { sent2nd = true; return; } - assert CoffeeClientMain.client.player != null; - ItemStack current = CoffeeClientMain.client.player.getInventory().getMainHandStack(); + assert ShadowMain.client.player != null; + ItemStack current = ShadowMain.client.player.getInventory().getMainHandStack(); NbtCompound c = current.getOrCreateNbt(); if (c.contains("pages", NbtCompound.LIST_TYPE)) { NbtList l = c.getList("pages", NbtCompound.STRING_TYPE); @@ -87,7 +87,7 @@ public class Kill extends Command { if (root.get("text") == null || root.get("text").getAsString().isEmpty()) { error("Couldn't find player, is the dude online?"); CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(pack3); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(pack3); pendingBook = sent2nd = false; bookSlot = -1; pe.setCancelled(true); @@ -100,18 +100,18 @@ public class Kill extends Command { pendingBook = sent2nd = false; bookSlot = -1; success(String.format("Player's at X=%s,Y=%s,Z=%s, sending funny", Utils.Math.roundToDecimal(target.x, 1), Utils.Math.roundToDecimal(target.y, 1), Utils.Math.roundToDecimal(target.z, 1))); - makeKillPotAt(new BlockHitResult(CoffeeClientMain.client.player.getPos(), Direction.DOWN, new BlockPos(CoffeeClientMain.client.player.getPos()), false), target); + makeKillPotAt(new BlockHitResult(ShadowMain.client.player.getPos(), Direction.DOWN, new BlockPos(ShadowMain.client.player.getPos()), false), target); } else { error("Couldn't find player, is the dude online?"); CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(pack3); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(pack3); pendingBook = sent2nd = false; bookSlot = -1; } pe.setCancelled(true); } else if (pe.getPacket() instanceof ScreenHandlerSlotUpdateS2CPacket packet) { if (packet.getItemStack().getItem() == Items.WRITTEN_BOOK) { - Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND))); + Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND))); } } } @@ -119,13 +119,13 @@ public class Kill extends Command { void makeKillPotAt(BlockHitResult bhr, Vec3d target) { target = target.add(0, 2.7, 0); ItemStack s = Utils.generateItemStackWithMeta("{data: [], palette: [], EntityTag: {Item: {Count: 1b, id: \"minecraft:splash_potion\", tag: {CustomPotionEffects: [{ShowParticles: 1b, Duration: 20, Id: 6b, Amplifier: 125b}], Potion: \"minecraft:awkward\"}}, Pos: [" + target.x + "d, " + target.y + "d, " + target.z + "d], Motion: [0d,-5d,0d], id: \"minecraft:potion\", LeftOwner: 1b}}", Items.BAT_SPAWN_EGG); - assert CoffeeClientMain.client.player != null; - CreativeInventoryActionC2SPacket pack = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), s); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(pack); + assert ShadowMain.client.player != null; + CreativeInventoryActionC2SPacket pack = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), s); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(pack); PlayerInteractBlockC2SPacket pack2 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - CoffeeClientMain.client.getNetworkHandler().sendPacket(pack2); - CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), new ItemStack(Items.AIR)); - CoffeeClientMain.client.getNetworkHandler().sendPacket(pack3); + ShadowMain.client.getNetworkHandler().sendPacket(pack2); + CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), new ItemStack(Items.AIR)); + ShadowMain.client.getNetworkHandler().sendPacket(pack3); } @Override @@ -134,23 +134,23 @@ public class Kill extends Command { error("Cant kill no one"); return; } - assert CoffeeClientMain.client.interactionManager != null; - if (!CoffeeClientMain.client.interactionManager.hasCreativeInventory()) { + assert ShadowMain.client.interactionManager != null; + if (!ShadowMain.client.interactionManager.hasCreativeInventory()) { error("I cant give you a kill pot because you dont have a creative inv"); return; } if (args[0].equals("*")) { message("Killing everyone in render distance"); - assert CoffeeClientMain.client.world != null; - for (AbstractClientPlayerEntity player : CoffeeClientMain.client.world.getPlayers()) { - if (player.equals(CoffeeClientMain.client.player)) { + assert ShadowMain.client.world != null; + for (AbstractClientPlayerEntity player : ShadowMain.client.world.getPlayers()) { + if (player.equals(ShadowMain.client.player)) { continue; } onExecute(new String[]{player.getGameProfile().getName()}); } return; } - HitResult hr = CoffeeClientMain.client.crosshairTarget; + HitResult hr = ShadowMain.client.crosshairTarget; assert hr != null; BlockHitResult bhr; if (!(hr instanceof BlockHitResult bhr1)) { @@ -166,21 +166,21 @@ public class Kill extends Command { String uuidP = user.substring(1); try { UUID resolved = UUID.fromString(uuidP); - assert CoffeeClientMain.client.player != null; - String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + resolved + "\\\"}\"],title:\"0\",author:\"" + CoffeeClientMain.client.player.getGameProfile().getName() + "\"}"; + assert ShadowMain.client.player != null; + String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + resolved + "\\\"}\"],title:\"0\",author:\"" + ShadowMain.client.player.getGameProfile().getName() + "\"}"; ItemStack s = Utils.generateItemStackWithMeta(n, Items.WRITTEN_BOOK); pendingBook = true; - bookSlot = CoffeeClientMain.client.player.getInventory().selectedSlot; - CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), s); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(a); + bookSlot = ShadowMain.client.player.getInventory().selectedSlot; + CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), s); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(a); message("Finding player coords..."); } catch (Exception ignored) { error("UUID invalid"); } return; } else { - assert CoffeeClientMain.client.world != null; - for (Entity entity : CoffeeClientMain.client.world.getEntities()) { + assert ShadowMain.client.world != null; + for (Entity entity : ShadowMain.client.world.getEntities()) { if (entity instanceof PlayerEntity pe && pe.getGameProfile().getName().toLowerCase().contains(user.toLowerCase())) { if (pe.getGameProfile().getName().equalsIgnoreCase(user)) { // direct match, we know who we want to fuck targets.clear(); diff --git a/src/main/java/net/shadow/client/feature/command/impl/Panic.java b/src/main/java/net/shadow/client/feature/command/impl/Panic.java index 4e27e56..930b165 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Panic.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Panic.java @@ -5,7 +5,7 @@ package net.shadow.client.feature.command.impl; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleRegistry; @@ -51,7 +51,7 @@ public class Panic extends Command { module.setEnabled(false); } } - CoffeeClientMain.client.inGameHud.getChatHud().clear(true); + ShadowMain.client.inGameHud.getChatHud().clear(true); } else if (args[0].equalsIgnoreCase("restore")) { if (stored.size() == 0) { error("The stored module list is empty"); diff --git a/src/main/java/net/shadow/client/feature/command/impl/Plugins.java b/src/main/java/net/shadow/client/feature/command/impl/Plugins.java index 863fcfe..d4f05ae 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Plugins.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Plugins.java @@ -9,7 +9,7 @@ import com.mojang.brigadier.suggestion.Suggestion; import com.mojang.brigadier.suggestion.Suggestions; import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket; import net.minecraft.network.packet.s2c.play.CommandSuggestionsS2CPacket; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; @@ -25,7 +25,7 @@ public class Plugins extends Command { public Plugins() { super("Plugins", "Finds server plugins via command suggestions", "pl", "plugins"); - if (CoffeeClientMain.client.getNetworkHandler() != null) { + if (ShadowMain.client.getNetworkHandler() != null) { Events.registerEventHandler(EventType.PACKET_RECEIVE, event -> { if (!pendingCmdTree) { return; @@ -59,8 +59,8 @@ public class Plugins extends Command { @Override public void onExecute(String[] args) { - if (CoffeeClientMain.client.getNetworkHandler() != null) { - CoffeeClientMain.client.getNetworkHandler().sendPacket(new RequestCommandCompletionsC2SPacket(0, "/")); + if (ShadowMain.client.getNetworkHandler() != null) { + ShadowMain.client.getNetworkHandler().sendPacket(new RequestCommandCompletionsC2SPacket(0, "/")); pendingCmdTree = true; } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Rename.java b/src/main/java/net/shadow/client/feature/command/impl/Rename.java index e1412f6..68e74ea 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Rename.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Rename.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Objects; @@ -32,10 +32,10 @@ public class Rename extends Command { error("example: rename &c<he &afunny"); return; } - if (Objects.requireNonNull(CoffeeClientMain.client.player).getInventory().getMainHandStack().isEmpty()) { + if (Objects.requireNonNull(ShadowMain.client.player).getInventory().getMainHandStack().isEmpty()) { error("idk if you're holding anything"); return; } - CoffeeClientMain.client.player.getInventory().getMainHandStack().setCustomName(Text.of("§r" + String.join(" ", args).replaceAll("&", "§"))); + ShadowMain.client.player.getInventory().getMainHandStack().setCustomName(Text.of("§r" + String.join(" ", args).replaceAll("&", "§"))); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Say.java b/src/main/java/net/shadow/client/feature/command/impl/Say.java index 334abcf..5881b01 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Say.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Say.java @@ -5,7 +5,7 @@ package net.shadow.client.feature.command.impl; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Objects; @@ -30,6 +30,6 @@ public class Say extends Command { error("not sure if i can say nothing"); return; } - Objects.requireNonNull(CoffeeClientMain.client.player).sendChatMessage(String.join(" ", args)); + Objects.requireNonNull(ShadowMain.client.player).sendChatMessage(String.join(" ", args)); } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Taco.java b/src/main/java/net/shadow/client/feature/command/impl/Taco.java index c504033..a1016b7 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Taco.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Taco.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.command.impl; import com.google.gson.Gson; import net.minecraft.client.texture.NativeImage; import net.minecraft.client.texture.NativeImageBackedTexture; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.helper.Texture; import net.shadow.client.helper.event.EventType; @@ -26,10 +26,10 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; public class Taco extends Command { - public static final File storage = new File(CoffeeClientMain.BASE, "taco.sip"); + public static final File storage = new File(ShadowMain.BASE, "taco.sip"); public static final List<Frame> frames = new ArrayList<>(); public static final AtomicBoolean init = new AtomicBoolean(false); - static final File gifPath = new File(CoffeeClientMain.BASE, "tacoFrames"); + static final File gifPath = new File(ShadowMain.BASE, "tacoFrames"); public static TacoConfig config = new TacoConfig(); public static long currentFrame = 0; static final Thread ticker = new Thread(() -> { @@ -71,7 +71,7 @@ public class Taco extends Command { if (!storage.exists()) { //noinspection ResultOfMethodCallIgnored storage.createNewFile(); - CoffeeClientMain.log(Level.INFO, "Skipping taco config file because it doesnt exist"); + ShadowMain.log(Level.INFO, "Skipping taco config file because it doesnt exist"); return; } String a = FileUtils.readFileToString(storage, StandardCharsets.UTF_8); @@ -82,7 +82,7 @@ public class Taco extends Command { } initFrames(); } catch (Exception e) { - CoffeeClientMain.log(Level.ERROR, "Failed to read taco config"); + ShadowMain.log(Level.ERROR, "Failed to read taco config"); e.printStackTrace(); if (storage.exists()) { //noinspection ResultOfMethodCallIgnored @@ -94,7 +94,7 @@ public class Taco extends Command { static void initFrames() throws Exception { checkGifPath(); for (Frame frame : frames) { - CoffeeClientMain.client.getTextureManager().destroyTexture(frame.getI()); + ShadowMain.client.getTextureManager().destroyTexture(frame.getI()); } frames.clear(); Frame.frameCounter = 0; @@ -124,7 +124,7 @@ public class Taco extends Command { try { FileUtils.writeStringToFile(storage, json, StandardCharsets.UTF_8); } catch (Exception e) { - CoffeeClientMain.log(Level.ERROR, "Failed to write taco config"); + ShadowMain.log(Level.ERROR, "Failed to write taco config"); e.printStackTrace(); } } @@ -250,7 +250,7 @@ public class Taco extends Command { // i = new Identifier("atomic", "tacoframe_" + frameCounter); i = new Texture("taco/frame_" + frameCounter); frameCounter++; - CoffeeClientMain.client.execute(() -> CoffeeClientMain.client.getTextureManager().registerTexture(i, tex)); + ShadowMain.client.execute(() -> ShadowMain.client.getTextureManager().registerTexture(i, tex)); } catch (Exception e) { Utils.Logging.error("failed to register frame " + frameCounter); e.printStackTrace(); diff --git a/src/main/java/net/shadow/client/feature/command/impl/ViewNbt.java b/src/main/java/net/shadow/client/feature/command/impl/ViewNbt.java index f88fbb6..264b727 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/ViewNbt.java +++ b/src/main/java/net/shadow/client/feature/command/impl/ViewNbt.java @@ -8,7 +8,7 @@ package net.shadow.client.feature.command.impl; import net.minecraft.item.ItemStack; import net.minecraft.nbt.*; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import java.util.Objects; @@ -60,11 +60,11 @@ public class ViewNbt extends Command { } } } - if (Objects.requireNonNull(CoffeeClientMain.client.player).getInventory().getMainHandStack().isEmpty()) { + if (Objects.requireNonNull(ShadowMain.client.player).getInventory().getMainHandStack().isEmpty()) { error("you're not holding anything"); return; } - ItemStack stack = CoffeeClientMain.client.player.getInventory().getMainHandStack(); + ItemStack stack = ShadowMain.client.player.getInventory().getMainHandStack(); NbtCompound c = stack.getNbt(); if (!stack.hasNbt() || c == null) { error("stack has no data"); @@ -75,13 +75,13 @@ public class ViewNbt extends Command { } else { // I've to use .sendMessage because of monkey minecraft api if (noColor) { - CoffeeClientMain.client.player.sendMessage(Text.of(c.asString()), false); + ShadowMain.client.player.sendMessage(Text.of(c.asString()), false); } else { - CoffeeClientMain.client.player.sendMessage(NbtHelper.toPrettyPrintedText(c), false); + ShadowMain.client.player.sendMessage(NbtHelper.toPrettyPrintedText(c), false); } } if (copy) { - CoffeeClientMain.client.keyboard.setClipboard(c.asString()); + ShadowMain.client.keyboard.setClipboard(c.asString()); success("Copied nbt!"); } } diff --git a/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java b/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java index 332aad7..f08c171 100644 --- a/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java +++ b/src/main/java/net/shadow/client/feature/gui/clickgui/ClickGUI.java @@ -6,7 +6,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec2f; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.feature.gui.clickgui.element.Element; import net.shadow.client.feature.gui.clickgui.element.impl.CategoryDisplay; @@ -89,7 +89,7 @@ public class ClickGUI extends Screen implements FastTickable { void initElements() { elements.clear(); - double width = CoffeeClientMain.client.getWindow().getScaledWidth(); + double width = ShadowMain.client.getWindow().getScaledWidth(); double x = 5; double y = 5; double tallestInTheRoom = 0; @@ -158,8 +158,8 @@ public class ClickGUI extends Screen implements FastTickable { for (String s : text) { width = Math.max(width, FontRenderers.getRenderer().getStringWidth(s)); } - if (descX + width > CoffeeClientMain.client.getWindow().getScaledWidth()) { - descX -= (descX + width - CoffeeClientMain.client.getWindow().getScaledWidth()) + 4; + if (descX + width > ShadowMain.client.getWindow().getScaledWidth()) { + descX -= (descX + width - ShadowMain.client.getWindow().getScaledWidth()) + 4; } Vec2f root = Renderer.R2D.renderTooltip(matrices, descX, descY, width + 4, FontRenderers.getRenderer().getMarginHeight() + 4, tooltipColor); float yOffset = 2; diff --git a/src/main/java/net/shadow/client/feature/gui/clickgui/ParticleRenderer.java b/src/main/java/net/shadow/client/feature/gui/clickgui/ParticleRenderer.java index 1debb4a..dfaef6e 100644 --- a/src/main/java/net/shadow/client/feature/gui/clickgui/ParticleRenderer.java +++ b/src/main/java/net/shadow/client/feature/gui/clickgui/ParticleRenderer.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Matrix4f; import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.clickgui.theme.Theme; import net.shadow.client.feature.gui.clickgui.theme.ThemeManager; import net.shadow.client.helper.render.Renderer; @@ -36,7 +36,7 @@ public class ParticleRenderer { return; } Particle n = new Particle(); - n.x = Math.random() * CoffeeClientMain.client.getWindow().getScaledWidth(); + n.x = Math.random() * ShadowMain.client.getWindow().getScaledWidth(); n.y = -10; n.velY = (Math.random() + 1); n.decline = MathHelper.lerp(Math.random(), 0.05, 0.2); diff --git a/src/main/java/net/shadow/client/feature/gui/hud/HudRenderer.java b/src/main/java/net/shadow/client/feature/gui/hud/HudRenderer.java index 3463498..9d8d3af 100644 --- a/src/main/java/net/shadow/client/feature/gui/hud/HudRenderer.java +++ b/src/main/java/net/shadow/client/feature/gui/hud/HudRenderer.java @@ -5,7 +5,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import net.minecraft.client.gui.screen.ChatScreen; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.hud.element.HudElement; import net.shadow.client.feature.gui.hud.element.SpeedHud; import net.shadow.client.feature.gui.hud.element.Taco; @@ -24,15 +24,15 @@ import java.util.List; public class HudRenderer { - static final File CONFIG = new File(CoffeeClientMain.BASE, "hud.sip"); + static final File CONFIG = new File(ShadowMain.BASE, "hud.sip"); private static HudRenderer INSTANCE; final List<HudElement> elements = register(); boolean isEditing = false; boolean mouseHeldDown = false; double prevX = Utils.Mouse.getMouseX(); double prevY = Utils.Mouse.getMouseY(); - double prevWX = CoffeeClientMain.client.getWindow().getScaledWidth(); - double prevWY = CoffeeClientMain.client.getWindow().getScaledHeight(); + double prevWX = ShadowMain.client.getWindow().getScaledWidth(); + double prevWY = ShadowMain.client.getWindow().getScaledHeight(); private HudRenderer() { Events.registerEventHandler(EventType.MOUSE_EVENT, event -> { @@ -76,7 +76,7 @@ public class HudRenderer { } void saveConfig() { - CoffeeClientMain.log(Level.INFO, "Saving hud"); + ShadowMain.log(Level.INFO, "Saving hud"); JsonArray root = new JsonArray(); for (HudElement element : elements) { JsonObject current = new JsonObject(); @@ -88,18 +88,18 @@ public class HudRenderer { try { FileUtils.write(CONFIG, root.toString(), StandardCharsets.UTF_8); } catch (Exception ignored) { - CoffeeClientMain.log(Level.ERROR, "Failed to write hud file"); + ShadowMain.log(Level.ERROR, "Failed to write hud file"); } } @SuppressWarnings("ResultOfMethodCallIgnored") void loadConfig() { - CoffeeClientMain.log(Level.INFO, "Loading hud"); + ShadowMain.log(Level.INFO, "Loading hud"); if (!CONFIG.isFile()) { CONFIG.delete(); } if (!CONFIG.exists()) { - CoffeeClientMain.log(Level.INFO, "Skipping hud loading because file doesn't exist"); + ShadowMain.log(Level.INFO, "Skipping hud loading because file doesn't exist"); return; } try { @@ -118,14 +118,14 @@ public class HudRenderer { } } } catch (Exception ignored) { - CoffeeClientMain.log(Level.ERROR, "Failed to read hud file - corrupted?"); + ShadowMain.log(Level.ERROR, "Failed to read hud file - corrupted?"); } - CoffeeClientMain.log(Level.INFO, "Loaded hud"); + ShadowMain.log(Level.INFO, "Loaded hud"); } public void fastTick() { - double currentWX = CoffeeClientMain.client.getWindow().getScaledWidth(); - double currentWY = CoffeeClientMain.client.getWindow().getScaledHeight(); + double currentWX = ShadowMain.client.getWindow().getScaledWidth(); + double currentWY = ShadowMain.client.getWindow().getScaledHeight(); if (currentWX != prevWX) { for (HudElement element : elements) { double px = element.getPosX(); @@ -142,7 +142,7 @@ public class HudRenderer { } prevWY = currentWY; } - isEditing = CoffeeClientMain.client.currentScreen instanceof ChatScreen; + isEditing = ShadowMain.client.currentScreen instanceof ChatScreen; if (mouseHeldDown) { for (HudElement element : elements) { element.mouseDragged(Utils.Mouse.getMouseX() - prevX, Utils.Mouse.getMouseY() - prevY); diff --git a/src/main/java/net/shadow/client/feature/gui/hud/element/HudElement.java b/src/main/java/net/shadow/client/feature/gui/hud/element/HudElement.java index fdfe594..7dd7c73 100644 --- a/src/main/java/net/shadow/client/feature/gui/hud/element/HudElement.java +++ b/src/main/java/net/shadow/client/feature/gui/hud/element/HudElement.java @@ -2,7 +2,7 @@ package net.shadow.client.feature.gui.hud.element; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.font.FontRenderers; import net.shadow.client.helper.render.Renderer; @@ -94,8 +94,8 @@ public abstract class HudElement { if (selected) { this.posX += deltaX; this.posY += deltaY; - this.posX = MathHelper.clamp(this.posX, 0, CoffeeClientMain.client.getWindow().getScaledWidth() - this.width); - this.posY = MathHelper.clamp(this.posY, 0, CoffeeClientMain.client.getWindow().getScaledHeight() - this.height); + this.posX = MathHelper.clamp(this.posX, 0, ShadowMain.client.getWindow().getScaledWidth() - this.width); + this.posY = MathHelper.clamp(this.posY, 0, ShadowMain.client.getWindow().getScaledHeight() - this.height); } } @@ -104,7 +104,7 @@ public abstract class HudElement { } public void fastTick() { - this.posX = MathHelper.clamp(this.posX, 0, CoffeeClientMain.client.getWindow().getScaledWidth() - this.width); - this.posY = MathHelper.clamp(this.posY, 0, CoffeeClientMain.client.getWindow().getScaledHeight() - this.height); + this.posX = MathHelper.clamp(this.posX, 0, ShadowMain.client.getWindow().getScaledWidth() - this.width); + this.posY = MathHelper.clamp(this.posY, 0, ShadowMain.client.getWindow().getScaledHeight() - this.height); } } diff --git a/src/main/java/net/shadow/client/feature/gui/hud/element/SpeedHud.java b/src/main/java/net/shadow/client/feature/gui/hud/element/SpeedHud.java index 410f511..cd32f3a 100644 --- a/src/main/java/net/shadow/client/feature/gui/hud/element/SpeedHud.java +++ b/src/main/java/net/shadow/client/feature/gui/hud/element/SpeedHud.java @@ -1,7 +1,7 @@ package net.shadow.client.feature.gui.hud.element; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.clickgui.theme.ThemeManager; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.render.Hud; @@ -19,7 +19,7 @@ public class SpeedHud extends HudElement { final Timer update = new Timer(); public SpeedHud() { - super("Speed", CoffeeClientMain.client.getWindow().getScaledWidth() / 2d - 160 / 2d, CoffeeClientMain.client.getWindow().getScaledHeight() - 40 - 64, 160, 64); + super("Speed", ShadowMain.client.getWindow().getScaledWidth() / 2d - 160 / 2d, ShadowMain.client.getWindow().getScaledHeight() - 40 - 64, 160, 64); } @Override @@ -59,7 +59,7 @@ public class SpeedHud extends HudElement { @Override public void fastTick() { if (update.hasExpired(50)) { // update when velocity gets updated - double speedCombined = CoffeeClientMain.client.player.getVelocity().length(); + double speedCombined = ShadowMain.client.player.getVelocity().length(); double last = speedSaved.isEmpty() ? speedCombined : speedSaved.get(speedSaved.size() - 1); speedSaved.add((speedCombined + last) / 2d); while (speedSaved.size() > 50) { diff --git a/src/main/java/net/shadow/client/feature/gui/hud/element/Taco.java b/src/main/java/net/shadow/client/feature/gui/hud/element/Taco.java index b21f0d4..8d3a35b 100644 --- a/src/main/java/net/shadow/client/feature/gui/hud/element/Taco.java +++ b/src/main/java/net/shadow/client/feature/gui/hud/element/Taco.java @@ -4,13 +4,13 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.DrawableHelper; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.Texture; import net.shadow.client.helper.font.FontRenderers; public class Taco extends HudElement { public Taco() { - super("Taco", 0, CoffeeClientMain.client.getWindow().getScaledHeight(), 100, 100); + super("Taco", 0, ShadowMain.client.getWindow().getScaledHeight(), 100, 100); } @Override diff --git a/src/main/java/net/shadow/client/feature/gui/hud/element/TargetHUD.java b/src/main/java/net/shadow/client/feature/gui/hud/element/TargetHUD.java index f904680..9810f10 100644 --- a/src/main/java/net/shadow/client/feature/gui/hud/element/TargetHUD.java +++ b/src/main/java/net/shadow/client/feature/gui/hud/element/TargetHUD.java @@ -1,7 +1,7 @@ package net.shadow.client.feature.gui.hud.element; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.render.TargetHud; import net.shadow.client.helper.render.MSAAFramebuffer; @@ -9,7 +9,7 @@ import net.shadow.client.helper.render.MSAAFramebuffer; public class TargetHUD extends HudElement { public TargetHUD() { - super("Target HUD", CoffeeClientMain.client.getWindow().getScaledWidth() / 2f + 10, CoffeeClientMain.client.getWindow() + super("Target HUD", ShadowMain.client.getWindow().getScaledWidth() / 2f + 10, ShadowMain.client.getWindow() .getScaledHeight() / 2f + 10, TargetHud.modalWidth, TargetHud.modalHeight); } diff --git a/src/main/java/net/shadow/client/feature/gui/notifications/NotificationRenderer.java b/src/main/java/net/shadow/client/feature/gui/notifications/NotificationRenderer.java index 099e3b9..5257e31 100644 --- a/src/main/java/net/shadow/client/feature/gui/notifications/NotificationRenderer.java +++ b/src/main/java/net/shadow/client/feature/gui/notifications/NotificationRenderer.java @@ -8,7 +8,7 @@ package net.shadow.client.feature.gui.notifications; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.clickgui.theme.ThemeManager; import net.shadow.client.helper.font.FontRenderers; import net.shadow.client.helper.render.ClipStack; @@ -50,7 +50,7 @@ public class NotificationRenderer { public static void renderTop() { MatrixStack ms = Renderer.R3D.getEmptyMatrixStack(); - int baseX = CoffeeClientMain.client.getWindow().getScaledWidth() / 2; + int baseX = ShadowMain.client.getWindow().getScaledWidth() / 2; int height = 16; int baseY = -height - 5; int currentYOffset = 5; @@ -116,8 +116,8 @@ public class NotificationRenderer { public static void renderSide() { MatrixStack ms = Renderer.R3D.getEmptyMatrixStack(); int currentYOffset = 0; - int baseX = CoffeeClientMain.client.getWindow().getScaledWidth(); - int baseY = CoffeeClientMain.client.getWindow().getScaledHeight() - 10; + int baseX = ShadowMain.client.getWindow().getScaledWidth(); + int baseY = ShadowMain.client.getWindow().getScaledHeight() - 10; long c = System.currentTimeMillis(); for (Notification notification : new ArrayList<>(notifications)) { boolean notificationExpired = notification.creationDate + notification.duration < c; diff --git a/src/main/java/net/shadow/client/feature/gui/screen/AltManagerScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/AltManagerScreen.java index 691816a..a331626 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/AltManagerScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/AltManagerScreen.java @@ -17,7 +17,7 @@ import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.client.util.Session; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.feature.gui.widget.RoundButton; import net.shadow.client.feature.gui.widget.RoundTextFieldWidget; @@ -55,7 +55,7 @@ import java.util.stream.Collectors; public class AltManagerScreen extends ClientScreen implements FastTickable { public static final Map<UUID, Texture> texCache = new HashMap<>(); - static final File ALTS_FILE = new File(CoffeeClientMain.BASE, "alts.sip"); + static final File ALTS_FILE = new File(ShadowMain.BASE, "alts.sip"); static final String TOP_NOTE = """ // DO NOT SHARE THIS FILE // This file contains sensitive information about your accounts @@ -102,7 +102,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { } void saveAlts() { - CoffeeClientMain.log(Level.INFO, "Saving alts"); + ShadowMain.log(Level.INFO, "Saving alts"); JsonArray root = new JsonArray(); for (AltContainer alt1 : alts) { AltStorage alt = alt1.storage; @@ -121,7 +121,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { try { FileUtils.write(ALTS_FILE, TOP_NOTE + "\n" + root, StandardCharsets.UTF_8); } catch (Exception ignored) { - CoffeeClientMain.log(Level.ERROR, "Failed to write alts file"); + ShadowMain.log(Level.ERROR, "Failed to write alts file"); } } @@ -133,13 +133,13 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { @SuppressWarnings("ResultOfMethodCallIgnored") void loadAlts() { - CoffeeClientMain.log(Level.INFO, "Loading alts"); + ShadowMain.log(Level.INFO, "Loading alts"); if (!ALTS_FILE.isFile()) { ALTS_FILE.delete(); } if (!ALTS_FILE.exists()) { - CoffeeClientMain.log(Level.INFO, "Skipping alt loading because file doesn't exist"); + ShadowMain.log(Level.INFO, "Skipping alt loading because file doesn't exist"); return; } try { @@ -160,7 +160,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { } } catch (Exception ignored) { - CoffeeClientMain.log(Level.ERROR, "Failed to read alts file - corrupted?"); + ShadowMain.log(Level.ERROR, "Failed to read alts file - corrupted?"); } } @@ -205,7 +205,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { toY = height - getPadding(); buttonWidth = toX - fromX - padding * 3 - texDim; session = new ThemedButton(fromX + texDim + padding * 2, toY - 20 - padding, buttonWidth, 20, "Session", () -> { - Objects.requireNonNull(client).setScreen(new SessionEditor(this, CoffeeClientMain.client.getSession())); // this is not a session stealer + Objects.requireNonNull(client).setScreen(new SessionEditor(this, ShadowMain.client.getSession())); // this is not a session stealer }); } @@ -214,7 +214,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { } void updateCurrentAccount() { - UUID uid = CoffeeClientMain.client.getSession().getProfile().getId(); + UUID uid = ShadowMain.client.getSession().getProfile().getId(); if (texCache.containsKey(uid)) { this.currentAccountTexture = texCache.get(uid); @@ -234,8 +234,8 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { NativeImage img = NativeImage.read(data); NativeImageBackedTexture texture = new NativeImageBackedTexture(img); - CoffeeClientMain.client.execute(() -> { - CoffeeClientMain.client.getTextureManager().registerTexture(currentAccountTexture, texture); + ShadowMain.client.execute(() -> { + ShadowMain.client.getTextureManager().registerTexture(currentAccountTexture, texture); currentAccountTextureLoaded = true; }); } catch (Exception e) { @@ -256,7 +256,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { return; } Session newSession = new Session(selectedAlt.storage.cachedName, selectedAlt.storage.cachedUuid.toString(), selectedAlt.storage.accessToken, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG); - ((IMinecraftClientAccessor) CoffeeClientMain.client).setSession(newSession); + ((IMinecraftClientAccessor) ShadowMain.client).setSession(newSession); updateCurrentAccount(); }).start(); } @@ -406,7 +406,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { Renderer.R2D.renderTexture(stack, fromX + padding, fromY + padding, texDim, texDim, 8, 8, 8, 8, 64, 64); } RenderSystem.defaultBlendFunc(); - String uuid = CoffeeClientMain.client.getSession().getUuid(); + String uuid = ShadowMain.client.getSession().getUuid(); double uuidWid = FontRenderers.getRenderer().getStringWidth(uuid); double maxWid = leftWidth - texDim - padding * 3; if (uuidWid > maxWid) { @@ -414,7 +414,7 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { uuid = FontRenderers.getRenderer().trimStringToWidth(uuid, maxWid - 1 - threeDotWidth); uuid += "..."; } - AltContainer.PropEntry[] props = new AltContainer.PropEntry[]{new AltContainer.PropEntry(CoffeeClientMain.client.getSession().getUsername(), FontRenderers.getCustomSize(22), 0xFFFFFF), + AltContainer.PropEntry[] props = new AltContainer.PropEntry[]{new AltContainer.PropEntry(ShadowMain.client.getSession().getUsername(), FontRenderers.getCustomSize(22), 0xFFFFFF), new AltContainer.PropEntry(uuid, FontRenderers.getRenderer(), 0xAAAAAA)}; float propsOffset = (float) (fromY + padding); for (AltContainer.PropEntry prop : props) { @@ -929,9 +929,9 @@ public class AltManagerScreen extends ClientScreen implements FastTickable { NativeImage img = NativeImage.read(data); NativeImageBackedTexture texture = new NativeImageBackedTexture(img); - CoffeeClientMain.client.execute(() -> { + ShadowMain.client.execute(() -> { this.tex = new Texture(("dynamic/tex_" + this.storage.cachedUuid.hashCode() + "_" + (Math.random() + "").split("\\.")[1]).toLowerCase()); - CoffeeClientMain.client.getTextureManager().registerTexture(this.tex, texture); + ShadowMain.client.getTextureManager().registerTexture(this.tex, texture); texCache.put(this.storage.cachedUuid, this.tex); texLoaded = true; }); diff --git a/src/main/java/net/shadow/client/feature/gui/screen/ClientScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/ClientScreen.java index 4cd46f6..0b62f84 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/ClientScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/ClientScreen.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.gui.screen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.render.MSAAFramebuffer; public class ClientScreen extends Screen { @@ -24,7 +24,7 @@ public class ClientScreen extends Screen { @Override public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { - CoffeeClientMain.client.keyboard.setRepeatEvents(true); + ShadowMain.client.keyboard.setRepeatEvents(true); if (samples != -1) { if (!MSAAFramebuffer.framebufferInUse()) { MSAAFramebuffer.use(samples, () -> renderInternal(matrices, mouseX, mouseY, delta)); diff --git a/src/main/java/net/shadow/client/feature/gui/screen/HomeScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/HomeScreen.java index 4050424..1230df9 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/HomeScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/HomeScreen.java @@ -12,7 +12,7 @@ import net.minecraft.client.texture.NativeImageBackedTexture; import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.feature.gui.widget.RoundButton; import net.shadow.client.helper.Texture; @@ -100,14 +100,14 @@ public class HomeScreen extends ClientScreen implements FastTickable { double centerWidgetsY = height - padding - 25; double rightPad = width - padding; Color bg = new Color(30, 30, 30); - RoundButton single = new RoundButton(bg, rightPad - (padding + 60), centerWidgetsY, 60, 20, "Singleplayer", () -> CoffeeClientMain.client.setScreen(new SelectWorldScreen(this))); - RoundButton multi = new RoundButton(bg, rightPad - (padding + 60) * 2, centerWidgetsY, 60, 20, "Multiplayer", () -> CoffeeClientMain.client.setScreen(new MultiplayerScreen(this))); - RoundButton realms = new RoundButton(bg, rightPad - (padding + 60) * 3, centerWidgetsY, 60, 20, "Realms", () -> CoffeeClientMain.client.setScreen(new RealmsMainScreen(this))); - RoundButton alts = new RoundButton(bg, rightPad - (padding + 60) * 4, centerWidgetsY, 60, 20, "Alts", () -> CoffeeClientMain.client.setScreen(AltManagerScreen.instance() + RoundButton single = new RoundButton(bg, rightPad - (padding + 60), centerWidgetsY, 60, 20, "Singleplayer", () -> ShadowMain.client.setScreen(new SelectWorldScreen(this))); + RoundButton multi = new RoundButton(bg, rightPad - (padding + 60) * 2, centerWidgetsY, 60, 20, "Multiplayer", () -> ShadowMain.client.setScreen(new MultiplayerScreen(this))); + RoundButton realms = new RoundButton(bg, rightPad - (padding + 60) * 3, centerWidgetsY, 60, 20, "Realms", () -> ShadowMain.client.setScreen(new RealmsMainScreen(this))); + RoundButton alts = new RoundButton(bg, rightPad - (padding + 60) * 4, centerWidgetsY, 60, 20, "Alts", () -> ShadowMain.client.setScreen(AltManagerScreen.instance() // new TestScreen() )); - RoundButton settings = new RoundButton(bg, rightPad - (padding + 60) * 5, centerWidgetsY, 60, 20, "Options", () -> CoffeeClientMain.client.setScreen(new OptionsScreen(this, CoffeeClientMain.client.options))); - RoundButton quit = new RoundButton(bg, rightPad - (padding + 60) * 5 - padding - 20, centerWidgetsY, 20, 20, "X", CoffeeClientMain.client::scheduleStop); + RoundButton settings = new RoundButton(bg, rightPad - (padding + 60) * 5, centerWidgetsY, 60, 20, "Options", () -> ShadowMain.client.setScreen(new OptionsScreen(this, ShadowMain.client.options))); + RoundButton quit = new RoundButton(bg, rightPad - (padding + 60) * 5 - padding - 20, centerWidgetsY, 20, 20, "X", ShadowMain.client::scheduleStop); addDrawableChild(single); addDrawableChild(multi); addDrawableChild(settings); @@ -132,7 +132,7 @@ public class HomeScreen extends ClientScreen implements FastTickable { } void updateCurrentAccount(Runnable callback) { - UUID uid = CoffeeClientMain.client.getSession().getProfile().getId(); + UUID uid = ShadowMain.client.getSession().getProfile().getId(); if (previousChecked != null && previousChecked.equals(uid)) { callback.run(); return; @@ -152,8 +152,8 @@ public class HomeScreen extends ClientScreen implements FastTickable { System.out.println(img); NativeImageBackedTexture texture = new NativeImageBackedTexture(img); - CoffeeClientMain.client.execute(() -> { - CoffeeClientMain.client.getTextureManager().registerTexture(currentAccountTexture, texture); + ShadowMain.client.execute(() -> { + ShadowMain.client.getTextureManager().registerTexture(currentAccountTexture, texture); currentAccountTextureLoaded = true; callback.run(); }); @@ -221,7 +221,7 @@ public class HomeScreen extends ClientScreen implements FastTickable { Renderer.R2D.renderTexture(stack, fromX + padding, fromY + padding, texDim, texDim, 8, 8, 8, 8, 64, 64); } RenderSystem.defaultBlendFunc(); - String uuid = CoffeeClientMain.client.getSession().getUuid(); + String uuid = ShadowMain.client.getSession().getUuid(); double uuidWid = FontRenderers.getRenderer().getStringWidth(uuid); double maxWid = 200 - texDim - padding * 3; if (uuidWid > maxWid) { @@ -230,7 +230,7 @@ public class HomeScreen extends ClientScreen implements FastTickable { uuid += "..."; } AltManagerScreen.AltContainer.PropEntry[] props = new AltManagerScreen.AltContainer.PropEntry[]{ - new AltManagerScreen.AltContainer.PropEntry(CoffeeClientMain.client.getSession().getUsername(), FontRenderers.getCustomSize(22), 0xFFFFFF), + new AltManagerScreen.AltContainer.PropEntry(ShadowMain.client.getSession().getUsername(), FontRenderers.getCustomSize(22), 0xFFFFFF), new AltManagerScreen.AltContainer.PropEntry(uuid, FontRenderers.getRenderer(), 0xAAAAAA)}; float propsOffset = (float) (fromY + padding); for (AltManagerScreen.AltContainer.PropEntry prop : props) { @@ -261,7 +261,7 @@ public class HomeScreen extends ClientScreen implements FastTickable { @Override public void onFastTick() { - if (CoffeeClientMain.client.getOverlay() == null && CoffeeClientMain.client.currentScreen == this && System.currentTimeMillis() - initTime > 1000 && !loaded) { + if (ShadowMain.client.getOverlay() == null && ShadowMain.client.currentScreen == this && System.currentTimeMillis() - initTime > 1000 && !loaded) { load(); } double delta = 10 / 600d; diff --git a/src/main/java/net/shadow/client/feature/gui/screen/LoadingScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/LoadingScreen.java index b970887..fe3e09b 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/LoadingScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/LoadingScreen.java @@ -4,7 +4,7 @@ import com.google.common.util.concurrent.AtomicDouble; import lombok.Data; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.helper.font.FontRenderers; import net.shadow.client.helper.font.adapter.impl.ClientFontRenderer; @@ -39,7 +39,7 @@ public class LoadingScreen extends ClientScreen implements FastTickable { // double progress = 0; final AtomicDouble progress = new AtomicDouble(); final ClientFontRenderer title = FontRenderers.getCustomSize(40); - final Map<CoffeeClientMain.ResourceEntry, ProgressData> progressMap = new ConcurrentHashMap<>(); + final Map<ShadowMain.ResourceEntry, ProgressData> progressMap = new ConcurrentHashMap<>(); double smoothProgress = 0; double opacity = 1; String warningIfPresent = ""; @@ -69,11 +69,11 @@ public class LoadingScreen extends ClientScreen implements FastTickable { public void onFastTick() { //System.out.println(progressMap.values().stream().map(AtomicDouble::get).reduce(Double::sum)+"-"+CoffeeClientMain.resources.size()); - progress.set(progressMap.values().stream().map(progressData -> progressData.getProgress().get()).reduce(Double::sum).orElse(0d) / CoffeeClientMain.resources.size()); + progress.set(progressMap.values().stream().map(progressData -> progressData.getProgress().get()).reduce(Double::sum).orElse(0d) / ShadowMain.resources.size()); smoothProgress = Transitions.transition(smoothProgress, progress.get(), 10, 0.0001); // smoothProgress = progress.get(); - if (CoffeeClientMain.client.getOverlay() == null) { + if (ShadowMain.client.getOverlay() == null) { if (!loadInProg.get()) { load(); } @@ -91,10 +91,10 @@ public class LoadingScreen extends ClientScreen implements FastTickable { ExecutorService es = Executors.newFixedThreadPool(atOnce); - for (CoffeeClientMain.ResourceEntry resource : CoffeeClientMain.resources) { + for (ShadowMain.ResourceEntry resource : ShadowMain.resources) { progressMap.put(resource, new ProgressData()); es.execute(() -> { - CoffeeClientMain.log(Level.INFO, "Downloading " + resource.url()); + ShadowMain.log(Level.INFO, "Downloading " + resource.url()); progressMap.get(resource).getWorkingOnIt().set(true); try { @@ -122,9 +122,9 @@ public class LoadingScreen extends ClientScreen implements FastTickable { byte[] imageBuffer = bout.toByteArray(); BufferedImage bi = ImageIO.read(new ByteArrayInputStream(imageBuffer)); Utils.registerBufferedImageTexture(resource.tex(), bi); - CoffeeClientMain.log(Level.INFO, "Downloaded " + resource.url()); + ShadowMain.log(Level.INFO, "Downloaded " + resource.url()); } catch (Exception e) { - CoffeeClientMain.log(Level.ERROR, "Failed to download " + resource.url() + ": " + e.getMessage()); + ShadowMain.log(Level.ERROR, "Failed to download " + resource.url() + ": " + e.getMessage()); BufferedImage empty = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); empty.setRGB(0, 0, 0xFF000000); Utils.registerBufferedImageTexture(resource.tex(), empty); diff --git a/src/main/java/net/shadow/client/feature/gui/screen/NbtEditorScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/NbtEditorScreen.java index 0a8105e..03e0f84 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/NbtEditorScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/NbtEditorScreen.java @@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.StringNbtReader; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.gui.widget.RoundButton; @@ -207,7 +207,7 @@ public class NbtEditorScreen extends ClientScreen implements FastTickable { double entitledScroll = contentHeight - windowHeight; entitledScroll = Math.max(0, entitledScroll); - if (InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_SHIFT)) { + if (InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_SHIFT)) { scrollX -= amount * 10; } else { scroll -= amount * 10; @@ -228,7 +228,7 @@ public class NbtEditorScreen extends ClientScreen implements FastTickable { return true; } if (isPaste(keyCode)) { - String clip = CoffeeClientMain.client.keyboard.getClipboard(); + String clip = ShadowMain.client.keyboard.getClipboard(); skipAppend = true; for (char c : clip.toCharArray()) { if (c == '\n') { diff --git a/src/main/java/net/shadow/client/feature/gui/screen/TestScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/TestScreen.java index d21ad8b..97c5ccb 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/TestScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/TestScreen.java @@ -5,7 +5,7 @@ import net.minecraft.client.gui.widget.DoubleOptionSliderWidget; import net.minecraft.client.option.DoubleOption; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.FastTickable; import net.shadow.client.helper.Timer; import net.shadow.client.helper.render.Renderer; @@ -31,9 +31,9 @@ public class TestScreen extends Screen implements FastTickable { @Override protected void init() { DoubleOption dop = new DoubleOption("bruh", 1, 10, 0.01f, gameOptions -> 1d, (gameOptions, aDouble) -> goopyV = aDouble, (gameOptions, doubleOption) -> Text.of("goopy")); - goopy = new DoubleOptionSliderWidget(CoffeeClientMain.client.options, 5, height - 30, 100, 20, dop, Lists.newArrayList()); + goopy = new DoubleOptionSliderWidget(ShadowMain.client.options, 5, height - 30, 100, 20, dop, Lists.newArrayList()); DoubleOption curve = new DoubleOption("curve", 1, 10, 0.01f, gameOptions -> 1d, (gameOptions, aDouble) -> curveV = aDouble, (gameOptions, doubleOption) -> Text.of("real")); - this.curve = new DoubleOptionSliderWidget(CoffeeClientMain.client.options, 110, height - 30, 100, 20, curve, Lists.newArrayList()); + this.curve = new DoubleOptionSliderWidget(ShadowMain.client.options, 110, height - 30, 100, 20, curve, Lists.newArrayList()); addDrawableChild(goopy); addDrawableChild(this.curve); super.init(); diff --git a/src/main/java/net/shadow/client/feature/gui/widget/RoundTextFieldWidget.java b/src/main/java/net/shadow/client/feature/gui/widget/RoundTextFieldWidget.java index ebbe726..26a3474 100644 --- a/src/main/java/net/shadow/client/feature/gui/widget/RoundTextFieldWidget.java +++ b/src/main/java/net/shadow/client/feature/gui/widget/RoundTextFieldWidget.java @@ -7,7 +7,7 @@ import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.DoesMSAA; import net.shadow.client.helper.font.FontRenderers; import net.shadow.client.helper.render.ClipStack; @@ -64,12 +64,12 @@ public class RoundTextFieldWidget implements Element, Drawable, Selectable, Does if (control && key == GLFW.GLFW_KEY_C) { if (cursor != selectionStart || cursor != selectionEnd) { - CoffeeClientMain.client.keyboard.setClipboard(text.substring(selectionStart, selectionEnd)); + ShadowMain.client.keyboard.setClipboard(text.substring(selectionStart, selectionEnd)); } return true; } else if (control && key == GLFW.GLFW_KEY_X) { if (cursor != selectionStart || cursor != selectionEnd) { - CoffeeClientMain.client.keyboard.setClipboard(text.substring(selectionStart, selectionEnd)); + ShadowMain.client.keyboard.setClipboard(text.substring(selectionStart, selectionEnd)); clearSelection(); } @@ -103,7 +103,7 @@ public class RoundTextFieldWidget implements Element, Drawable, Selectable, Does clearSelection(); String preText = text; - String clipboard = CoffeeClientMain.client.keyboard.getClipboard(); + String clipboard = ShadowMain.client.keyboard.getClipboard(); int addedChars = 0; StringBuilder sb = new StringBuilder(text.length() + clipboard.length()); diff --git a/src/main/java/net/shadow/client/feature/module/Module.java b/src/main/java/net/shadow/client/feature/module/Module.java index 70f0c76..add0ea0 100644 --- a/src/main/java/net/shadow/client/feature/module/Module.java +++ b/src/main/java/net/shadow/client/feature/module/Module.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.module; import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.ModuleConfig; @@ -15,7 +15,7 @@ import net.shadow.client.feature.gui.notifications.Notification; public abstract class Module { - protected static final MinecraftClient client = CoffeeClientMain.client; + protected static final MinecraftClient client = ShadowMain.client; public final ModuleConfig config; public final DoubleSetting keybind; private final BooleanSetting debuggerEnabled; diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/AimAssist.java b/src/main/java/net/shadow/client/feature/module/impl/combat/AimAssist.java index 1e4374f..b609adb 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/AimAssist.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/AimAssist.java @@ -14,7 +14,7 @@ import net.minecraft.entity.passive.PassiveEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -64,17 +64,17 @@ public class AimAssist extends Module { attacks.add(AttackManager.getLastAttackInTimeRange()); } } else { - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (!entity.isAttackable()) { continue; } - if (entity.equals(CoffeeClientMain.client.player)) { + if (entity.equals(ShadowMain.client.player)) { continue; } if (!entity.isAlive()) { continue; } - if (entity.getPos().distanceTo(CoffeeClientMain.client.player.getPos()) > Objects.requireNonNull(CoffeeClientMain.client.interactionManager).getReachDistance()) { + if (entity.getPos().distanceTo(ShadowMain.client.player.getPos()) > Objects.requireNonNull(ShadowMain.client.interactionManager).getReachDistance()) { continue; } boolean checked = false; @@ -108,7 +108,7 @@ public class AimAssist extends Module { return; } if (priority.getValue() == PriorityMode.Distance) { - le = attacks.stream().sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()))).toList() + le = attacks.stream().sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()))).toList() .get(0); } else { // get entity with the least health if mode is ascending, else get most health @@ -147,8 +147,8 @@ public class AimAssist extends Module { Rotations.lookAtPositionSmooth(le.getPos().add(0, le.getHeight() / 2d, 0), laziness.getValue()); } else { Vec2f py = Rotations.getPitchYaw(le.getPos().add(0, le.getHeight() / 2d, 0)); - Objects.requireNonNull(CoffeeClientMain.client.player).setPitch(py.x); - CoffeeClientMain.client.player.setYaw(py.y); + Objects.requireNonNull(ShadowMain.client.player).setPitch(py.x); + ShadowMain.client.player.setYaw(py.y); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/AutoAttack.java b/src/main/java/net/shadow/client/feature/module/impl/combat/AutoAttack.java index e9db113..24c7ea5 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/AutoAttack.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/AutoAttack.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.module.impl.combat; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Hand; import net.minecraft.util.hit.EntityHitResult; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -18,11 +18,11 @@ public class AutoAttack extends Module { @Override public void tick() { - if (!(CoffeeClientMain.client.crosshairTarget instanceof EntityHitResult) || Objects.requireNonNull(CoffeeClientMain.client.player).getAttackCooldownProgress(0) < 1) { + if (!(ShadowMain.client.crosshairTarget instanceof EntityHitResult) || Objects.requireNonNull(ShadowMain.client.player).getAttackCooldownProgress(0) < 1) { return; } - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).attackEntity(CoffeeClientMain.client.player, ((EntityHitResult) CoffeeClientMain.client.crosshairTarget).getEntity()); - CoffeeClientMain.client.player.swingHand(Hand.MAIN_HAND); + Objects.requireNonNull(ShadowMain.client.interactionManager).attackEntity(ShadowMain.client.player, ((EntityHitResult) ShadowMain.client.crosshairTarget).getEntity()); + ShadowMain.client.player.swingHand(Hand.MAIN_HAND); } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Criticals.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Criticals.java index 1519db5..df5dafd 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/Criticals.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Criticals.java @@ -9,7 +9,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleRegistry; @@ -27,11 +27,11 @@ public class Criticals extends Module { super("Criticals", "Makes you deal a perfect 10/10 crit every time", ModuleType.COMBAT); Events.registerEventHandler(EventType.PACKET_SEND, event1 -> { PacketEvent event = (PacketEvent) event1; - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } if (event.getPacket() instanceof PlayerInteractEntityC2SPacket && this.isEnabled()) { - Vec3d ppos = CoffeeClientMain.client.player.getPos(); + Vec3d ppos = ShadowMain.client.player.getPos(); ModuleRegistry.getByClass(NoFall.class).enabled = false; // disable nofall modifying packets when we send these switch (mode.getValue()) { case Packet -> { @@ -39,16 +39,16 @@ public class Criticals extends Module { PlayerMoveC2SPacket.PositionAndOnGround p2 = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y, ppos.z, false); PlayerMoveC2SPacket.PositionAndOnGround p3 = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y + 0.000011, ppos.z, false); PlayerMoveC2SPacket.PositionAndOnGround p4 = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y, ppos.z, false); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p1); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p2); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p3); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p4); + ShadowMain.client.getNetworkHandler().sendPacket(p1); + ShadowMain.client.getNetworkHandler().sendPacket(p2); + ShadowMain.client.getNetworkHandler().sendPacket(p3); + ShadowMain.client.getNetworkHandler().sendPacket(p4); } case TpHop -> { PlayerMoveC2SPacket.PositionAndOnGround p5 = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y + 0.02, ppos.z, false); PlayerMoveC2SPacket.PositionAndOnGround p6 = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y + 0.01, ppos.z, false); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p5); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p6); + ShadowMain.client.getNetworkHandler().sendPacket(p5); + ShadowMain.client.getNetworkHandler().sendPacket(p6); } } ModuleRegistry.getByClass(NoFall.class).enabled = true; // re-enable nofall diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Killaura.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Killaura.java index 5df42b5..2dc44db 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/Killaura.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Killaura.java @@ -21,7 +21,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -86,21 +86,21 @@ public class Killaura extends Module { } int getDelay() { - if (CoffeeClientMain.client.player == null) { + if (ShadowMain.client.player == null) { return 0; } if (!automaticDelay.getValue()) { return (int) (delay.getValue() + 0); } else { - ItemStack hand = CoffeeClientMain.client.player.getMainHandStack(); + ItemStack hand = ShadowMain.client.player.getMainHandStack(); if (hand == null) { - hand = CoffeeClientMain.client.player.getOffHandStack(); + hand = ShadowMain.client.player.getOffHandStack(); } if (hand == null) { return 10; } - hand.getTooltip(CoffeeClientMain.client.player, TooltipContext.Default.ADVANCED); - AtomicDouble speed = new AtomicDouble(CoffeeClientMain.client.player.getAttributeBaseValue(EntityAttributes.GENERIC_ATTACK_SPEED)); + hand.getTooltip(ShadowMain.client.player, TooltipContext.Default.ADVANCED); + AtomicDouble speed = new AtomicDouble(ShadowMain.client.player.getAttributeBaseValue(EntityAttributes.GENERIC_ATTACK_SPEED)); hand.getAttributeModifiers(EquipmentSlot.MAINHAND).forEach((entityAttribute, entityAttributeModifier) -> { if (entityAttribute == EntityAttributes.GENERIC_ATTACK_SPEED) { speed.addAndGet(entityAttributeModifier.getValue()); @@ -111,18 +111,18 @@ public class Killaura extends Module { } double getRange() { - if (CoffeeClientMain.client.interactionManager == null) { + if (ShadowMain.client.interactionManager == null) { return 0; } if (capRangeAtMax.getValue()) { - return CoffeeClientMain.client.interactionManager.getReachDistance(); + return ShadowMain.client.interactionManager.getReachDistance(); } else { return range.getValue(); } } void doConfuse(Entity e) { // This also contains a range check - Vec3d updatePos = Objects.requireNonNull(CoffeeClientMain.client.player).getPos(); + Vec3d updatePos = Objects.requireNonNull(ShadowMain.client.player).getPos(); switch (confuseMode.getValue()) { case Behind -> { Vec3d p = e.getRotationVecClient(); @@ -139,17 +139,17 @@ public class Killaura extends Module { updatePos = new Vec3d(e.getX() + sin, e.getY(), e.getZ() + cos); } } - if (!confuseAllowClip.getValue() && Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(new BlockPos(updatePos)).getMaterial().blocksMovement()) { + if (!confuseAllowClip.getValue() && Objects.requireNonNull(ShadowMain.client.world).getBlockState(new BlockPos(updatePos)).getMaterial().blocksMovement()) { return; } if (e.getPos().distanceTo(updatePos) <= getRange()) { - CoffeeClientMain.client.player.updatePosition(updatePos.x, updatePos.y, updatePos.z); + ShadowMain.client.player.updatePosition(updatePos.x, updatePos.y, updatePos.z); } } @Override public void tick() { - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null || CoffeeClientMain.client.interactionManager == null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null || ShadowMain.client.interactionManager == null) { return; } boolean delayHasPassed = this.delayExec.hasExpired(getDelay() * 50L); @@ -165,7 +165,7 @@ public class Killaura extends Module { if (!combatPartner.isAttackable()) { return; } - if (combatPartner.equals(CoffeeClientMain.client.player)) { + if (combatPartner.equals(ShadowMain.client.player)) { return; } if (!combatPartner.isAlive()) { @@ -174,33 +174,33 @@ public class Killaura extends Module { if (enableConfuse.getValue()) { doConfuse(combatPartner); } - if (combatPartner.getPos().distanceTo(CoffeeClientMain.client.player.getPos()) > getRange()) { + if (combatPartner.getPos().distanceTo(ShadowMain.client.player.getPos()) > getRange()) { return; } Packets.sendServerSideLook(combatPartner.getEyePos()); Rotations.lookAtV3(combatPartner.getPos().add(0, combatPartner.getHeight() / 2, 0)); if (delayHasPassed) { - CoffeeClientMain.client.interactionManager.attackEntity(CoffeeClientMain.client.player, combatPartner); - CoffeeClientMain.client.player.swingHand(Hand.MAIN_HAND); + ShadowMain.client.interactionManager.attackEntity(ShadowMain.client.player, combatPartner); + ShadowMain.client.player.swingHand(Hand.MAIN_HAND); delayExec.reset(); } return; } attacks.clear(); - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (attacks.size() > multiLimit.getValue()) { break; } if (!entity.isAttackable()) { continue; } - if (entity.equals(CoffeeClientMain.client.player)) { + if (entity.equals(ShadowMain.client.player)) { continue; } if (!entity.isAlive()) { continue; } - if (entity.getPos().distanceTo(CoffeeClientMain.client.player.getPos()) > getRange()) { + if (entity.getPos().distanceTo(ShadowMain.client.player.getPos()) > getRange()) { continue; } @@ -208,7 +208,7 @@ public class Killaura extends Module { attacks.add(entity); } else { if (entity instanceof Angerable) { - if (((Angerable) entity).getAngryAt() == CoffeeClientMain.client.player.getUuid()) { + if (((Angerable) entity).getAngryAt() == ShadowMain.client.player.getUuid()) { if (attackHostile.getValue()) { attacks.add(entity); } else if (attackNeutral.getValue()) { @@ -239,7 +239,7 @@ public class Killaura extends Module { if (mode.getValue() == SelectMode.Single) { Entity tar = null; if (prio.getValue() == PriorityMode.Distance) { - tar = attacks.stream().sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()))).toList().get(0); + tar = attacks.stream().sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()))).toList().get(0); } else if (prio.getValue() == PriorityMode.Health_ascending || prio.getValue() == PriorityMode.Health_descending) { // almost missed this // get entity with the least health if mode is ascending, else get most health tar = attacks.stream().sorted(Comparator.comparingDouble(value -> { @@ -252,12 +252,12 @@ public class Killaura extends Module { // get entity in front of you (or closest to the front) tar = attacks.stream().sorted(Comparator.comparingDouble(value -> { Vec3d center = value.getBoundingBox().getCenter(); - double offX = center.x - CoffeeClientMain.client.player.getX(); - double offZ = center.z - CoffeeClientMain.client.player.getZ(); + double offX = center.x - ShadowMain.client.player.getX(); + double offZ = center.z - ShadowMain.client.player.getZ(); float yaw = (float) Math.toDegrees(Math.atan2(offZ, offX)) - 90F; - float pitch = (float) -Math.toDegrees(Math.atan2(center.y - CoffeeClientMain.client.player.getEyeY(), Math.sqrt(offX * offX + offZ * offZ))); - return Math.abs(MathHelper.wrapDegrees(yaw - CoffeeClientMain.client.player.getYaw())) + Math.abs(MathHelper.wrapDegrees(pitch - CoffeeClientMain.client.player.getPitch())); - })).sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()))).toList().get(0); + float pitch = (float) -Math.toDegrees(Math.atan2(center.y - ShadowMain.client.player.getEyeY(), Math.sqrt(offX * offX + offZ * offZ))); + return Math.abs(MathHelper.wrapDegrees(yaw - ShadowMain.client.player.getYaw())) + Math.abs(MathHelper.wrapDegrees(pitch - ShadowMain.client.player.getPitch())); + })).sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()))).toList().get(0); } if (tar == null) { return; @@ -265,14 +265,14 @@ public class Killaura extends Module { if (enableConfuse.getValue()) { doConfuse(tar); } - if (tar.getPos().distanceTo(CoffeeClientMain.client.player.getPos()) > getRange()) { + if (tar.getPos().distanceTo(ShadowMain.client.player.getPos()) > getRange()) { return; } Packets.sendServerSideLook(tar.getEyePos()); Rotations.lookAtV3(tar.getPos().add(0, tar.getHeight() / 2, 0)); if (delayHasPassed) { - CoffeeClientMain.client.interactionManager.attackEntity(CoffeeClientMain.client.player, tar); - CoffeeClientMain.client.player.swingHand(Hand.MAIN_HAND); + ShadowMain.client.interactionManager.attackEntity(ShadowMain.client.player, tar); + ShadowMain.client.player.swingHand(Hand.MAIN_HAND); delayExec.reset(); } return; @@ -281,8 +281,8 @@ public class Killaura extends Module { Packets.sendServerSideLook(attack.getEyePos()); Rotations.lookAtV3(attack.getPos().add(0, attack.getHeight() / 2, 0)); if (delayHasPassed) { - CoffeeClientMain.client.interactionManager.attackEntity(CoffeeClientMain.client.player, attack); - CoffeeClientMain.client.player.swingHand(Hand.MAIN_HAND); + ShadowMain.client.interactionManager.attackEntity(ShadowMain.client.player, attack); + ShadowMain.client.player.swingHand(Hand.MAIN_HAND); delayExec.reset(); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Velocity.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Velocity.java index e29d4d1..c13ebb5 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/Velocity.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Velocity.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.module.impl.combat; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -30,11 +30,11 @@ public class Velocity extends Module { multiplierX.showIf(() -> mode.getValue() == Mode.Modify); multiplierY.showIf(() -> mode.getValue() == Mode.Modify); Events.registerEventHandler(EventType.PACKET_RECEIVE, event -> { - if (!this.isEnabled() || CoffeeClientMain.client.player == null) { + if (!this.isEnabled() || ShadowMain.client.player == null) { return; } PacketEvent pe = (PacketEvent) event; - if (pe.getPacket() instanceof EntityVelocityUpdateS2CPacket packet && packet.getId() == CoffeeClientMain.client.player.getId()) { + if (pe.getPacket() instanceof EntityVelocityUpdateS2CPacket packet && packet.getId() == ShadowMain.client.player.getId()) { if (mode.getValue() == Mode.Modify) { double velX = packet.getVelocityX() / 8000d; // don't ask me why they did this double velY = packet.getVelocityY() / 8000d; diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiAntiXray.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiAntiXray.java index bf56761..c494d36 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiAntiXray.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiAntiXray.java @@ -13,7 +13,7 @@ import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -70,7 +70,7 @@ public class AntiAntiXray extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } if (toScan.size() == 0) { @@ -94,19 +94,19 @@ public class AntiAntiXray extends Module { scanned++; PlayerActionC2SPacket p = new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, current, Direction.DOWN); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p); + ShadowMain.client.getNetworkHandler().sendPacket(p); } } @Override public void enable() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } toScan.clear(); scanned = 0; - startPos = CoffeeClientMain.client.player.getPos(); - BlockPos ppos = CoffeeClientMain.client.player.getBlockPos(); + startPos = ShadowMain.client.player.getPos(); + BlockPos ppos = ShadowMain.client.player.getBlockPos(); Vec3d lastPos = Vec3d.ZERO; int rangeMid = (int) (range.getValue() / 2); int ry = customYSize.getValue() == -1 ? rangeMid : (int) (customYSize.getValue() / 2); @@ -114,7 +114,7 @@ public class AntiAntiXray extends Module { for (int x = -rangeMid; x < rangeMid; x++) { for (int z = -rangeMid; z < rangeMid; z++) { BlockPos current = ppos.add(x, y, z); - BlockState bs = CoffeeClientMain.client.world.getBlockState(current); + BlockState bs = ShadowMain.client.world.getBlockState(current); Vec3d currentPos = new Vec3d(current.getX(), current.getY(), current.getZ()); if (!bs.isAir() && lastPos.distanceTo(currentPos) >= skipDistance.getValue()) { if (isBlockValid(bs.getBlock())) { diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiReducedDebugInfo.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiReducedDebugInfo.java index 7b3b3b4..8f0b994 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiReducedDebugInfo.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/AntiReducedDebugInfo.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.exploit; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -35,7 +35,7 @@ public class AntiReducedDebugInfo extends Module { @Override public String getContext() { - boolean origDebugInfoReduce = Objects.requireNonNull(CoffeeClientMain.client.player).hasReducedDebugInfo() || CoffeeClientMain.client.options.reducedDebugInfo; + boolean origDebugInfoReduce = Objects.requireNonNull(ShadowMain.client.player).hasReducedDebugInfo() || ShadowMain.client.options.reducedDebugInfo; return origDebugInfoReduce ? "Active!" : null; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/Boaty.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/Boaty.java index 0755262..5893a8f 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/Boaty.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/Boaty.java @@ -10,7 +10,7 @@ import net.minecraft.entity.Entity; import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -33,17 +33,17 @@ public class Boaty extends Module { @Override public void tick() { - if (Objects.requireNonNull(CoffeeClientMain.client.player).hasVehicle()) { - Entity vehicle = CoffeeClientMain.client.player.getVehicle(); + if (Objects.requireNonNull(ShadowMain.client.player).hasVehicle()) { + Entity vehicle = ShadowMain.client.player.getVehicle(); if (!running) { - BlockPos start = CoffeeClientMain.client.player.getBlockPos(); + BlockPos start = ShadowMain.client.player.getBlockPos(); this.start = new Vec3d(start.getX() + .5, start.getY() + 1, start.getZ() + .5); } running = true; Objects.requireNonNull(vehicle).updatePosition(start.x, start.y - 1, start.z); VehicleMoveC2SPacket p = new VehicleMoveC2SPacket(vehicle); for (int i = 0; i < amount.getValue(); i++) { - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); } } else { running = false; @@ -80,7 +80,7 @@ public class Boaty extends Module { @Override public void onFastTick_NWC() { - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null) { setEnabled(false); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/CarpetBomb.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/CarpetBomb.java index d14d64d..025dc7e 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/CarpetBomb.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/CarpetBomb.java @@ -15,7 +15,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.*; import net.minecraft.world.RaycastContext; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.gui.notifications.Notification; @@ -52,7 +52,7 @@ public class CarpetBomb extends Module { if (!this.isEnabled()) { return; } - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null || CoffeeClientMain.client.currentScreen != null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null || ShadowMain.client.currentScreen != null) { return; } MouseEvent me = (MouseEvent) event; @@ -65,9 +65,9 @@ public class CarpetBomb extends Module { void spawn() { if (mode.getValue() == Mode.Entity) { - Vec3d goal = Objects.requireNonNull(CoffeeClientMain.client.player).getRotationVec(1f).multiply(200); - Box b = CoffeeClientMain.client.player.getBoundingBox().stretch(goal).expand(1, 1, 1); - EntityHitResult ehr = ProjectileUtil.raycast(CoffeeClientMain.client.player, CoffeeClientMain.client.player.getCameraPosVec(0), CoffeeClientMain.client.player.getCameraPosVec(0) + Vec3d goal = Objects.requireNonNull(ShadowMain.client.player).getRotationVec(1f).multiply(200); + Box b = ShadowMain.client.player.getBoundingBox().stretch(goal).expand(1, 1, 1); + EntityHitResult ehr = ProjectileUtil.raycast(ShadowMain.client.player, ShadowMain.client.player.getCameraPosVec(0), ShadowMain.client.player.getCameraPosVec(0) .add(goal), b, net.minecraft.entity.Entity::isAttackable, 200 * 200); if (ehr == null) { Notification.create(6000, "Error", false, Notification.Type.ERROR, "You aren't looking at an entity"); @@ -79,15 +79,15 @@ public class CarpetBomb extends Module { for (int oz = -10; oz < 11; oz++) { Vec3d off = new Vec3d(ox, oz, 0); off = off.multiply(spacing.getValue()); - Vec3d a = Rotations.relativeToAbsolute(Objects.requireNonNull(CoffeeClientMain.client.player) - .getCameraPosVec(CoffeeClientMain.client.getTickDelta()), CoffeeClientMain.client.player.getRotationClient(), off); + Vec3d a = Rotations.relativeToAbsolute(Objects.requireNonNull(ShadowMain.client.player) + .getCameraPosVec(ShadowMain.client.getTickDelta()), ShadowMain.client.player.getRotationClient(), off); Vec3d rot = switch (mode.getValue()) { - case Relative -> CoffeeClientMain.client.player.getRotationVector(); + case Relative -> ShadowMain.client.player.getRotationVector(); case Focussed -> { - Vec3d root = CoffeeClientMain.client.player.getCameraPosVec(1); - Vec3d rotNormal = CoffeeClientMain.client.player.getRotationVector(); - RaycastContext rc = new RaycastContext(root, root.add(rotNormal.multiply(200)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.NONE, CoffeeClientMain.client.player); - BlockHitResult bhr = Objects.requireNonNull(CoffeeClientMain.client.world).raycast(rc); + Vec3d root = ShadowMain.client.player.getCameraPosVec(1); + Vec3d rotNormal = ShadowMain.client.player.getRotationVector(); + RaycastContext rc = new RaycastContext(root, root.add(rotNormal.multiply(200)), RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.NONE, ShadowMain.client.player); + BlockHitResult bhr = Objects.requireNonNull(ShadowMain.client.world).raycast(rc); Vec2f real = Rotations.getPitchYawFromOtherEntity(a, bhr.getPos()); float f = real.x * 0.017453292F; float g = -real.y * 0.017453292F; @@ -152,14 +152,14 @@ public class CarpetBomb extends Module { motion.add(NbtDouble.of(vel.z)); entityTag.put("power", motion); entityTag.put("ExplosionPower", NbtDouble.of(power.getValue())); - CreativeInventoryActionC2SPacket set = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(Objects.requireNonNull(CoffeeClientMain.client.player) + CreativeInventoryActionC2SPacket set = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(Objects.requireNonNull(ShadowMain.client.player) .getInventory().selectedSlot), spawnEgg); - CreativeInventoryActionC2SPacket clr = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), new ItemStack(Items.AIR)); - BlockHitResult bhr = new BlockHitResult(CoffeeClientMain.client.player.getPos(), Direction.DOWN, new BlockPos(CoffeeClientMain.client.player.getPos()), false); + CreativeInventoryActionC2SPacket clr = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), new ItemStack(Items.AIR)); + BlockHitResult bhr = new BlockHitResult(ShadowMain.client.player.getPos(), Direction.DOWN, new BlockPos(ShadowMain.client.player.getPos()), false); PlayerInteractBlockC2SPacket put = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(set); - CoffeeClientMain.client.getNetworkHandler().sendPacket(put); - CoffeeClientMain.client.getNetworkHandler().sendPacket(clr); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(set); + ShadowMain.client.getNetworkHandler().sendPacket(put); + ShadowMain.client.getNetworkHandler().sendPacket(clr); positions = positionsCopy; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/InstaBow.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/InstaBow.java index 0b4b024..81300ce 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/InstaBow.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/InstaBow.java @@ -15,7 +15,7 @@ import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; @@ -43,15 +43,15 @@ public class InstaBow extends Module { } PacketEvent pe = (PacketEvent) event; if (pe.getPacket() instanceof PlayerActionC2SPacket packet && packet.getAction() == PlayerActionC2SPacket.Action.RELEASE_USE_ITEM) { - Vec3d a = Objects.requireNonNull(CoffeeClientMain.client.player).getPos().subtract(0, 1e-10, 0); - Vec3d b = CoffeeClientMain.client.player.getPos().add(0, 1e-10, 0); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(new ClientCommandC2SPacket(CoffeeClientMain.client.player, ClientCommandC2SPacket.Mode.START_SPRINTING)); + Vec3d a = Objects.requireNonNull(ShadowMain.client.player).getPos().subtract(0, 1e-10, 0); + Vec3d b = ShadowMain.client.player.getPos().add(0, 1e-10, 0); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(new ClientCommandC2SPacket(ShadowMain.client.player, ClientCommandC2SPacket.Mode.START_SPRINTING)); // ModuleRegistry.getByClass(NoFall.class).enabled = false; // disable nofall modifying packets when we send these for (int i = 0; i < it.getValue(); i++) { PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.PositionAndOnGround(a.x, a.y, a.z, true); PlayerMoveC2SPacket p1 = new PlayerMoveC2SPacket.PositionAndOnGround(b.x, b.y, b.z, false); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p1); + ShadowMain.client.getNetworkHandler().sendPacket(p); + ShadowMain.client.getNetworkHandler().sendPacket(p1); } // ModuleRegistry.getByClass(NoFall.class).enabled = true; } @@ -63,24 +63,24 @@ public class InstaBow extends Module { if (!autoFire.getValue()) { return; } - Vec3d ep = Objects.requireNonNull(CoffeeClientMain.client.player).getEyePos(); + Vec3d ep = Objects.requireNonNull(ShadowMain.client.player).getEyePos(); Entity nearestApplicable = null; - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (entity.getType() == EntityType.ENDERMAN) { continue; } - if (!(entity instanceof LivingEntity ent) || !ent.isAttackable() || ent.isDead() || entity.equals(CoffeeClientMain.client.player)) { + if (!(entity instanceof LivingEntity ent) || !ent.isAttackable() || ent.isDead() || entity.equals(ShadowMain.client.player)) { continue; } Vec3d origin = entity.getPos(); float h = entity.getHeight(); Vec3d upper = origin.add(0, h, 0); Vec3d center = entity.getPos().add(0, h / 2f, 0); - if (Utils.Math.isABObstructed(ep, center, CoffeeClientMain.client.world, CoffeeClientMain.client.player)) { + if (Utils.Math.isABObstructed(ep, center, ShadowMain.client.world, ShadowMain.client.player)) { continue; } if (ep.y < upper.y && ep.y > origin.y) { // entity's on our Y - if (nearestApplicable == null || nearestApplicable.distanceTo(CoffeeClientMain.client.player) > origin.distanceTo(CoffeeClientMain.client.player.getPos())) { + if (nearestApplicable == null || nearestApplicable.distanceTo(ShadowMain.client.player) > origin.distanceTo(ShadowMain.client.player.getPos())) { nearestApplicable = entity; } } @@ -88,14 +88,14 @@ public class InstaBow extends Module { if (nearestApplicable == null) { return; } - if (CoffeeClientMain.client.player.isUsingItem() && CoffeeClientMain.client.player.getMainHandStack().getItem() == Items.BOW) { - BowItem be = (BowItem) CoffeeClientMain.client.player.getMainHandStack().getItem(); - int p = be.getMaxUseTime(null) - CoffeeClientMain.client.player.getItemUseTimeLeft(); + if (ShadowMain.client.player.isUsingItem() && ShadowMain.client.player.getMainHandStack().getItem() == Items.BOW) { + BowItem be = (BowItem) ShadowMain.client.player.getMainHandStack().getItem(); + int p = be.getMaxUseTime(null) - ShadowMain.client.player.getItemUseTimeLeft(); if (BowItem.getPullProgress(p) > 0.1) { Rotations.lookAtV3(nearestApplicable.getPos().add(0, nearestApplicable.getHeight() / 2f, 0)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()) - .sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(Rotations.getClientYaw(), Rotations.getClientPitch(), CoffeeClientMain.client.player.isOnGround())); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).stopUsingItem(CoffeeClientMain.client.player); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()) + .sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(Rotations.getClientYaw(), Rotations.getClientPitch(), ShadowMain.client.player.isOnGround())); + Objects.requireNonNull(ShadowMain.client.interactionManager).stopUsingItem(ShadowMain.client.player); } } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/NoComCrash.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/NoComCrash.java index 5000b8f..cf7dfa3 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/NoComCrash.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/NoComCrash.java @@ -16,7 +16,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -43,7 +43,7 @@ public class NoComCrash extends Module { Vec3d cpos = pickRandomPos(); if (method.getValue() == Method.Interact) { PlayerInteractBlockC2SPacket packet = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(cpos, Direction.DOWN, new BlockPos(cpos), false)); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(packet); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(packet); } else { ItemStack stack = new ItemStack(Items.OAK_SIGN, 1); NbtCompound nbt = stack.getOrCreateSubNbt("BlockEntityTag"); @@ -52,7 +52,7 @@ public class NoComCrash extends Module { nbt.putInt("z", (int) cpos.z); // stack.setSubNbt("BlockEntityTag", nbt); CreativeInventoryActionC2SPacket packet = new CreativeInventoryActionC2SPacket(1, stack); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(packet); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(packet); } this.i++; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/OOBCrash.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/OOBCrash.java index 3ef3efe..ebc2590 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/OOBCrash.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/OOBCrash.java @@ -12,7 +12,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.font.FontRenderers; @@ -38,10 +38,10 @@ public class OOBCrash extends Module { } void doIt() { - BlockHitResult bhr = new BlockHitResult(Objects.requireNonNull(CoffeeClientMain.client.player) + BlockHitResult bhr = new BlockHitResult(Objects.requireNonNull(ShadowMain.client.player) .getPos(), Direction.DOWN, new BlockPos(new Vec3d(Double.POSITIVE_INFINITY, 5, Double.POSITIVE_INFINITY)), false); PlayerInteractBlockC2SPacket p = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); Utils.Logging.message("Wait a bit for this to complete, the server will run fine until it autosaves the world. After that, it will just brick itself."); setEnabled(false); } @@ -86,7 +86,7 @@ public class OOBCrash extends Module { @Override public void onHudRender() { if (current != null) { - FontRenderers.getRenderer().drawCenteredString(Renderer.R3D.getEmptyMatrixStack(), current.t, CoffeeClientMain.client.getWindow().getScaledWidth() / 2f, CoffeeClientMain.client.getWindow() + FontRenderers.getRenderer().drawCenteredString(Renderer.R3D.getEmptyMatrixStack(), current.t, ShadowMain.client.getWindow().getScaledWidth() / 2f, ShadowMain.client.getWindow() .getScaledHeight() / 2f, 0xFFFFFF); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/OffhandCrash.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/OffhandCrash.java index 6f39f77..acea4af 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/OffhandCrash.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/OffhandCrash.java @@ -9,7 +9,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleRegistry; @@ -28,12 +28,12 @@ public class OffhandCrash extends Module { @Override public void tick() { try { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { throw new Exception(); } PlayerActionC2SPacket p = new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN); for (int i = 0; i < a.getValue(); i++) { - CoffeeClientMain.client.getNetworkHandler().sendPacket(p); + ShadowMain.client.getNetworkHandler().sendPacket(p); } } catch (Exception ignored) { this.setEnabled(false); diff --git a/src/main/java/net/shadow/client/feature/module/impl/exploit/PingSpoof.java b/src/main/java/net/shadow/client/feature/module/impl/exploit/PingSpoof.java index 572373e..2b1d96a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/exploit/PingSpoof.java +++ b/src/main/java/net/shadow/client/feature/module/impl/exploit/PingSpoof.java @@ -9,7 +9,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.Packet; import net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayPongC2SPacket; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -84,7 +84,7 @@ public class PingSpoof extends Module { @Override public void onFastTick_NWC() { - if (CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.getNetworkHandler() == null) { setEnabled(false); return; } @@ -93,7 +93,7 @@ public class PingSpoof extends Module { if (entry.entryTime + entry.delay <= c) { dontRepeat.add(entry.packet); entries.remove(entry); - CoffeeClientMain.client.getNetworkHandler().sendPacket(entry.packet); + ShadowMain.client.getNetworkHandler().sendPacket(entry.packet); } } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/fun/AutoTrap.java b/src/main/java/net/shadow/client/feature/module/impl/fun/AutoTrap.java index 062ce5d..bc698f1 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/fun/AutoTrap.java +++ b/src/main/java/net/shadow/client/feature/module/impl/fun/AutoTrap.java @@ -11,7 +11,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.render.Renderer; @@ -56,7 +56,7 @@ public class AutoTrap extends Module { boolean smallMatches = Arrays.stream(buildOffsetsSmall).allMatch(ints -> { BlockPos a = bp.add(ints[0], ints[1], ints[2]); - return Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(a).getMaterial().blocksMovement(); + return Objects.requireNonNull(ShadowMain.client.world).getBlockState(a).getMaterial().blocksMovement(); }); if (smallMatches) { return true; @@ -67,7 +67,7 @@ public class AutoTrap extends Module { Vec3d potentialHome = entityPos.add(ints[0], ints[1], ints[2]); boolean matches = Arrays.stream(buildOffsetsBig).allMatch(ints1 -> { BlockPos a = new BlockPos(potentialHome.add(ints1[0], ints1[1], ints1[2])); - return CoffeeClientMain.client.world.getBlockState(a).getMaterial().blocksMovement(); + return ShadowMain.client.world.getBlockState(a).getMaterial().blocksMovement(); }); if (matches) { return true; @@ -77,13 +77,13 @@ public class AutoTrap extends Module { } boolean inHitRange(Entity attacker, Vec3d pos) { - return attacker.getCameraPosVec(1f).distanceTo(pos) <= Objects.requireNonNull(CoffeeClientMain.client.interactionManager).getReachDistance() + .5; + return attacker.getCameraPosVec(1f).distanceTo(pos) <= Objects.requireNonNull(ShadowMain.client.interactionManager).getReachDistance() + .5; } @Override public void onFastTick() { - for (Entity player : Objects.requireNonNull(CoffeeClientMain.client.world).getPlayers()) { - if (player.equals(CoffeeClientMain.client.player)) { + for (Entity player : Objects.requireNonNull(ShadowMain.client.world).getPlayers()) { + if (player.equals(ShadowMain.client.player)) { continue; } if (isTrappedAlready(player)) { @@ -103,14 +103,14 @@ public class AutoTrap extends Module { double[][] filteredPlan = Arrays.stream(planToUse).filter(ints -> { Vec3d v = player.getPos().add(new Vec3d(ints[0], ints[1], ints[2])); - return inHitRange(CoffeeClientMain.client.player, v.add(.5, .5, .5)); + return inHitRange(ShadowMain.client.player, v.add(.5, .5, .5)); }).toList().toArray(double[][]::new); int slot = -1; for (int i = 0; i < 9; i++) { - ItemStack real = CoffeeClientMain.client.player.getInventory().getStack(i); + ItemStack real = ShadowMain.client.player.getInventory().getStack(i); if (real.getItem() instanceof BlockItem bi && Block.isShapeFullCube(bi.getBlock() - .getOutlineShape(bi.getBlock().getDefaultState(), CoffeeClientMain.client.world, new BlockPos(0, 0, 0), ShapeContext.absent()))) { + .getOutlineShape(bi.getBlock().getDefaultState(), ShadowMain.client.world, new BlockPos(0, 0, 0), ShapeContext.absent()))) { slot = i; } } @@ -120,19 +120,19 @@ public class AutoTrap extends Module { int finalSlot = slot; // make sure we're in sync - CoffeeClientMain.client.execute(() -> { - int selSlot = CoffeeClientMain.client.player.getInventory().selectedSlot; - CoffeeClientMain.client.player.getInventory().selectedSlot = finalSlot; + ShadowMain.client.execute(() -> { + int selSlot = ShadowMain.client.player.getInventory().selectedSlot; + ShadowMain.client.player.getInventory().selectedSlot = finalSlot; for (double[] ints : filteredPlan) { BlockPos current = new BlockPos(pos.add(ints[0], ints[1], ints[2])); - if (!CoffeeClientMain.client.world.getBlockState(current).isAir()) { + if (!ShadowMain.client.world.getBlockState(current).isAir()) { continue; } BlockHitResult bhr = new BlockHitResult(Vec3d.of(current), Direction.DOWN, current, false); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).interactBlock(CoffeeClientMain.client.player, CoffeeClientMain.client.world, Hand.MAIN_HAND, bhr); + Objects.requireNonNull(ShadowMain.client.interactionManager).interactBlock(ShadowMain.client.player, ShadowMain.client.world, Hand.MAIN_HAND, bhr); } - CoffeeClientMain.client.player.getInventory().selectedSlot = selSlot; + ShadowMain.client.player.getInventory().selectedSlot = selSlot; }); } } @@ -160,8 +160,8 @@ public class AutoTrap extends Module { @Override public void onWorldRender(MatrixStack matrices) { if (isDebuggerEnabled()) { - for (Entity player : Objects.requireNonNull(CoffeeClientMain.client.world).getPlayers()) { - if (player.equals(CoffeeClientMain.client.player)) { + for (Entity player : Objects.requireNonNull(ShadowMain.client.world).getPlayers()) { + if (player.equals(ShadowMain.client.player)) { continue; } if (isTrappedAlready(player)) { @@ -182,11 +182,11 @@ public class AutoTrap extends Module { for (double[] ints : planToUse) { BlockPos current = new BlockPos(pos.add(ints[0], ints[1], ints[2])); Vec3d v3 = Vec3d.of(current); - if (!inHitRange(CoffeeClientMain.client.player, v3.add(.5, .5, .5))) { + if (!inHitRange(ShadowMain.client.player, v3.add(.5, .5, .5))) { Renderer.R3D.renderOutline(v3, new Vec3d(1, 1, 1), Color.RED, matrices); continue; } - if (!CoffeeClientMain.client.world.getBlockState(current).isAir()) { + if (!ShadowMain.client.world.getBlockState(current).isAir()) { Renderer.R3D.renderOutline(v3, new Vec3d(1, 1, 1), Color.BLUE, matrices); continue; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/fun/FakeHacker.java b/src/main/java/net/shadow/client/feature/module/impl/fun/FakeHacker.java index f7a2508..5d75215 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/fun/FakeHacker.java +++ b/src/main/java/net/shadow/client/feature/module/impl/fun/FakeHacker.java @@ -7,7 +7,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.Hand; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -30,15 +30,15 @@ public class FakeHacker extends Module { if (!this.isEnabled()) { return; } - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } - if (CoffeeClientMain.client.currentScreen != null) { + if (ShadowMain.client.currentScreen != null) { return; } MouseEvent me = (MouseEvent) event; if (me.getAction() == 1 && me.getButton() == 2) { - HitResult hr = CoffeeClientMain.client.crosshairTarget; + HitResult hr = ShadowMain.client.crosshairTarget; if (hr instanceof EntityHitResult ehr && ehr.getEntity() instanceof PlayerEntity pe) { target = pe; } @@ -49,7 +49,7 @@ public class FakeHacker extends Module { @Override public void tick() { if (target != null) { - Iterable<Entity> entities = Objects.requireNonNull(CoffeeClientMain.client.world).getEntities(); + Iterable<Entity> entities = Objects.requireNonNull(ShadowMain.client.world).getEntities(); List<Entity> entities1 = new ArrayList<>(StreamSupport.stream(entities.spliterator(), false).toList()); Collections.shuffle(entities1); for (Entity entity : entities1) { diff --git a/src/main/java/net/shadow/client/feature/module/impl/fun/Spinner.java b/src/main/java/net/shadow/client/feature/module/impl/fun/Spinner.java index 1a2e58a..9d81dec 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/fun/Spinner.java +++ b/src/main/java/net/shadow/client/feature/module/impl/fun/Spinner.java @@ -9,7 +9,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -61,9 +61,9 @@ public class Spinner extends Module { Rotations.setClientPitch((float) ((Math.random() * 60) - 30)); Rotations.setClientYaw((float) (Math.random() * 360)); PlayerInteractItemC2SPacket p = new PlayerInteractItemC2SPacket(Hand.MAIN_HAND); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); - PlayerMoveC2SPacket p1 = new PlayerMoveC2SPacket.LookAndOnGround((float) r, Rotations.getClientPitch(), Objects.requireNonNull(CoffeeClientMain.client.player).isOnGround()); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p1); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); + PlayerMoveC2SPacket p1 = new PlayerMoveC2SPacket.LookAndOnGround((float) r, Rotations.getClientPitch(), Objects.requireNonNull(ShadowMain.client.player).isOnGround()); + ShadowMain.client.getNetworkHandler().sendPacket(p1); } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/fun/Test.java b/src/main/java/net/shadow/client/feature/module/impl/fun/Test.java index 8a35e7c..27b921a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/fun/Test.java +++ b/src/main/java/net/shadow/client/feature/module/impl/fun/Test.java @@ -6,7 +6,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.Matrix4f; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3f; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.ColorSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -45,7 +45,7 @@ public class Test extends Module { @Override public void onWorldRender(MatrixStack s) { - Camera camera = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera camera = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = camera.getPos(); MatrixStack stack = new MatrixStack(); stack.push(); diff --git a/src/main/java/net/shadow/client/feature/module/impl/fun/TpRange.java b/src/main/java/net/shadow/client/feature/module/impl/fun/TpRange.java index 3fad0e0..bf09dce 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/fun/TpRange.java +++ b/src/main/java/net/shadow/client/feature/module/impl/fun/TpRange.java @@ -9,7 +9,7 @@ import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; @@ -41,10 +41,10 @@ public class TpRange extends Module { if (!this.isEnabled()) { return; } - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } - if (CoffeeClientMain.client.currentScreen != null) { + if (ShadowMain.client.currentScreen != null) { return; } MouseEvent me = (MouseEvent) event; @@ -68,28 +68,28 @@ public class TpRange extends Module { } void doIt() { - Vec3d goal = Objects.requireNonNull(CoffeeClientMain.client.player).getRotationVec(1f).multiply(200); - Box b = CoffeeClientMain.client.player.getBoundingBox().stretch(goal).expand(1, 1, 1); - EntityHitResult ehr = ProjectileUtil.raycast(CoffeeClientMain.client.player, CoffeeClientMain.client.player.getCameraPosVec(0), CoffeeClientMain.client.player.getCameraPosVec(0) + Vec3d goal = Objects.requireNonNull(ShadowMain.client.player).getRotationVec(1f).multiply(200); + Box b = ShadowMain.client.player.getBoundingBox().stretch(goal).expand(1, 1, 1); + EntityHitResult ehr = ProjectileUtil.raycast(ShadowMain.client.player, ShadowMain.client.player.getCameraPosVec(0), ShadowMain.client.player.getCameraPosVec(0) .add(goal), b, Entity::isAttackable, 200 * 200); if (ehr == null) { return; } Vec3d pos = ehr.getPos(); - Vec3d orig = CoffeeClientMain.client.player.getPos(); + Vec3d orig = ShadowMain.client.player.getPos(); if (mode.getValue() == Mode.PaperBypass) { teleportTo(orig, pos); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).attackEntity(CoffeeClientMain.client.player, ehr.getEntity()); + Objects.requireNonNull(ShadowMain.client.interactionManager).attackEntity(ShadowMain.client.player, ehr.getEntity()); Utils.sleep(100); teleportTo(pos, orig); - CoffeeClientMain.client.player.updatePosition(orig.x, orig.y, orig.z); + ShadowMain.client.player.updatePosition(orig.x, orig.y, orig.z); } else { PlayerMoveC2SPacket tpToEntity = new PlayerMoveC2SPacket.PositionAndOnGround(pos.x, pos.y, pos.z, false); PlayerMoveC2SPacket tpBack = new PlayerMoveC2SPacket.PositionAndOnGround(orig.x, orig.y, orig.z, true); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(tpToEntity); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).attackEntity(CoffeeClientMain.client.player, ehr.getEntity()); - CoffeeClientMain.client.getNetworkHandler().sendPacket(tpBack); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(tpToEntity); + Objects.requireNonNull(ShadowMain.client.interactionManager).attackEntity(ShadowMain.client.player, ehr.getEntity()); + ShadowMain.client.getNetworkHandler().sendPacket(tpBack); } } @@ -107,13 +107,13 @@ public class TpRange extends Module { double newY = MathHelper.lerp(prog, from.y, pos.y); double newZ = MathHelper.lerp(prog, from.z, pos.z); PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.PositionAndOnGround(newX, newY, newZ, true); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); previousSpoofedPos = spoofedPos; spoofedPos = new Vec3d(newX, newY, newZ); Utils.sleep(10); } PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.PositionAndOnGround(pos.x, pos.y, pos.z, true); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); previousSpoofedPos = null; spoofedPos = null; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/AntiCrash.java b/src/main/java/net/shadow/client/feature/module/impl/misc/AntiCrash.java index 555a7fe..8c9814b 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/AntiCrash.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/AntiCrash.java @@ -5,7 +5,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket; import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.gui.notifications.Notification; @@ -107,7 +107,7 @@ public class AntiCrash extends Module { } } if (pe.getPacket() instanceof ParticleS2CPacket p && capParticles.getValue()) { - int partTotal = ((ParticleManagerDuck) CoffeeClientMain.client.particleManager).getTotalParticles(); + int partTotal = ((ParticleManagerDuck) ShadowMain.client.particleManager).getTotalParticles(); int newCount = partTotal + p.getCount(); if (newCount >= particleMax.getValue()) { int space = (int) Math.floor(particleMax.getValue() - partTotal); diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/FireballDeflector.java b/src/main/java/net/shadow/client/feature/module/impl/misc/FireballDeflector.java index d2f0096..6256934 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/FireballDeflector.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/FireballDeflector.java @@ -6,7 +6,7 @@ import net.minecraft.entity.projectile.FireballEntity; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -40,27 +40,27 @@ public class FireballDeflector extends Module { Entity owner = fe.getOwner(); if (owner != null) { // we are the owner of this fireball = we shot it = dont hit it again - if (owner.equals(CoffeeClientMain.client.player)) { + if (owner.equals(ShadowMain.client.player)) { return; } if (mode.getValue() == Mode.ReflectBack) { Vec2f pitchYaw = Rotations.getPitchYawFromOtherEntity(fe.getPos().add(0, fe.getHeight() / 2, 0), owner.getPos().add(0, owner.getHeight() / 2, 0)); - PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.LookAndOnGround(pitchYaw.y, pitchYaw.x, CoffeeClientMain.client.player.isOnGround()); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.LookAndOnGround(pitchYaw.y, pitchYaw.x, ShadowMain.client.player.isOnGround()); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); } } - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).attackEntity(CoffeeClientMain.client.player, fe); + Objects.requireNonNull(ShadowMain.client.interactionManager).attackEntity(ShadowMain.client.player, fe); } boolean inHitRange(Entity attacker, Entity target) { - return attacker.getCameraPosVec(1f).distanceTo(target.getPos().add(0, target.getHeight() / 2, 0)) <= Objects.requireNonNull(CoffeeClientMain.client.interactionManager).getReachDistance(); + return attacker.getCameraPosVec(1f).distanceTo(target.getPos().add(0, target.getHeight() / 2, 0)) <= Objects.requireNonNull(ShadowMain.client.interactionManager).getReachDistance(); } @Override public void onFastTick() { - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (entity instanceof FireballEntity fe) { - if (inHitRange(Objects.requireNonNull(CoffeeClientMain.client.player), fe) && isApproaching(CoffeeClientMain.client.player.getPos(), fe.getPos(), fe.getVelocity())) { + if (inHitRange(Objects.requireNonNull(ShadowMain.client.player), fe) && isApproaching(ShadowMain.client.player.getPos(), fe.getPos(), fe.getVelocity())) { hit(fe); } } @@ -90,16 +90,16 @@ public class FireballDeflector extends Module { @Override public void onWorldRender(MatrixStack matrices) { if (isDebuggerEnabled()) { - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { if (entity instanceof FireballEntity fe) { if (fe.getOwner() != null) { Entity owner = fe.getOwner(); Renderer.R3D.renderLine(Utils.getInterpolatedEntityPosition(owner).add(0, owner.getHeight() / 2, 0), Utils.getInterpolatedEntityPosition(fe) .add(0, fe.getHeight() / 2, 0), Color.MAGENTA, matrices); } - if (inHitRange(Objects.requireNonNull(CoffeeClientMain.client.player), fe)) { - Renderer.R3D.renderLine(Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player) - .add(0, CoffeeClientMain.client.player.getHeight() / 2, 0), Utils.getInterpolatedEntityPosition(fe).add(0, fe.getHeight() / 2, 0), Color.RED, matrices); + if (inHitRange(Objects.requireNonNull(ShadowMain.client.player), fe)) { + Renderer.R3D.renderLine(Utils.getInterpolatedEntityPosition(ShadowMain.client.player) + .add(0, ShadowMain.client.player.getHeight() / 2, 0), Utils.getInterpolatedEntityPosition(fe).add(0, fe.getHeight() / 2, 0), Color.RED, matrices); } } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/NoTitles.java b/src/main/java/net/shadow/client/feature/module/impl/misc/NoTitles.java index 068457e..757090b 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/NoTitles.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/NoTitles.java @@ -9,7 +9,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.s2c.play.SubtitleS2CPacket; import net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket; import net.minecraft.network.packet.s2c.play.TitleS2CPacket; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -41,7 +41,7 @@ public class NoTitles extends Module { event.setCancelled(true); } else if (pe.getPacket() instanceof SubtitleS2CPacket || pe.getPacket() instanceof TitleFadeS2CPacket) { event.setCancelled(true); - CoffeeClientMain.client.inGameHud.setDefaultTitleFade(); + ShadowMain.client.inGameHud.setDefaultTitleFade(); } }); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/ShulkerDeflector.java b/src/main/java/net/shadow/client/feature/module/impl/misc/ShulkerDeflector.java index fa1df89..42e154d 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/ShulkerDeflector.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/ShulkerDeflector.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.module.impl.misc; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.ShulkerBulletEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -23,17 +23,17 @@ public class ShulkerDeflector extends Module { } boolean inHitRange(Entity attacker, Entity target) { - return attacker.getCameraPosVec(1f).distanceTo(target.getPos().add(0, target.getHeight() / 2, 0)) <= Objects.requireNonNull(CoffeeClientMain.client.interactionManager).getReachDistance(); + return attacker.getCameraPosVec(1f).distanceTo(target.getPos().add(0, target.getHeight() / 2, 0)) <= Objects.requireNonNull(ShadowMain.client.interactionManager).getReachDistance(); } @Override public void onFastTick() { - for (Entity entity : Objects.requireNonNull(CoffeeClientMain.client.world).getEntities()) { - if (entity instanceof ShulkerBulletEntity sbe && inHitRange(Objects.requireNonNull(CoffeeClientMain.client.player), sbe)) { - if (checkOwner.getValue() && sbe.getOwner() != null && sbe.getOwner().equals(CoffeeClientMain.client.player)) { + for (Entity entity : Objects.requireNonNull(ShadowMain.client.world).getEntities()) { + if (entity instanceof ShulkerBulletEntity sbe && inHitRange(Objects.requireNonNull(ShadowMain.client.player), sbe)) { + if (checkOwner.getValue() && sbe.getOwner() != null && sbe.getOwner().equals(ShadowMain.client.player)) { continue; } - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).attackEntity(CoffeeClientMain.client.player, sbe); + Objects.requireNonNull(ShadowMain.client.interactionManager).attackEntity(ShadowMain.client.player, sbe); } } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/AirJump.java b/src/main/java/net/shadow/client/feature/module/impl/movement/AirJump.java index a62d26e..b02f292 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/AirJump.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/AirJump.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -18,12 +18,12 @@ public class AirJump extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - if (CoffeeClientMain.client.options.jumpKey.isPressed()) { - CoffeeClientMain.client.player.setOnGround(true); - CoffeeClientMain.client.player.fallDistance = 0f; + if (ShadowMain.client.options.jumpKey.isPressed()) { + ShadowMain.client.player.setOnGround(true); + ShadowMain.client.player.fallDistance = 0f; } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/AntiAnvil.java b/src/main/java/net/shadow/client/feature/module/impl/movement/AntiAnvil.java index af5ef13..c7cea81 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/AntiAnvil.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/AntiAnvil.java @@ -8,7 +8,7 @@ import net.minecraft.entity.FallingBlockEntity; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -24,9 +24,9 @@ public class AntiAnvil extends Module { @Override public void tick() { // Vec3d currentPos = CoffeeClientMain.client.player.getPos(); - BlockPos currentPos = Objects.requireNonNull(CoffeeClientMain.client.player).getBlockPos(); - Vec3d ppos = CoffeeClientMain.client.player.getPos(); - List<Entity> anvils = StreamSupport.stream(Objects.requireNonNull(CoffeeClientMain.client.world).getEntities().spliterator(), false).filter(entity -> { + BlockPos currentPos = Objects.requireNonNull(ShadowMain.client.player).getBlockPos(); + Vec3d ppos = ShadowMain.client.player.getPos(); + List<Entity> anvils = StreamSupport.stream(Objects.requireNonNull(ShadowMain.client.world).getEntities().spliterator(), false).filter(entity -> { if (entity instanceof FallingBlockEntity e) { Block bs = e.getBlockState().getBlock(); return bs == Blocks.ANVIL || bs == Blocks.CHIPPED_ANVIL || bs == Blocks.DAMAGED_ANVIL; @@ -40,7 +40,7 @@ public class AntiAnvil extends Module { double yDist = anvilPos.y - ppos.y; if (yDist > 0 && yDist < -anvil.getVelocity().y * 2) { // anvil is 0-1 blocks above our feet PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.PositionAndOnGround(ppos.x, ppos.y + 1, ppos.z, false); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); // CoffeeClientMain.client.player.updatePosition(ppos.x,ppos.y+1,ppos.z); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/AutoElytra.java b/src/main/java/net/shadow/client/feature/module/impl/movement/AutoElytra.java index c7a21b5..753d15b 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/AutoElytra.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/AutoElytra.java @@ -8,7 +8,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -27,15 +27,15 @@ public class AutoElytra extends Module { } boolean equippedElytra() { - return Objects.requireNonNull(CoffeeClientMain.client.player).getInventory().armor.get(2).getItem() == Items.ELYTRA; + return Objects.requireNonNull(ShadowMain.client.player).getInventory().armor.get(2).getItem() == Items.ELYTRA; } @Override public void tick() { - if (Objects.requireNonNull(CoffeeClientMain.client.player).fallDistance > fallDist.getValue()) { + if (Objects.requireNonNull(ShadowMain.client.player).fallDistance > fallDist.getValue()) { if (!equippedElytra()) { // do we not have an elytra equipped? for (int i = 0; i < (9 * 4 + 1); i++) { // gotta equip - ItemStack stack = CoffeeClientMain.client.player.getInventory().getStack(i); // is it an elytra? + ItemStack stack = ShadowMain.client.player.getInventory().getStack(i); // is it an elytra? if (stack.getItem() == Items.ELYTRA) { Utils.Inventory.moveStackToOther(Utils.Inventory.slotIndexToId(i), 6); // equip break; // we found the item, cancel the loop @@ -57,7 +57,7 @@ public class AutoElytra extends Module { @Override public String getContext() { - float fd = Objects.requireNonNull(CoffeeClientMain.client.player).fallDistance; + float fd = Objects.requireNonNull(ShadowMain.client.player).fallDistance; if (fd > fallDist.getMin()) { return Utils.Math.roundToDecimal(fd, 1) + " | " + fallDist.getValue(); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Backtrack.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Backtrack.java index 99d1e51..0dbbfea 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Backtrack.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Backtrack.java @@ -4,7 +4,7 @@ import net.minecraft.client.util.InputUtil; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.event.EventType; @@ -36,11 +36,11 @@ public class Backtrack extends Module { } boolean shouldBacktrack() { - return InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_ALT) && CoffeeClientMain.client.currentScreen == null; + return InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_LEFT_ALT) && ShadowMain.client.currentScreen == null; } void shouldCommit() { - boolean a = !committed && InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_ENTER) && CoffeeClientMain.client.currentScreen == null; + boolean a = !committed && InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), GLFW.GLFW_KEY_ENTER) && ShadowMain.client.currentScreen == null; if (a) { committed = true; } @@ -52,10 +52,10 @@ public class Backtrack extends Module { } void moveTo(PositionEntry e) { - CoffeeClientMain.client.player.updatePosition(e.pos.x, e.pos.y, e.pos.z); - CoffeeClientMain.client.player.setPitch((float) e.pitch); - CoffeeClientMain.client.player.setYaw((float) e.yaw); - CoffeeClientMain.client.player.setVelocity(e.vel); + ShadowMain.client.player.updatePosition(e.pos.x, e.pos.y, e.pos.z); + ShadowMain.client.player.setPitch((float) e.pitch); + ShadowMain.client.player.setYaw((float) e.yaw); + ShadowMain.client.player.setVelocity(e.vel); } @Override @@ -69,7 +69,7 @@ public class Backtrack extends Module { public void disable() { entries.clear(); committed = false; - CoffeeClientMain.client.player.setNoGravity(false); + ShadowMain.client.player.setNoGravity(false); } @Override @@ -82,9 +82,9 @@ public class Backtrack extends Module { shouldCommit(); if (!shouldBacktrack() && !committed) { - entries.add(new PositionEntry(Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player), CoffeeClientMain.client.player.getVelocity(), CoffeeClientMain.client.player.getPitch(), CoffeeClientMain.client.player.getYaw())); + entries.add(new PositionEntry(Utils.getInterpolatedEntityPosition(ShadowMain.client.player), ShadowMain.client.player.getVelocity(), ShadowMain.client.player.getPitch(), ShadowMain.client.player.getYaw())); } else if (committed) { - CoffeeClientMain.client.player.setNoGravity(true); + ShadowMain.client.player.setNoGravity(true); moveTo(entries.get(0)); entries.remove(0); if (entries.isEmpty()) { diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/BlocksmcFlight.java b/src/main/java/net/shadow/client/feature/module/impl/movement/BlocksmcFlight.java index 8b5d585..4ccbf9e 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/BlocksmcFlight.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/BlocksmcFlight.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.render.Renderer; @@ -28,10 +28,10 @@ public class BlocksmcFlight extends Module { if (jumpTimeout < 0) { jumpTimeout = 0; } - if (CoffeeClientMain.client.player.getPos().y < yStart && jumpTimeout == 0) { - CoffeeClientMain.client.player.jump(); + if (ShadowMain.client.player.getPos().y < yStart && jumpTimeout == 0) { + ShadowMain.client.player.jump(); AnimatedCircle ac = new AnimatedCircle(); - ac.spawnPos = CoffeeClientMain.client.player.getPos(); + ac.spawnPos = ShadowMain.client.player.getPos(); circles.add(ac); jumpTimeout = 5; } @@ -39,7 +39,7 @@ public class BlocksmcFlight extends Module { @Override public void enable() { - yStart = CoffeeClientMain.client.player.getPos().y; + yStart = ShadowMain.client.player.getPos().y; } @Override @@ -55,7 +55,7 @@ public class BlocksmcFlight extends Module { @Override public void onWorldRender(MatrixStack matrices) { - Vec3d ppos = Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player); + Vec3d ppos = Utils.getInterpolatedEntityPosition(ShadowMain.client.player); Vec3d renderPos = new Vec3d(ppos.x, yStart, ppos.z); Renderer.R3D.renderOutline(renderPos.subtract(1, 0, 1), new Vec3d(2, 0, 2), Color.RED, matrices); circles.removeIf(animatedCircle -> animatedCircle.animProg > 1); diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/BoatPhase.java b/src/main/java/net/shadow/client/feature/module/impl/movement/BoatPhase.java index 53bb0e8..04bbda4 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/BoatPhase.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/BoatPhase.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.vehicle.BoatEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -41,17 +41,17 @@ public class BoatPhase extends Module { @Override public void onWorldRender(MatrixStack matrices) { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - if (!(CoffeeClientMain.client.player.getVehicle() instanceof BoatEntity)) { + if (!(ShadowMain.client.player.getVehicle() instanceof BoatEntity)) { Notification.create(5000, "Boat phase", true, Notification.Type.INFO, "sir you need a boat"); setEnabled(false); return; } - CoffeeClientMain.client.player.getVehicle().noClip = true; - CoffeeClientMain.client.player.getVehicle().setNoGravity(true); - CoffeeClientMain.client.player.noClip = true; + ShadowMain.client.player.getVehicle().noClip = true; + ShadowMain.client.player.getVehicle().setNoGravity(true); + ShadowMain.client.player.noClip = true; } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Boost.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Boost.java index 4449da1..c40da2a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Boost.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Boost.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -29,15 +29,15 @@ public class Boost extends Module { @Override public void enable() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } setEnabled(false); - Vec3d newVelocity = CoffeeClientMain.client.player.getRotationVector().multiply(strength.getValue()); + Vec3d newVelocity = ShadowMain.client.player.getRotationVector().multiply(strength.getValue()); if (this.mode.getValue() == Mode.Add) { - CoffeeClientMain.client.player.addVelocity(newVelocity.x, newVelocity.y, newVelocity.z); + ShadowMain.client.player.addVelocity(newVelocity.x, newVelocity.y, newVelocity.z); } else { - CoffeeClientMain.client.player.setVelocity(newVelocity); + ShadowMain.client.player.setVelocity(newVelocity); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeJump.java b/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeJump.java index 966d2e0..ae2a083 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeJump.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeJump.java @@ -7,7 +7,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.Box; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -21,17 +21,17 @@ public class EdgeJump extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } - if (!CoffeeClientMain.client.player.isOnGround() || CoffeeClientMain.client.player.isSneaking()) { + if (!ShadowMain.client.player.isOnGround() || ShadowMain.client.player.isSneaking()) { return; } - Box bounding = CoffeeClientMain.client.player.getBoundingBox(); + Box bounding = ShadowMain.client.player.getBoundingBox(); bounding = bounding.offset(0, -0.5, 0); bounding = bounding.expand(-0.001, 0, -0.001); - if (!CoffeeClientMain.client.world.getBlockCollisions(client.player, bounding).iterator().hasNext()) { + if (!ShadowMain.client.world.getBlockCollisions(client.player, bounding).iterator().hasNext()) { Objects.requireNonNull(client.player).jump(); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeSneak.java b/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeSneak.java index 82ac125..a70a5be 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeSneak.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/EdgeSneak.java @@ -11,7 +11,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -25,10 +25,10 @@ public class EdgeSneak extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } - Box bounding = CoffeeClientMain.client.player.getBoundingBox(); + Box bounding = ShadowMain.client.player.getBoundingBox(); bounding = bounding.offset(0, -1, 0); bounding = bounding.expand(0.3); boolean sneak = false; @@ -36,8 +36,8 @@ public class EdgeSneak extends Module { for (int z = -1; z < 2; z++) { double xScale = x / 3d + .5; double zScale = z / 3d + .5; - BlockPos current = CoffeeClientMain.client.player.getBlockPos().add(x, -1, z); - BlockState bs = CoffeeClientMain.client.world.getBlockState(current); + BlockPos current = ShadowMain.client.player.getBlockPos().add(x, -1, z); + BlockState bs = ShadowMain.client.world.getBlockState(current); if (bs.isAir() && bounding.contains(new Vec3d(current.getX() + xScale, current.getY() + 1, current.getZ() + zScale))) { sneak = true; break; @@ -45,7 +45,7 @@ public class EdgeSneak extends Module { } } //STL.notifyUser(sneak+""); - boolean previousState = InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), client.options.sneakKey.getDefaultKey().getCode()); + boolean previousState = InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), client.options.sneakKey.getDefaultKey().getCode()); if (Objects.requireNonNull(client.player).isOnGround()) { client.options.sneakKey.setPressed(sneak || previousState); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/EntityFly.java b/src/main/java/net/shadow/client/feature/module/impl/movement/EntityFly.java index 95e62fd..c99d9c0 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/EntityFly.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/EntityFly.java @@ -12,7 +12,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.mob.MobEntity; import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.util.Utils; @@ -31,10 +31,10 @@ public class EntityFly extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - Entity vehicle = CoffeeClientMain.client.player.getVehicle(); + Entity vehicle = ShadowMain.client.player.getVehicle(); if (vehicle == null) { return; } @@ -43,7 +43,7 @@ public class EntityFly extends Module { if (vehicle instanceof MobEntity) { ((MobEntity) vehicle).setAiDisabled(true); } - GameOptions go = CoffeeClientMain.client.options; + GameOptions go = ShadowMain.client.options; float y = Objects.requireNonNull(client.player).getYaw(); int mx = 0, my = 0, mz = 0; if (go.jumpKey.isPressed()) { diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Flight.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Flight.java index 21e433b..f19ce60 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Flight.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Flight.java @@ -6,7 +6,7 @@ import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.particle.ParticleTypes; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -46,7 +46,7 @@ public class Flight extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null || ShadowMain.client.getNetworkHandler() == null) { return; } double speed = this.speed.getValue(); @@ -54,19 +54,19 @@ public class Flight extends Module { bypassTimer++; if (bypassTimer > 10) { bypassTimer = 0; - Vec3d p = CoffeeClientMain.client.player.getPos(); - CoffeeClientMain.client.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.x, p.y - 0.2, p.z, false)); - CoffeeClientMain.client.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.x, p.y + 0.2, p.z, false)); + Vec3d p = ShadowMain.client.player.getPos(); + ShadowMain.client.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.x, p.y - 0.2, p.z, false)); + ShadowMain.client.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(p.x, p.y + 0.2, p.z, false)); } } switch (mode.getValue()) { case Vanilla: - CoffeeClientMain.client.player.getAbilities().setFlySpeed((float) (this.speed.getValue() + 0f) / 20f); - CoffeeClientMain.client.player.getAbilities().flying = true; + ShadowMain.client.player.getAbilities().setFlySpeed((float) (this.speed.getValue() + 0f) / 20f); + ShadowMain.client.player.getAbilities().flying = true; break; case Static: - GameOptions go = CoffeeClientMain.client.options; - float y = CoffeeClientMain.client.player.getYaw(); + GameOptions go = ShadowMain.client.options; + float y = ShadowMain.client.player.getYaw(); int mx = 0, my = 0, mz = 0; if (go.jumpKey.isPressed()) { @@ -96,22 +96,22 @@ public class Flight extends Module { nx += ts * mx * -c; nz += ts * mx * -s; Vec3d nv3 = new Vec3d(nx, ny, nz); - CoffeeClientMain.client.player.setVelocity(nv3); + ShadowMain.client.player.setVelocity(nv3); break; case Jetpack: - if (CoffeeClientMain.client.options.jumpKey.isPressed()) { - assert CoffeeClientMain.client.player != null; - CoffeeClientMain.client.player.addVelocity(0, speed / 30, 0); - Vec3d vp = CoffeeClientMain.client.player.getPos(); + if (ShadowMain.client.options.jumpKey.isPressed()) { + assert ShadowMain.client.player != null; + ShadowMain.client.player.addVelocity(0, speed / 30, 0); + Vec3d vp = ShadowMain.client.player.getPos(); Random r = new Random(); for (int i = 0; i < 10; i++) { - CoffeeClientMain.client.world.addImportantParticle(ParticleTypes.SOUL_FIRE_FLAME, true, vp.x, vp.y, vp.z, (r.nextDouble() * 0.25) - .125, (r.nextDouble() * 0.25) - .125, (r.nextDouble() * 0.25) - .125); + ShadowMain.client.world.addImportantParticle(ParticleTypes.SOUL_FIRE_FLAME, true, vp.x, vp.y, vp.z, (r.nextDouble() * 0.25) - .125, (r.nextDouble() * 0.25) - .125, (r.nextDouble() * 0.25) - .125); } } break; case ThreeD: - CoffeeClientMain.client.player.setVelocity(CoffeeClientMain.client.player.getRotationVector().multiply(speed) - .multiply(CoffeeClientMain.client.player.input.pressingForward ? 1 : (CoffeeClientMain.client.player.input.pressingBack ? -1 : 0))); + ShadowMain.client.player.setVelocity(ShadowMain.client.player.getRotationVector().multiply(speed) + .multiply(ShadowMain.client.player.input.pressingForward ? 1 : (ShadowMain.client.player.input.pressingBack ? -1 : 0))); break; } } @@ -119,15 +119,15 @@ public class Flight extends Module { @Override public void enable() { bypassTimer = 0; - flewBefore = Objects.requireNonNull(CoffeeClientMain.client.player).getAbilities().flying; - CoffeeClientMain.client.player.setOnGround(false); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(new ClientCommandC2SPacket(CoffeeClientMain.client.player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY)); + flewBefore = Objects.requireNonNull(ShadowMain.client.player).getAbilities().flying; + ShadowMain.client.player.setOnGround(false); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(new ClientCommandC2SPacket(ShadowMain.client.player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY)); } @Override public void disable() { - Objects.requireNonNull(CoffeeClientMain.client.player).getAbilities().flying = flewBefore; - CoffeeClientMain.client.player.getAbilities().setFlySpeed(0.05f); + Objects.requireNonNull(ShadowMain.client.player).getAbilities().flying = flewBefore; + ShadowMain.client.player.getAbilities().setFlySpeed(0.05f); } @Override @@ -138,8 +138,8 @@ public class Flight extends Module { @Override public void onWorldRender(MatrixStack matrices) { if (isDebuggerEnabled()) { - Vec3d a = Utils.getInterpolatedEntityPosition(Objects.requireNonNull(CoffeeClientMain.client.player)); - Vec3d b = a.add(CoffeeClientMain.client.player.getVelocity()); + Vec3d a = Utils.getInterpolatedEntityPosition(Objects.requireNonNull(ShadowMain.client.player)); + Vec3d b = a.add(ShadowMain.client.player.getVelocity()); Renderer.R3D.renderLine(a, b, Color.CYAN, matrices); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Jesus.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Jesus.java index 60e8bfe..75092e5 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Jesus.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Jesus.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; @@ -28,10 +28,10 @@ public class Jesus extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - if (CoffeeClientMain.client.player.isWet()) { + if (ShadowMain.client.player.isWet()) { switch (mode.getValue()) { case Jump -> Objects.requireNonNull(client.player).jump(); case Velocity -> Objects.requireNonNull(client.player).setVelocity(client.player.getVelocity().x, velStrength.getValue(), client.player.getVelocity().z); diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/LongJump.java b/src/main/java/net/shadow/client/feature/module/impl/movement/LongJump.java index eceb90a..a67cb1c 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/LongJump.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/LongJump.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -30,11 +30,11 @@ public class LongJump extends Module { } Vec3d getVel() { - float f = Objects.requireNonNull(CoffeeClientMain.client.player).getYaw() * 0.017453292F; + float f = Objects.requireNonNull(ShadowMain.client.player).getYaw() * 0.017453292F; double scaled = xz.getValue() / 5; return switch (focus.getValue()) { case Direction -> new Vec3d(-MathHelper.sin(f) * scaled, 0.0D, MathHelper.cos(f) * scaled); - case Velocity -> new Vec3d(CoffeeClientMain.client.player.getVelocity().normalize().x * scaled, 0.0D, CoffeeClientMain.client.player.getVelocity().normalize().z * scaled); + case Velocity -> new Vec3d(ShadowMain.client.player.getVelocity().normalize().x * scaled, 0.0D, ShadowMain.client.player.getVelocity().normalize().z * scaled); }; } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/MoonGravity.java b/src/main/java/net/shadow/client/feature/module/impl/movement/MoonGravity.java index b97fad0..f1ad9e2 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/MoonGravity.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/MoonGravity.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -18,10 +18,10 @@ public class MoonGravity extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - CoffeeClientMain.client.player.addVelocity(0, 0.0568000030517578, 0); + ShadowMain.client.player.addVelocity(0, 0.0568000030517578, 0); // yea that's literally it } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/NoJumpCooldown.java b/src/main/java/net/shadow/client/feature/module/impl/movement/NoJumpCooldown.java index 56a82a9..2d5b448 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/NoJumpCooldown.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/NoJumpCooldown.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.mixin.ILivingEntityAccessor; @@ -19,10 +19,10 @@ public class NoJumpCooldown extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - ((ILivingEntityAccessor) CoffeeClientMain.client.player).setJumpingCooldown(0); + ((ILivingEntityAccessor) ShadowMain.client.player).setJumpingCooldown(0); } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Phase.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Phase.java index a8ddded..4223d3d 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Phase.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Phase.java @@ -10,7 +10,7 @@ import net.minecraft.entity.EntityPose; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Box; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.event.EventType; @@ -25,16 +25,16 @@ public class Phase extends Module { public Phase() { super("Phase", "Go through walls when flying (works best with creative)", ModuleType.MOVEMENT); Events.registerEventHandler(EventType.PACKET_SEND, event -> { - if (!this.isEnabled() || CoffeeClientMain.client.player == null || !CoffeeClientMain.client.player.getAbilities().flying) { + if (!this.isEnabled() || ShadowMain.client.player == null || !ShadowMain.client.player.getAbilities().flying) { return; } PacketEvent pe = (PacketEvent) event; - Box p = CoffeeClientMain.client.player.getBoundingBox(CoffeeClientMain.client.player.getPose()).offset(0, 0.27, 0).expand(0.25); + Box p = ShadowMain.client.player.getBoundingBox(ShadowMain.client.player.getPose()).offset(0, 0.27, 0).expand(0.25); if (p.getYLength() < 2) { p = p.expand(0, 1, 0); } - p = p.offset(CoffeeClientMain.client.player.getPos()); - if (pe.getPacket() instanceof PlayerMoveC2SPacket && !Objects.requireNonNull(CoffeeClientMain.client.world).isSpaceEmpty(CoffeeClientMain.client.player, p)) { + p = p.offset(ShadowMain.client.player.getPos()); + if (pe.getPacket() instanceof PlayerMoveC2SPacket && !Objects.requireNonNull(ShadowMain.client.world).isSpaceEmpty(ShadowMain.client.player, p)) { event.setCancelled(true); } }); @@ -56,10 +56,10 @@ public class Phase extends Module { @Override public void enable() { - Objects.requireNonNull(CoffeeClientMain.client.player).setPose(EntityPose.STANDING); - CoffeeClientMain.client.player.setOnGround(false); - CoffeeClientMain.client.player.fallDistance = 0; - CoffeeClientMain.client.player.setVelocity(0, 0, 0); + Objects.requireNonNull(ShadowMain.client.player).setPose(EntityPose.STANDING); + ShadowMain.client.player.setOnGround(false); + ShadowMain.client.player.fallDistance = 0; + ShadowMain.client.player.setVelocity(0, 0, 0); } @Override @@ -69,15 +69,15 @@ public class Phase extends Module { @Override public String getContext() { - return getNoClipState(CoffeeClientMain.client.player) ? "Active" : null; + return getNoClipState(ShadowMain.client.player) ? "Active" : null; } @Override public void onWorldRender(MatrixStack matrices) { - if (Objects.requireNonNull(CoffeeClientMain.client.player).getAbilities().flying) { - CoffeeClientMain.client.player.setPose(EntityPose.STANDING); - CoffeeClientMain.client.player.setOnGround(false); - CoffeeClientMain.client.player.fallDistance = 0; + if (Objects.requireNonNull(ShadowMain.client.player).getAbilities().flying) { + ShadowMain.client.player.setPose(EntityPose.STANDING); + ShadowMain.client.player.setOnGround(false); + ShadowMain.client.player.fallDistance = 0; //SipoverPrivate.client.player.setVelocity(0,0,0); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Sprint.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Sprint.java index 2902a1f..c6d5c3e 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Sprint.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Sprint.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -20,10 +20,10 @@ public class Sprint extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - if (CoffeeClientMain.client.options.forwardKey.isPressed() && !CoffeeClientMain.client.options.backKey.isPressed() && !CoffeeClientMain.client.player.isSneaking() && !CoffeeClientMain.client.player.horizontalCollision) { + if (ShadowMain.client.options.forwardKey.isPressed() && !ShadowMain.client.options.backKey.isPressed() && !ShadowMain.client.player.isSneaking() && !ShadowMain.client.player.horizontalCollision) { Objects.requireNonNull(client.player).setSprinting(true); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Step.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Step.java index 4588808..8e501c6 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Step.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Step.java @@ -6,7 +6,7 @@ package net.shadow.client.feature.module.impl.movement; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -24,10 +24,10 @@ public class Step extends Module { @Override public void tick() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } - CoffeeClientMain.client.player.stepHeight = (float) (height.getValue() + 0); + ShadowMain.client.player.stepHeight = (float) (height.getValue() + 0); } @Override @@ -37,7 +37,7 @@ public class Step extends Module { @Override public void disable() { - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.player == null || ShadowMain.client.getNetworkHandler() == null) { return; } Objects.requireNonNull(client.player).stepHeight = 0.6f; diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Swing.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Swing.java index c3f5750..f17167b 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/movement/Swing.java +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Swing.java @@ -6,7 +6,7 @@ import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.clickgui.theme.ThemeManager; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -27,13 +27,13 @@ public class Swing extends Module { public Swing() { super("Swing", "Swing around like spiderman", ModuleType.MOVEMENT); Events.registerEventHandler(EventType.MOUSE_EVENT, event -> { - if (!this.isEnabled() || CoffeeClientMain.client.currentScreen != null) { + if (!this.isEnabled() || ShadowMain.client.currentScreen != null) { return; } MouseEvent me = (MouseEvent) event; if (me.getButton() == 0 && me.getAction() == 1) { try { - HitResult hit = Objects.requireNonNull(CoffeeClientMain.client.player).raycast(200, CoffeeClientMain.client.getTickDelta(), true); + HitResult hit = Objects.requireNonNull(ShadowMain.client.player).raycast(200, ShadowMain.client.getTickDelta(), true); swinging = new BlockPos(hit.getPos()); } catch (Exception ignored) { } @@ -55,10 +55,10 @@ public class Swing extends Module { if (swinging == null) { return; } - Vec3d diff = Vec3d.of(swinging).add(0.5, 0.5, 0.5).subtract(Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player)).normalize().multiply(0.4).add(0, 0.03999999910593033 * 2, 0); + Vec3d diff = Vec3d.of(swinging).add(0.5, 0.5, 0.5).subtract(Utils.getInterpolatedEntityPosition(ShadowMain.client.player)).normalize().multiply(0.4).add(0, 0.03999999910593033 * 2, 0); - CoffeeClientMain.client.player.addVelocity(diff.x, diff.y, diff.z); - if (CoffeeClientMain.client.options.sneakKey.isPressed()) { + ShadowMain.client.player.addVelocity(diff.x, diff.y, diff.z); + if (ShadowMain.client.options.sneakKey.isPressed()) { swinging = null; } } @@ -80,13 +80,13 @@ public class Swing extends Module { @Override public void onWorldRender(MatrixStack matrices) { - if (swinging == null || CoffeeClientMain.client.player == null) { + if (swinging == null || ShadowMain.client.player == null) { return; } RenderSystem.defaultBlendFunc(); Vec3d cringe = new Vec3d(swinging.getX(), swinging.getY(), swinging.getZ()); Vec3d cringe2 = new Vec3d(swinging.getX() + 0.5, swinging.getY() + 0.5, swinging.getZ() + 0.5); - Vec3d eSource = Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player); + Vec3d eSource = Utils.getInterpolatedEntityPosition(ShadowMain.client.player); // Renderer.R3D.renderFilled(cringe, new Vec3d(1, 1, 1), new Color(150, 150, 150, 150), matrices) Renderer.R3D.renderFilled(cringe.add(.5, .5, .5).subtract(.25, .25, .25), new Vec3d(.5, .5, .5), ThemeManager.getMainTheme().getInactive(), matrices); Renderer.R3D.renderLine(eSource, cringe2, line, matrices); diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/CaveMapper.java b/src/main/java/net/shadow/client/feature/module/impl/render/CaveMapper.java index 3d9106b..4f564da 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/CaveMapper.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/CaveMapper.java @@ -15,7 +15,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Matrix4f; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.SettingsGroup; @@ -107,7 +107,7 @@ public class CaveMapper extends Module { for (BlockPos pos : new BlockPos[]{right, left, fw, bw, up, down}) { boolean hadObstacle = false; int y = pos.getY(); - while (!Objects.requireNonNull(CoffeeClientMain.client.world).isOutOfHeightLimit(y)) { + while (!Objects.requireNonNull(ShadowMain.client.world).isOutOfHeightLimit(y)) { BlockPos current = new BlockPos(pos.getX(), y, pos.getZ()); if (!bs(current).isAir()) { hadObstacle = true; @@ -120,7 +120,7 @@ public class CaveMapper extends Module { toScan.add(pos); scannedBlocks.add(pos); } - } else if (bs(pos).isFullCube(CoffeeClientMain.client.world, pos) && circ.stream().noneMatch(blockPosListEntry -> blockPosListEntry.getKey().equals(pos))) { + } else if (bs(pos).isFullCube(ShadowMain.client.world, pos) && circ.stream().noneMatch(blockPosListEntry -> blockPosListEntry.getKey().equals(pos))) { Vec3d renderR = new Vec3d(pos.getX(), pos.getY(), pos.getZ()); Vec3d end = renderR.add(new Vec3d(1, 1, 1)); float x1 = (float) renderR.x; @@ -237,7 +237,7 @@ public class CaveMapper extends Module { } BlockState bs(BlockPos bp) { - return Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(bp); + return Objects.requireNonNull(ShadowMain.client.world).getBlockState(bp); } @Override @@ -250,7 +250,7 @@ public class CaveMapper extends Module { toScan.clear(); ores.clear(); circ.clear(); - start = Objects.requireNonNull(CoffeeClientMain.client.player).getBlockPos(); + start = Objects.requireNonNull(ShadowMain.client.player).getBlockPos(); toScan.add(start); scanned = false; } @@ -258,9 +258,9 @@ public class CaveMapper extends Module { @Override public String getContext() { return scannedBlocks.size() + "S|" + new ArrayList<>(this.ores).stream() - .filter(blockPos -> shouldRenderOre(Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(blockPos).getBlock())) + .filter(blockPos -> shouldRenderOre(Objects.requireNonNull(ShadowMain.client.world).getBlockState(blockPos).getBlock())) .count() + "F|" + Utils.Math.roundToDecimal((double) new ArrayList<>(this.ores).stream() - .filter(blockPos -> shouldRenderOre(Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(blockPos).getBlock())).count() / scannedBlocks.size() * 100, 2) + "%D"; + .filter(blockPos -> shouldRenderOre(Objects.requireNonNull(ShadowMain.client.world).getBlockState(blockPos).getBlock())).count() / scannedBlocks.size() * 100, 2) + "%D"; } @Override @@ -277,7 +277,7 @@ public class CaveMapper extends Module { } List<Map.Entry<BlockPos, List<Vec3d>>> real = new ArrayList<>(circ); - Camera cam = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera cam = ShadowMain.client.gameRenderer.getCamera(); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); RenderSystem.setShader(GameRenderer::getPositionColorShader); GL11.glDepthFunc(GL11.GL_ALWAYS); @@ -297,7 +297,7 @@ public class CaveMapper extends Module { if (ores.contains(entry.getKey())) { continue; } - double dist = new Vec3d(entry.getKey().getX(), entry.getKey().getY(), entry.getKey().getZ()).distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()); + double dist = new Vec3d(entry.getKey().getX(), entry.getKey().getY(), entry.getKey().getZ()).distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()); dist = (1 - MathHelper.clamp(dist, 0, 15) / 15d) * 3d; dist = Math.round(dist); dist /= 3; @@ -333,15 +333,15 @@ public class CaveMapper extends Module { if (ore == null) { continue; } - Block t = Objects.requireNonNull(CoffeeClientMain.client.world).getBlockState(ore).getBlock(); + Block t = Objects.requireNonNull(ShadowMain.client.world).getBlockState(ore).getBlock(); if (!shouldRenderOre(t)) { continue; } Vec3d p = new Vec3d(ore.getX(), ore.getY(), ore.getZ()); - double dist = p.distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()); + double dist = p.distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()); dist = MathHelper.clamp(dist, 0, 30); - Renderer.R3D.renderFilled(p, new Vec3d(1, 1, 1), Renderer.Util.modify(oreColors.containsKey(t) ? oreColors.get(t) : new Color(CoffeeClientMain.client.world.getBlockState(ore) - .getMapColor(CoffeeClientMain.client.world, ore).color), -1, -1, -1, (int) ((dist / 30d) * 200)), matrices); + Renderer.R3D.renderFilled(p, new Vec3d(1, 1, 1), Renderer.Util.modify(oreColors.containsKey(t) ? oreColors.get(t) : new Color(ShadowMain.client.world.getBlockState(ore) + .getMapColor(ShadowMain.client.world, ore).color), -1, -1, -1, (int) ((dist / 30d) * 200)), matrices); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/ClickGUI.java b/src/main/java/net/shadow/client/feature/module/impl/render/ClickGUI.java index 9471de0..f84fa20 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/ClickGUI.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/ClickGUI.java @@ -1,7 +1,7 @@ package net.shadow.client.feature.module.impl.render; import net.minecraft.client.util.math.MatrixStack; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -18,7 +18,7 @@ public class ClickGUI extends Module { public void tick() { t--; if (t == 0) { - CoffeeClientMain.client.setScreen(net.shadow.client.feature.gui.clickgui.ClickGUI.instance()); + ShadowMain.client.setScreen(net.shadow.client.feature.gui.clickgui.ClickGUI.instance()); setEnabled(false); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/ESP.java b/src/main/java/net/shadow/client/feature/module/impl/render/ESP.java index 5ef89ad..353cc4a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/ESP.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/ESP.java @@ -13,7 +13,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Matrix4f; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; @@ -108,16 +108,16 @@ public class ESP extends Module { GL11.glDepthFunc(GL11.GL_LEQUAL); RenderSystem.disableBlend(); } - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null) { return; } - for (Entity entity : CoffeeClientMain.client.world.getEntities()) { - if (entity.squaredDistanceTo(CoffeeClientMain.client.player) > Math.pow(range.getValue(), 2)) { + for (Entity entity : ShadowMain.client.world.getEntities()) { + if (entity.squaredDistanceTo(ShadowMain.client.player) > Math.pow(range.getValue(), 2)) { continue; } - if (entity.getUuid().equals(CoffeeClientMain.client.player.getUuid())) { + if (entity.getUuid().equals(ShadowMain.client.player.getUuid())) { continue; } if (shouldRenderEntity(entity)) { @@ -138,12 +138,12 @@ public class ESP extends Module { } void renderOutline(Entity e, Color color, MatrixStack stack) { - Vec3d eSource = new Vec3d(MathHelper.lerp(CoffeeClientMain.client.getTickDelta(), e.prevX, e.getX()), MathHelper.lerp(CoffeeClientMain.client.getTickDelta(), e.prevY, e.getY()), MathHelper.lerp(CoffeeClientMain.client.getTickDelta(), e.prevZ, e.getZ())); + Vec3d eSource = new Vec3d(MathHelper.lerp(ShadowMain.client.getTickDelta(), e.prevX, e.getX()), MathHelper.lerp(ShadowMain.client.getTickDelta(), e.prevY, e.getY()), MathHelper.lerp(ShadowMain.client.getTickDelta(), e.prevZ, e.getZ())); float red = color.getRed() / 255f; float green = color.getGreen() / 255f; float blue = color.getBlue() / 255f; float alpha = color.getAlpha() / 255f; - Camera c = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera c = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = c.getPos(); Vec3d start = eSource.subtract(camPos); float x = (float) start.x; diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/Fullbright.java b/src/main/java/net/shadow/client/feature/module/impl/render/Fullbright.java index 04c63af..eb4001a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/Fullbright.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/Fullbright.java @@ -2,7 +2,7 @@ package net.shadow.client.feature.module.impl.render; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.util.Transitions; @@ -22,17 +22,17 @@ public class Fullbright extends Module { @Override public void enable() { - og = MathHelper.clamp(CoffeeClientMain.client.options.gamma, 0, 1); + og = MathHelper.clamp(ShadowMain.client.options.gamma, 0, 1); } @Override public void disable() { - CoffeeClientMain.client.options.gamma = og; + ShadowMain.client.options.gamma = og; } @Override public void onFastTick() { - CoffeeClientMain.client.options.gamma = Transitions.transition(CoffeeClientMain.client.options.gamma, 10, 300); + ShadowMain.client.options.gamma = Transitions.transition(ShadowMain.client.options.gamma, 10, 300); } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/Hud.java b/src/main/java/net/shadow/client/feature/module/impl/render/Hud.java index 5879e75..6202ef5 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/Hud.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/Hud.java @@ -5,7 +5,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.gui.clickgui.theme.ThemeManager; import net.shadow.client.feature.gui.hud.HudRenderer; @@ -114,18 +114,18 @@ public class Hud extends Module { @Override public void onHudRenderNoMSAA() { - if (CoffeeClientMain.client.getNetworkHandler() == null) { + if (ShadowMain.client.getNetworkHandler() == null) { return; } - if (CoffeeClientMain.client.player == null) { + if (ShadowMain.client.player == null) { return; } MatrixStack ms = Renderer.R3D.getEmptyMatrixStack(); double heightOffsetLeft = 0, heightOffsetRight = 0; - if (CoffeeClientMain.client.options.debugEnabled) { + if (ShadowMain.client.options.debugEnabled) { double heightAccordingToMc = 9; - List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetLeftText(); - List<String> rt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetRightText(); + List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) ShadowMain.client.inGameHud).getDebugHud()).callGetLeftText(); + List<String> rt = ((IDebugHudAccessor) ((IInGameHudAccessor) ShadowMain.client.inGameHud).getDebugHud()).callGetRightText(); heightOffsetLeft = 2 + heightAccordingToMc * (lt.size() + 3); heightOffsetRight = 2 + heightAccordingToMc * rt.size() + 5; } @@ -167,7 +167,7 @@ public class Hud extends Module { double rootY = 6; List<String> values = new ArrayList<>(); if (this.fps.getValue()) { - values.add(((IMinecraftClientAccessor) CoffeeClientMain.client).getCurrentFps() + " fps"); + values.add(((IMinecraftClientAccessor) ShadowMain.client).getCurrentFps() + " fps"); } if (this.tps.getValue()) { @@ -180,11 +180,11 @@ public class Hud extends Module { values.add(tpsString + " tps"); } if (this.ping.getValue()) { - PlayerListEntry ple = Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).getPlayerListEntry(Objects.requireNonNull(CoffeeClientMain.client.player).getUuid()); + PlayerListEntry ple = Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).getPlayerListEntry(Objects.requireNonNull(ShadowMain.client.player).getUuid()); values.add((ple == null || ple.getLatency() == 0 ? "?" : ple.getLatency() + "") + " ms"); } if (this.coords.getValue()) { - BlockPos bp = Objects.requireNonNull(CoffeeClientMain.client.player).getBlockPos(); + BlockPos bp = Objects.requireNonNull(ShadowMain.client.player).getBlockPos(); values.add(bp.getX() + " " + bp.getY() + " " + bp.getZ()); } String drawStr = String.join(" | ", values); @@ -202,7 +202,7 @@ public class Hud extends Module { } void drawModuleList(MatrixStack ms) { - double width = CoffeeClientMain.client.getWindow().getScaledWidth(); + double width = ShadowMain.client.getWindow().getScaledWidth(); double y = 0; for (ModuleEntry moduleEntry : moduleList.stream().sorted(Comparator.comparingDouble(value -> -value.getRenderWidth())).toList()) { double prog = moduleEntry.getAnimProg() * 2; diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/TabGui.java b/src/main/java/net/shadow/client/feature/module/impl/render/TabGui.java index dad3a86..af6dd72 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/TabGui.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/TabGui.java @@ -2,7 +2,7 @@ package net.shadow.client.feature.module.impl.render; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.ModuleType; @@ -97,9 +97,9 @@ public class TabGui extends Module { public void onHudRender() { double innerPad = 5; double heightOffsetLeft = 6 + Math.max(Hud.getTitleFr().getMarginHeight(), FontRenderers.getRenderer().getMarginHeight()) + 2 + innerPad; - if (CoffeeClientMain.client.options.debugEnabled) { + if (ShadowMain.client.options.debugEnabled) { double heightAccordingToMc = 9; - List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) CoffeeClientMain.client.inGameHud).getDebugHud()).callGetLeftText(); + List<String> lt = ((IDebugHudAccessor) ((IInGameHudAccessor) ShadowMain.client.inGameHud).getDebugHud()).callGetLeftText(); heightOffsetLeft += 2 + heightAccordingToMc * (lt.size() + 3); } MatrixStack ms = Renderer.R3D.getEmptyMatrixStack(); diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/TargetHud.java b/src/main/java/net/shadow/client/feature/module/impl/render/TargetHud.java index eda2f1a..b26853a 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/TargetHud.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/TargetHud.java @@ -14,7 +14,7 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.MathHelper; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -52,10 +52,10 @@ public class TargetHud extends Module { } boolean isApplicable(Entity check) { - if (check == CoffeeClientMain.client.player) { + if (check == ShadowMain.client.player) { return false; } - if (check.distanceTo(CoffeeClientMain.client.player) > 64) { + if (check.distanceTo(ShadowMain.client.player) > 64) { return false; } int l = check.getEntityName().length(); @@ -66,7 +66,7 @@ public class TargetHud extends Module { if (!isValidEntityName) { return false; } - if (check == CoffeeClientMain.client.player) { + if (check == ShadowMain.client.player) { return false; } return check.getType() == EntityType.PLAYER && check instanceof PlayerEntity; @@ -78,8 +78,8 @@ public class TargetHud extends Module { e = AttackManager.getLastAttackInTimeRange(); return; } - List<Entity> entitiesQueue = StreamSupport.stream(Objects.requireNonNull(CoffeeClientMain.client.world).getEntities().spliterator(), false).filter(this::isApplicable) - .sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(CoffeeClientMain.client.player).getPos()))).toList(); + List<Entity> entitiesQueue = StreamSupport.stream(Objects.requireNonNull(ShadowMain.client.world).getEntities().spliterator(), false).filter(this::isApplicable) + .sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(ShadowMain.client.player).getPos()))).toList(); if (entitiesQueue.size() > 0) { e = entitiesQueue.get(0); } else { @@ -168,7 +168,7 @@ public class TargetHud extends Module { FontRenderers.getRenderer().drawString(stack, entity.getEntityName(), textLeftAlign, yOffset, 0xFFFFFF); yOffset += FontRenderers.getRenderer().getFontHeight(); - PlayerListEntry ple = Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).getPlayerListEntry(entity.getUuid()); + PlayerListEntry ple = Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).getPlayerListEntry(entity.getUuid()); if (ple != null && renderPing.getValue()) { int ping = ple.getLatency(); String v = ping + " ms"; diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/Tracers.java b/src/main/java/net/shadow/client/feature/module/impl/render/Tracers.java index 778536f..e137cf9 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/Tracers.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/Tracers.java @@ -12,7 +12,7 @@ import net.minecraft.entity.mob.EndermanEntity; import net.minecraft.entity.mob.HostileEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -49,27 +49,27 @@ public class Tracers extends Module { @Override public String getContext() { - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null) { return null; } - return StreamSupport.stream(CoffeeClientMain.client.world.getEntities().spliterator(), false) - .filter(entity -> entity.squaredDistanceTo(CoffeeClientMain.client.player) < 4096 && entity.getUuid() != CoffeeClientMain.client.player.getUuid() && isEntityApplicable(entity)) + return StreamSupport.stream(ShadowMain.client.world.getEntities().spliterator(), false) + .filter(entity -> entity.squaredDistanceTo(ShadowMain.client.player) < 4096 && entity.getUuid() != ShadowMain.client.player.getUuid() && isEntityApplicable(entity)) .count() + ""; } @Override public void onWorldRender(MatrixStack matrices) { - if (CoffeeClientMain.client.world == null || CoffeeClientMain.client.player == null) { + if (ShadowMain.client.world == null || ShadowMain.client.player == null) { return; } - for (Entity entity : StreamSupport.stream(CoffeeClientMain.client.world.getEntities().spliterator(), false) - .sorted(Comparator.comparingDouble(value -> -value.distanceTo(CoffeeClientMain.client.player))).toList()) { - if (entity.squaredDistanceTo(CoffeeClientMain.client.player) > 4096) { + for (Entity entity : StreamSupport.stream(ShadowMain.client.world.getEntities().spliterator(), false) + .sorted(Comparator.comparingDouble(value -> -value.distanceTo(ShadowMain.client.player))).toList()) { + if (entity.squaredDistanceTo(ShadowMain.client.player) > 4096) { continue; } - double dc = entity.squaredDistanceTo(CoffeeClientMain.client.player) / 4096; + double dc = entity.squaredDistanceTo(ShadowMain.client.player) / 4096; dc = Math.abs(1 - dc); - if (entity.getUuid().equals(CoffeeClientMain.client.player.getUuid())) { + if (entity.getUuid().equals(ShadowMain.client.player.getUuid())) { continue; } Color c; diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/Trail.java b/src/main/java/net/shadow/client/feature/module/impl/render/Trail.java index 35df2a6..1287a30 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/Trail.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/Trail.java @@ -2,7 +2,7 @@ package net.shadow.client.feature.module.impl.render; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.render.Renderer; @@ -26,7 +26,7 @@ public class Trail extends Module { @Override public void onFastTick() { - positions.add(Utils.getInterpolatedEntityPosition(CoffeeClientMain.client.player)); + positions.add(Utils.getInterpolatedEntityPosition(ShadowMain.client.player)); while (positions.size() > 1000) { positions.remove(0); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/AnyPlacer.java b/src/main/java/net/shadow/client/feature/module/impl/world/AnyPlacer.java index 3057138..661ffac 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/AnyPlacer.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/AnyPlacer.java @@ -14,7 +14,7 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.event.EventType; @@ -33,19 +33,19 @@ public class AnyPlacer extends Module { if (!this.isEnabled()) { return; } - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; } - if (CoffeeClientMain.client.currentScreen != null) { + if (ShadowMain.client.currentScreen != null) { return; } // PacketEvent pe = (PacketEvent) event; MouseEvent me = (MouseEvent) event; if ((me.getAction() == 1 || me.getAction() == 2) && me.getButton() == 1) { - ItemStack sex = CoffeeClientMain.client.player.getMainHandStack(); + ItemStack sex = ShadowMain.client.player.getMainHandStack(); if (sex.getItem() instanceof SpawnEggItem) { event.setCancelled(true); - HitResult hr = CoffeeClientMain.client.player.raycast(500, 0, true); + HitResult hr = ShadowMain.client.player.raycast(500, 0, true); Vec3d spawnPos = hr.getPos(); NbtCompound entityTag = sex.getOrCreateSubNbt("EntityTag"); NbtList nl = new NbtList(); @@ -53,11 +53,11 @@ public class AnyPlacer extends Module { nl.add(NbtDouble.of(spawnPos.y)); nl.add(NbtDouble.of(spawnPos.z)); entityTag.put("Pos", nl); - CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), sex); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(a); - BlockHitResult bhr = new BlockHitResult(CoffeeClientMain.client.player.getPos(), Direction.DOWN, new BlockPos(CoffeeClientMain.client.player.getPos()), false); + CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), sex); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(a); + BlockHitResult bhr = new BlockHitResult(ShadowMain.client.player.getPos(), Direction.DOWN, new BlockPos(ShadowMain.client.player.getPos()), false); PlayerInteractBlockC2SPacket ib = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - CoffeeClientMain.client.getNetworkHandler().sendPacket(ib); + ShadowMain.client.getNetworkHandler().sendPacket(ib); } } }); @@ -85,7 +85,7 @@ public class AnyPlacer extends Module { @Override public void onWorldRender(MatrixStack matrices) { if (isDebuggerEnabled()) { - HitResult hr = Objects.requireNonNull(CoffeeClientMain.client.player).raycast(500, 0, true); + HitResult hr = Objects.requireNonNull(ShadowMain.client.player).raycast(500, 0, true); Vec3d spawnPos = hr.getPos(); Renderer.R3D.renderFilled(spawnPos.subtract(.3, 0, .3), new Vec3d(.6, 0.001, .6), Color.WHITE, matrices); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/AutoLavacast.java b/src/main/java/net/shadow/client/feature/module/impl/world/AutoLavacast.java index 8a56584..f72cc4c 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/AutoLavacast.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/AutoLavacast.java @@ -11,7 +11,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -37,10 +37,10 @@ public class AutoLavacast extends Module { BlockPos getNextPosition() { int y = 0; - while ((y + start.getY()) < CoffeeClientMain.client.world.getTopY()) { + while ((y + start.getY()) < ShadowMain.client.world.getTopY()) { Vec3i ie = incr.multiply(y + 1); BlockPos next = start.add(ie).add(0, y, 0); - if (CoffeeClientMain.client.world.getBlockState(next).getMaterial().isReplaceable()) { + if (ShadowMain.client.world.getBlockState(next).getMaterial().isReplaceable()) { return next; } y++; @@ -62,29 +62,29 @@ public class AutoLavacast extends Module { Vec3d placeCenter = Vec3d.of(next).add(.5, .5, .5); if (mode.getValue() == Mode.Bypass) { Rotations.lookAtPositionSmooth(placeCenter, 6); - if (((CoffeeClientMain.client.player.horizontalCollision && moveForwards) || CoffeeClientMain.client.player.getBoundingBox() - .intersects(Vec3d.of(next), Vec3d.of(next).add(1, 1, 1))) && CoffeeClientMain.client.player.isOnGround()) { - CoffeeClientMain.client.player.jump(); - CoffeeClientMain.client.player.setOnGround(false); + if (((ShadowMain.client.player.horizontalCollision && moveForwards) || ShadowMain.client.player.getBoundingBox() + .intersects(Vec3d.of(next), Vec3d.of(next).add(1, 1, 1))) && ShadowMain.client.player.isOnGround()) { + ShadowMain.client.player.jump(); + ShadowMain.client.player.setOnGround(false); } } - if (placeCenter.distanceTo(CoffeeClientMain.client.player.getCameraPosVec(1)) < CoffeeClientMain.client.interactionManager.getReachDistance()) { + if (placeCenter.distanceTo(ShadowMain.client.player.getCameraPosVec(1)) < ShadowMain.client.interactionManager.getReachDistance()) { moveForwards = false; - ItemStack is = CoffeeClientMain.client.player.getInventory().getMainHandStack(); + ItemStack is = ShadowMain.client.player.getInventory().getMainHandStack(); if (is.isEmpty()) { return; } if (is.getItem() instanceof BlockItem bi) { Block p = bi.getBlock(); - if (p.getDefaultState().canPlaceAt(CoffeeClientMain.client.world, next)) { - CoffeeClientMain.client.execute(() -> { + if (p.getDefaultState().canPlaceAt(ShadowMain.client.world, next)) { + ShadowMain.client.execute(() -> { BlockHitResult bhr = new BlockHitResult(placeCenter, Direction.DOWN, next, false); - CoffeeClientMain.client.interactionManager.interactBlock(CoffeeClientMain.client.player, CoffeeClientMain.client.world, Hand.MAIN_HAND, bhr); + ShadowMain.client.interactionManager.interactBlock(ShadowMain.client.player, ShadowMain.client.world, Hand.MAIN_HAND, bhr); if (mode.getValue() == Mode.Fast) { Vec3d goP = Vec3d.of(next).add(0.5, 1.05, 0.5); - CoffeeClientMain.client.player.updatePosition(goP.x, goP.y, goP.z); + ShadowMain.client.player.updatePosition(goP.x, goP.y, goP.z); } }); } @@ -103,18 +103,18 @@ public class AutoLavacast extends Module { @Override public void enable() { if (original == null) { - original = CoffeeClientMain.client.player.input; + original = ShadowMain.client.player.input; } if (mode.getValue() == Mode.Bypass) { - CoffeeClientMain.client.player.input = new ListenInput(); + ShadowMain.client.player.input = new ListenInput(); } - incr = CoffeeClientMain.client.player.getMovementDirection().getVector(); - start = CoffeeClientMain.client.player.getBlockPos(); + incr = ShadowMain.client.player.getMovementDirection().getVector(); + start = ShadowMain.client.player.getBlockPos(); } @Override public void disable() { - CoffeeClientMain.client.player.input = original; + ShadowMain.client.player.input = original; } @Override diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/AutoTnt.java b/src/main/java/net/shadow/client/feature/module/impl/world/AutoTnt.java index 91f321b..80ce91e 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/AutoTnt.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/AutoTnt.java @@ -10,7 +10,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -32,7 +32,7 @@ public class AutoTnt extends Module { public void tick() { int tntSlot = -1; for (int i = 0; i < 9; i++) { - ItemStack is = Objects.requireNonNull(CoffeeClientMain.client.player).getInventory().getStack(i); + ItemStack is = Objects.requireNonNull(ShadowMain.client.player).getInventory().getStack(i); if (is.getItem() == Items.TNT) { tntSlot = i; break; @@ -48,42 +48,42 @@ public class AutoTnt extends Module { missingTntAck = false; } - Vec3d ppos = CoffeeClientMain.client.player.getPos(); + Vec3d ppos = ShadowMain.client.player.getPos(); for (double x = -10; x < 11; x++) { for (double z = -10; z < 11; z++) { List<Map.Entry<BlockPos, Double>> airs = new ArrayList<>(); - for (int y = Objects.requireNonNull(CoffeeClientMain.client.world).getTopY(); y > CoffeeClientMain.client.world.getBottomY(); y--) { + for (int y = Objects.requireNonNull(ShadowMain.client.world).getTopY(); y > ShadowMain.client.world.getBottomY(); y--) { Vec3d currentOffset = new Vec3d(x, y, z); BlockPos bp = new BlockPos(new Vec3d(ppos.x + currentOffset.x, y, ppos.z + currentOffset.z)); - BlockState bs = CoffeeClientMain.client.world.getBlockState(bp); + BlockState bs = ShadowMain.client.world.getBlockState(bp); double dist = Vec3d.of(bp).distanceTo(ppos); if (bs.getMaterial().isReplaceable()) { airs.add(new AbstractMap.SimpleEntry<>(bp, dist)); } } - airs = airs.stream().filter(blockPosDoubleEntry -> CoffeeClientMain.client.world.getBlockState(blockPosDoubleEntry.getKey().down()).getMaterial().blocksMovement()) + airs = airs.stream().filter(blockPosDoubleEntry -> ShadowMain.client.world.getBlockState(blockPosDoubleEntry.getKey().down()).getMaterial().blocksMovement()) .collect(Collectors.toList()); Map.Entry<BlockPos, Double> best1 = airs.stream().min(Comparator.comparingDouble(Map.Entry::getValue)).orElse(null); if (best1 == null) { continue; // just void here, cancel } BlockPos best = best1.getKey(); - if (CoffeeClientMain.client.world.getBlockState(best.down()).getBlock() == Blocks.TNT) { + if (ShadowMain.client.world.getBlockState(best.down()).getBlock() == Blocks.TNT) { continue; // already placed tnt, cancel } Vec3d lmao = Vec3d.of(best); - if (lmao.add(.5, .5, .5).distanceTo(CoffeeClientMain.client.player.getCameraPosVec(1)) >= 5) { + if (lmao.add(.5, .5, .5).distanceTo(ShadowMain.client.player.getCameraPosVec(1)) >= 5) { continue; } if (shouldPlace(best)) { int finalTntSlot = tntSlot; - CoffeeClientMain.client.execute(() -> { - int sel = CoffeeClientMain.client.player.getInventory().selectedSlot; - CoffeeClientMain.client.player.getInventory().selectedSlot = finalTntSlot; + ShadowMain.client.execute(() -> { + int sel = ShadowMain.client.player.getInventory().selectedSlot; + ShadowMain.client.player.getInventory().selectedSlot = finalTntSlot; BlockHitResult bhr = new BlockHitResult(lmao, Direction.DOWN, best, false); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).interactBlock(CoffeeClientMain.client.player, CoffeeClientMain.client.world, Hand.MAIN_HAND, bhr); - CoffeeClientMain.client.player.getInventory().selectedSlot = sel; + Objects.requireNonNull(ShadowMain.client.interactionManager).interactBlock(ShadowMain.client.player, ShadowMain.client.world, Hand.MAIN_HAND, bhr); + ShadowMain.client.player.getInventory().selectedSlot = sel; }); } } @@ -110,29 +110,29 @@ public class AutoTnt extends Module { @Override public void onWorldRender(MatrixStack matrices) { - Vec3d ppos = Objects.requireNonNull(CoffeeClientMain.client.player).getPos(); + Vec3d ppos = Objects.requireNonNull(ShadowMain.client.player).getPos(); for (double x = -10; x < 11; x++) { for (double z = -10; z < 11; z++) { List<Map.Entry<BlockPos, Double>> airs = new ArrayList<>(); - for (int y = Objects.requireNonNull(CoffeeClientMain.client.world).getTopY(); y > CoffeeClientMain.client.world.getBottomY(); y--) { + for (int y = Objects.requireNonNull(ShadowMain.client.world).getTopY(); y > ShadowMain.client.world.getBottomY(); y--) { Vec3d currentOffset = new Vec3d(x, y, z); BlockPos bp = new BlockPos(new Vec3d(ppos.x + currentOffset.x, y, ppos.z + currentOffset.z)); - BlockState bs = CoffeeClientMain.client.world.getBlockState(bp); + BlockState bs = ShadowMain.client.world.getBlockState(bp); double dist = Vec3d.of(bp).distanceTo(ppos); if (bs.getMaterial().isReplaceable()) { airs.add(new AbstractMap.SimpleEntry<>(bp, dist)); } } - airs = airs.stream().filter(blockPosDoubleEntry -> CoffeeClientMain.client.world.getBlockState(blockPosDoubleEntry.getKey().down()).getMaterial().blocksMovement()) + airs = airs.stream().filter(blockPosDoubleEntry -> ShadowMain.client.world.getBlockState(blockPosDoubleEntry.getKey().down()).getMaterial().blocksMovement()) .collect(Collectors.toList()); Map.Entry<BlockPos, Double> best1 = airs.stream().min(Comparator.comparingDouble(Map.Entry::getValue)).orElse(null); if (best1 == null) { continue; // just void here, cancel } BlockPos best = best1.getKey(); - if (CoffeeClientMain.client.world.getBlockState(best.down()).getBlock() == Blocks.TNT) { + if (ShadowMain.client.world.getBlockState(best.down()).getBlock() == Blocks.TNT) { continue; // already placed tnt, cancel } Vec3d lmao = Vec3d.of(best); diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/Boom.java b/src/main/java/net/shadow/client/feature/module/impl/world/Boom.java index 131ddfb..2c749f6 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/Boom.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/Boom.java @@ -19,7 +19,7 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.gui.notifications.Notification; @@ -43,7 +43,7 @@ public class Boom extends Module { public Boom() { super("Boom", "Spawns fireballs wherever you click", ModuleType.WORLD); Events.registerEventHandler(EventType.MOUSE_EVENT, event -> { - if (!this.isEnabled() || CoffeeClientMain.client.currentScreen != null) { + if (!this.isEnabled() || ShadowMain.client.currentScreen != null) { return; } MouseEvent me = (MouseEvent) event; @@ -66,7 +66,7 @@ public class Boom extends Module { PacketEvent pe = (PacketEvent) event; if (pe.getPacket() instanceof PlayerInteractEntityC2SPacket e) { PlayerInteractEntityC2SPacketAccessor a = (PlayerInteractEntityC2SPacketAccessor) e; - Entity entity = Objects.requireNonNull(CoffeeClientMain.client.world).getEntityById(a.getEntityId()); + Entity entity = Objects.requireNonNull(ShadowMain.client.world).getEntityById(a.getEntityId()); if (entity != null && entity.getType() == EntityType.FIREBALL && System.currentTimeMillis() - lastFired < 1000) { event.setCancelled(true); } @@ -75,49 +75,49 @@ public class Boom extends Module { } void fbInstant() { - if (!Objects.requireNonNull(CoffeeClientMain.client.interactionManager).hasCreativeInventory()) { + if (!Objects.requireNonNull(ShadowMain.client.interactionManager).hasCreativeInventory()) { return; } - HitResult hr = Objects.requireNonNull(CoffeeClientMain.client.player).raycast(200, 0, false); + HitResult hr = Objects.requireNonNull(ShadowMain.client.player).raycast(200, 0, false); Vec3d n = hr.getPos(); String nbt = String.format("{EntityTag:{id:\"minecraft:fireball\",ExplosionPower:%db,Motion:[%sd,%sd,%sd],Pos:[%s,%s,%s],Item:{id:\"minecraft:egg\",Count:1b}}}", ((int) Math.floor(power.getValue())), 0, -2, 0, n.getX(), n.getY(), n.getZ()); ItemStack stack = Utils.generateItemStackWithMeta(nbt, Items.BAT_SPAWN_EGG); - ItemStack air = CoffeeClientMain.client.player.getInventory().getMainHandStack().copy(); - Vec3d a = CoffeeClientMain.client.player.getEyePos(); + ItemStack air = ShadowMain.client.player.getInventory().getMainHandStack().copy(); + Vec3d a = ShadowMain.client.player.getEyePos(); BlockHitResult bhr = new BlockHitResult(a, Direction.DOWN, new BlockPos(a), false); - CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), stack); - CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), air); + CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), stack); + CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), air); PlayerInteractBlockC2SPacket p1 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(u1); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p1); - CoffeeClientMain.client.getNetworkHandler().sendPacket(u2); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(u1); + ShadowMain.client.getNetworkHandler().sendPacket(p1); + ShadowMain.client.getNetworkHandler().sendPacket(u2); lastFired = System.currentTimeMillis(); } void fbGhast() { - if (!Objects.requireNonNull(CoffeeClientMain.client.interactionManager).hasCreativeInventory()) { + if (!Objects.requireNonNull(ShadowMain.client.interactionManager).hasCreativeInventory()) { return; } - Vec3d v = Objects.requireNonNull(CoffeeClientMain.client.player).getRotationVector(); + Vec3d v = Objects.requireNonNull(ShadowMain.client.player).getRotationVector(); v = v.multiply(speed.getValue() / 10d); // ((int) Math.floor(power.getValue())) String nbt = String.format("{EntityTag:{id:\"minecraft:fireball\",ExplosionPower:%db,power:[%s,%s,%s],Item:{id:\"minecraft:egg\",Count:1b}}}", ((int) Math.floor(power.getValue())), v.x, v.y, v.z); ItemStack stack = Utils.generateItemStackWithMeta(nbt, Items.BAT_SPAWN_EGG); - ItemStack air = CoffeeClientMain.client.player.getInventory().getMainHandStack().copy(); - Vec3d a = CoffeeClientMain.client.player.getEyePos(); + ItemStack air = ShadowMain.client.player.getInventory().getMainHandStack().copy(); + Vec3d a = ShadowMain.client.player.getEyePos(); BlockHitResult bhr = new BlockHitResult(a, Direction.DOWN, new BlockPos(a), false); - CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), stack); - CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(CoffeeClientMain.client.player.getInventory().selectedSlot), air); + CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), stack); + CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(ShadowMain.client.player.getInventory().selectedSlot), air); PlayerInteractBlockC2SPacket p1 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(u1); - CoffeeClientMain.client.getNetworkHandler().sendPacket(p1); - CoffeeClientMain.client.getNetworkHandler().sendPacket(u2); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(u1); + ShadowMain.client.getNetworkHandler().sendPacket(p1); + ShadowMain.client.getNetworkHandler().sendPacket(u2); lastFired = System.currentTimeMillis(); } @Override public void tick() { - if (!Objects.requireNonNull(CoffeeClientMain.client.interactionManager).hasCreativeInventory()) { + if (!Objects.requireNonNull(ShadowMain.client.interactionManager).hasCreativeInventory()) { Notification.create(6000, "", true, Notification.Type.INFO, "You need to be in creative"); setEnabled(false); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/ClickNuke.java b/src/main/java/net/shadow/client/feature/module/impl/world/ClickNuke.java index 10543b0..ada8e2d 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/ClickNuke.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/ClickNuke.java @@ -10,7 +10,7 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.BooleanSetting; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.module.Module; @@ -52,8 +52,8 @@ public class ClickNuke extends Module { HitResult hr = Objects.requireNonNull(client.player).raycast(200d, 0f, true); Vec3d pos1 = hr.getPos(); BlockPos pos = new BlockPos(pos1); - int startY = MathHelper.clamp(r(pos.getY() - rangeY.getValue()), Objects.requireNonNull(CoffeeClientMain.client.world).getBottomY(), CoffeeClientMain.client.world.getTopY()); - int endY = MathHelper.clamp(r(pos.getY() + rangeY.getValue()), CoffeeClientMain.client.world.getBottomY(), CoffeeClientMain.client.world.getTopY()); + int startY = MathHelper.clamp(r(pos.getY() - rangeY.getValue()), Objects.requireNonNull(ShadowMain.client.world).getBottomY(), ShadowMain.client.world.getTopY()); + int endY = MathHelper.clamp(r(pos.getY() + rangeY.getValue()), ShadowMain.client.world.getBottomY(), ShadowMain.client.world.getTopY()); String cmd = "/fill " + r(pos.getX() - rangeX.getValue()) + " " + startY + " " + r(pos.getZ() - rangeZ.getValue()) + " " + r(pos.getX() + rangeX.getValue()) + " " + endY + " " + r(pos.getZ() + rangeZ.getValue()) + " " + "minecraft:air" + (destroy.getValue() ? " destroy" : ""); System.out.println(cmd); client.player.sendChatMessage(cmd); diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/LetThereBeLight.java b/src/main/java/net/shadow/client/feature/module/impl/world/LetThereBeLight.java index 8d53317..e863c48 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/LetThereBeLight.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/LetThereBeLight.java @@ -11,7 +11,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -32,7 +32,7 @@ public class LetThereBeLight extends Module { public void tick() { int torchSlot = -1; for (int i = 0; i < 9; i++) { - ItemStack is = Objects.requireNonNull(CoffeeClientMain.client.player).getInventory().getStack(i); + ItemStack is = Objects.requireNonNull(ShadowMain.client.player).getInventory().getStack(i); if (is.getItem() == Items.TORCH || is.getItem() == Items.SOUL_TORCH) { torchSlot = i; break; @@ -46,16 +46,16 @@ public class LetThereBeLight extends Module { } else { noBlocksAck = false; } - Vec3d ppos = CoffeeClientMain.client.player.getPos(); - Vec3d camPos = CoffeeClientMain.client.player.getCameraPosVec(1); + Vec3d ppos = ShadowMain.client.player.getPos(); + Vec3d camPos = ShadowMain.client.player.getCameraPosVec(1); a: for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { List<Vec3d> blocksWithShit = new ArrayList<>(); - for (int y = Objects.requireNonNull(CoffeeClientMain.client.world).getTopY(); y > CoffeeClientMain.client.world.getBottomY(); y--) { + for (int y = Objects.requireNonNull(ShadowMain.client.world).getTopY(); y > ShadowMain.client.world.getBottomY(); y--) { BlockPos bp = new BlockPos(ppos).add(x, y, z); - BlockState bs = CoffeeClientMain.client.world.getBlockState(bp); - if (bs.getMaterial().isReplaceable() && Blocks.TORCH.getDefaultState().canPlaceAt(CoffeeClientMain.client.world, bp)) { + BlockState bs = ShadowMain.client.world.getBlockState(bp); + if (bs.getMaterial().isReplaceable() && Blocks.TORCH.getDefaultState().canPlaceAt(ShadowMain.client.world, bp)) { blocksWithShit.add(Vec3d.of(bp)); } } @@ -64,7 +64,7 @@ public class LetThereBeLight extends Module { continue; // nowhere to place } BlockHitResult bhr = new BlockHitResult(real.get(), Direction.DOWN, new BlockPos(real.get()), false); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).interactBlock(CoffeeClientMain.client.player, CoffeeClientMain.client.world, Hand.MAIN_HAND, bhr); + Objects.requireNonNull(ShadowMain.client.interactionManager).interactBlock(ShadowMain.client.player, ShadowMain.client.world, Hand.MAIN_HAND, bhr); break a; } } @@ -87,15 +87,15 @@ public class LetThereBeLight extends Module { @Override public void onWorldRender(MatrixStack matrices) { - Vec3d ppos = Objects.requireNonNull(CoffeeClientMain.client.player).getPos(); - Vec3d camPos = CoffeeClientMain.client.player.getCameraPosVec(1); + Vec3d ppos = Objects.requireNonNull(ShadowMain.client.player).getPos(); + Vec3d camPos = ShadowMain.client.player.getCameraPosVec(1); for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { List<Vec3d> blocksWithShit = new ArrayList<>(); - for (int y = Objects.requireNonNull(CoffeeClientMain.client.world).getTopY(); y > CoffeeClientMain.client.world.getBottomY(); y--) { + for (int y = Objects.requireNonNull(ShadowMain.client.world).getTopY(); y > ShadowMain.client.world.getBottomY(); y--) { BlockPos bp = new BlockPos(ppos).add(x, y, z); - BlockState bs = CoffeeClientMain.client.world.getBlockState(bp); - if (bs.getMaterial().isReplaceable() && Blocks.TORCH.getDefaultState().canPlaceAt(CoffeeClientMain.client.world, bp)) { + BlockState bs = ShadowMain.client.world.getBlockState(bp); + if (bs.getMaterial().isReplaceable() && Blocks.TORCH.getDefaultState().canPlaceAt(ShadowMain.client.world, bp)) { blocksWithShit.add(Vec3d.of(bp)); } } @@ -104,7 +104,7 @@ public class LetThereBeLight extends Module { continue; // nowhere to place } Vec3d pos = real.get(); - Renderer.R3D.renderShape(pos, Blocks.TORCH.getDefaultState().getOutlineShape(CoffeeClientMain.client.world, new BlockPos(real.get()), ShapeContext.absent()), matrices, Color.WHITE); + Renderer.R3D.renderShape(pos, Blocks.TORCH.getDefaultState().getOutlineShape(ShadowMain.client.world, new BlockPos(real.get()), ShapeContext.absent()), matrices, Color.WHITE); // Renderer.R3D.renderOutline(real.get(),new Vec3d(1,1,1), Color.WHITE, matrices); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/Voider.java b/src/main/java/net/shadow/client/feature/module/impl/world/Voider.java index cf7e07f..589a9ca 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/Voider.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/Voider.java @@ -3,7 +3,7 @@ package net.shadow.client.feature.module.impl.world; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.DoubleSetting; import net.shadow.client.feature.gui.notifications.Notification; import net.shadow.client.feature.module.Module; @@ -41,9 +41,9 @@ public class Voider extends Module { Vec3d root = startPos.add(ox, 0, oz); BlockPos pp = new BlockPos(root); latest = Vec3d.of(pp); - String chat = String.format("/fill %d %d %d %d %d %d minecraft:air", pp.getX() - 2, Objects.requireNonNull(CoffeeClientMain.client.world) - .getBottomY(), pp.getZ() - 2, pp.getX() + 2, CoffeeClientMain.client.world.getTopY() - 1, pp.getZ() + 2); - Objects.requireNonNull(CoffeeClientMain.client.player).sendChatMessage(chat); + String chat = String.format("/fill %d %d %d %d %d %d minecraft:air", pp.getX() - 2, Objects.requireNonNull(ShadowMain.client.world) + .getBottomY(), pp.getZ() - 2, pp.getX() + 2, ShadowMain.client.world.getTopY() - 1, pp.getZ() + 2); + Objects.requireNonNull(ShadowMain.client.player).sendChatMessage(chat); Utils.sleep((long) (delay.getValue() + 0)); } } @@ -52,7 +52,7 @@ public class Voider extends Module { @Override public void enable() { - startPos = Objects.requireNonNull(CoffeeClientMain.client.player).getPos(); + startPos = Objects.requireNonNull(ShadowMain.client.player).getPos(); cancel.set(false); runner = new Thread(this::run); runner.start(); @@ -72,9 +72,9 @@ public class Voider extends Module { @Override public void onWorldRender(MatrixStack matrices) { if (latest != null) { - Renderer.R3D.renderFilled(new Vec3d(latest.x - 2, Objects.requireNonNull(CoffeeClientMain.client.world) + Renderer.R3D.renderFilled(new Vec3d(latest.x - 2, Objects.requireNonNull(ShadowMain.client.world) .getBottomY(), latest.z - 2), new Vec3d(5, 0.001, 5), Utils.getCurrentRGB(), matrices); - Renderer.R3D.renderLine(new Vec3d(latest.x + .5, CoffeeClientMain.client.world.getBottomY(), latest.z + .5), new Vec3d(latest.x + .5, CoffeeClientMain.client.world.getTopY(), latest.z + .5), Color.RED, matrices); + Renderer.R3D.renderLine(new Vec3d(latest.x + .5, ShadowMain.client.world.getBottomY(), latest.z + .5), new Vec3d(latest.x + .5, ShadowMain.client.world.getTopY(), latest.z + .5), Color.RED, matrices); } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/XRAY.java b/src/main/java/net/shadow/client/feature/module/impl/world/XRAY.java index a13da91..035a698 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/XRAY.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/XRAY.java @@ -12,7 +12,7 @@ import net.minecraft.block.OreBlock; import net.minecraft.block.RedstoneOreBlock; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.registry.Registry; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -44,12 +44,12 @@ public class XRAY extends Module { @Override public void enable() { - CoffeeClientMain.client.worldRenderer.reload(); + ShadowMain.client.worldRenderer.reload(); } @Override public void disable() { - CoffeeClientMain.client.worldRenderer.reload(); + ShadowMain.client.worldRenderer.reload(); } @Override diff --git a/src/main/java/net/shadow/client/helper/Keybind.java b/src/main/java/net/shadow/client/helper/Keybind.java index f372c4b..884a147 100644 --- a/src/main/java/net/shadow/client/helper/Keybind.java +++ b/src/main/java/net/shadow/client/helper/Keybind.java @@ -1,7 +1,7 @@ package net.shadow.client.helper; import net.minecraft.client.util.InputUtil; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; public record Keybind(int keycode) { @@ -9,7 +9,7 @@ public record Keybind(int keycode) { if (keycode < 0) { return false; } - boolean isActuallyPressed = InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), keycode); - return CoffeeClientMain.client.currentScreen == null && isActuallyPressed; + boolean isActuallyPressed = InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), keycode); + return ShadowMain.client.currentScreen == null && isActuallyPressed; } } diff --git a/src/main/java/net/shadow/client/helper/Packets.java b/src/main/java/net/shadow/client/helper/Packets.java index 3ac714d..fe5e178 100644 --- a/src/main/java/net/shadow/client/helper/Packets.java +++ b/src/main/java/net/shadow/client/helper/Packets.java @@ -3,7 +3,7 @@ package net.shadow.client.helper; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import java.util.Objects; @@ -11,11 +11,11 @@ public class Packets { public static void sendServerSideLook(Vec3d target1) { double vec = 57.2957763671875; - Vec3d target = target1.subtract(Objects.requireNonNull(CoffeeClientMain.client.player).getEyePos()); + Vec3d target = target1.subtract(Objects.requireNonNull(ShadowMain.client.player).getEyePos()); double square = Math.sqrt(target.x * target.x + target.z * target.z); float pitch = MathHelper.wrapDegrees((float) (-(MathHelper.atan2(target.y, square) * vec))); float yaw = MathHelper.wrapDegrees((float) (MathHelper.atan2(target.z, target.x) * vec) - 90.0F); - PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, CoffeeClientMain.client.player.isOnGround()); - Objects.requireNonNull(CoffeeClientMain.client.getNetworkHandler()).sendPacket(p); + PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, ShadowMain.client.player.isOnGround()); + Objects.requireNonNull(ShadowMain.client.getNetworkHandler()).sendPacket(p); } } \ No newline at end of file diff --git a/src/main/java/net/shadow/client/helper/Rotations.java b/src/main/java/net/shadow/client/helper/Rotations.java index 0c417ca..0df117c 100644 --- a/src/main/java/net/shadow/client/helper/Rotations.java +++ b/src/main/java/net/shadow/client/helper/Rotations.java @@ -9,7 +9,7 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.render.FreeLook; import net.shadow.client.helper.event.EventType; @@ -77,9 +77,9 @@ public class Rotations { } public static void lookAtPositionSmooth(Vec3d target, double laziness) { - double delX = target.x - Objects.requireNonNull(CoffeeClientMain.client.player).getX(); - double delZ = target.z - CoffeeClientMain.client.player.getZ(); - double delY = target.y - (CoffeeClientMain.client.player.getY() + CoffeeClientMain.client.player.getEyeHeight(CoffeeClientMain.client.player.getPose())); + double delX = target.x - Objects.requireNonNull(ShadowMain.client.player).getX(); + double delZ = target.z - ShadowMain.client.player.getZ(); + double delY = target.y - (ShadowMain.client.player.getY() + ShadowMain.client.player.getEyeHeight(ShadowMain.client.player.getPose())); FreeLook fl = ModuleRegistry.getByClass(FreeLook.class); double required = Math.toDegrees(Math.atan2(delZ, delX)) - 90, delta, add, speed; @@ -107,30 +107,30 @@ public class Rotations { fl.newpitch = (fl.newpitch + (float) add); } else { // setting yaw - delta = MathHelper.wrapDegrees(required - CoffeeClientMain.client.player.getYaw()); + delta = MathHelper.wrapDegrees(required - ShadowMain.client.player.getYaw()); speed = Math.abs(delta / laziness); add = speed * (delta >= 0 ? 1 : -1); if ((add >= 0 && add > delta) || (add < 0 && add < delta)) { add = delta; } - CoffeeClientMain.client.player.setYaw(CoffeeClientMain.client.player.getYaw() + (float) add); + ShadowMain.client.player.setYaw(ShadowMain.client.player.getYaw() + (float) add); // setting pitch double sqrt = sqrt1; required = -Math.toDegrees(Math.atan2(delY, sqrt)); - delta = MathHelper.wrapDegrees(required - CoffeeClientMain.client.player.getPitch()); + delta = MathHelper.wrapDegrees(required - ShadowMain.client.player.getPitch()); speed = Math.abs(delta / laziness); add = speed * (delta >= 0 ? 1 : -1); if ((add >= 0 && add > delta) || (add < 0 && add < delta)) { add = delta; } - CoffeeClientMain.client.player.setPitch(CoffeeClientMain.client.player.getPitch() + (float) add); + ShadowMain.client.player.setPitch(ShadowMain.client.player.getPitch() + (float) add); } } public static Vec2f getPitchYaw(Vec3d targetV3) { - return getPitchYawFromOtherEntity(Objects.requireNonNull(CoffeeClientMain.client.player).getEyePos(), targetV3); + return getPitchYawFromOtherEntity(Objects.requireNonNull(ShadowMain.client.player).getEyePos(), targetV3); } public static Vec2f getPitchYawFromOtherEntity(Vec3d eyePos, Vec3d targetV3) { diff --git a/src/main/java/net/shadow/client/helper/manager/AttackManager.java b/src/main/java/net/shadow/client/helper/manager/AttackManager.java index b4fdcd1..1f0dd83 100644 --- a/src/main/java/net/shadow/client/helper/manager/AttackManager.java +++ b/src/main/java/net/shadow/client/helper/manager/AttackManager.java @@ -2,7 +2,7 @@ package net.shadow.client.helper.manager; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; public class AttackManager { @@ -11,11 +11,11 @@ public class AttackManager { static LivingEntity lastAttacked; public static LivingEntity getLastAttackInTimeRange() { - if (getLastAttack() + MAX_ATTACK_TIMEOUT < System.currentTimeMillis() || CoffeeClientMain.client.player == null || CoffeeClientMain.client.player.isDead()) { + if (getLastAttack() + MAX_ATTACK_TIMEOUT < System.currentTimeMillis() || ShadowMain.client.player == null || ShadowMain.client.player.isDead()) { lastAttacked = null; } if (lastAttacked != null) { - if (lastAttacked.getPos().distanceTo(CoffeeClientMain.client.player.getPos()) > 16 || lastAttacked.isDead()) { + if (lastAttacked.getPos().distanceTo(ShadowMain.client.player.getPos()) > 16 || lastAttacked.isDead()) { lastAttacked = null; } } @@ -26,7 +26,7 @@ public class AttackManager { if (entity.getType() != EntityType.PLAYER) { return; } - if (entity.equals(CoffeeClientMain.client.player)) { + if (entity.equals(ShadowMain.client.player)) { return; } lastAttacked = entity; diff --git a/src/main/java/net/shadow/client/helper/manager/ConfigManager.java b/src/main/java/net/shadow/client/helper/manager/ConfigManager.java index 1c5ffa1..7e04b83 100644 --- a/src/main/java/net/shadow/client/helper/manager/ConfigManager.java +++ b/src/main/java/net/shadow/client/helper/manager/ConfigManager.java @@ -4,7 +4,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.config.SettingBase; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleRegistry; @@ -29,7 +29,7 @@ public class ConfigManager { public static boolean enabled = false; static { - CONFIG_FILE = new File(CoffeeClientMain.BASE, "config.sip"); + CONFIG_FILE = new File(ShadowMain.BASE, "config.sip"); } /** diff --git a/src/main/java/net/shadow/client/helper/render/Renderer.java b/src/main/java/net/shadow/client/helper/render/Renderer.java index 7d3d3c5..4b7b94a 100644 --- a/src/main/java/net/shadow/client/helper/render/Renderer.java +++ b/src/main/java/net/shadow/client/helper/render/Renderer.java @@ -8,7 +8,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.*; import net.minecraft.util.shape.VoxelShape; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.math.Matrix4x4; import net.shadow.client.helper.math.Vector3D; import org.lwjgl.opengl.GL11; @@ -23,7 +23,7 @@ public class Renderer { public static void renderCircleOutline(MatrixStack stack, Color c, Vec3d start, double rad, double width, double segments) { RenderSystem.disableCull(); - Camera camera = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera camera = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = camera.getPos(); start = start.subtract(camPos); stack.push(); @@ -61,7 +61,7 @@ public class Renderer { } public static void renderOutlineIntern(Vec3d start, Vec3d dimensions, MatrixStack stack, BufferBuilder buffer) { - Camera c = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera c = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = c.getPos(); start = start.subtract(camPos); Vec3d end = start.add(dimensions); @@ -146,7 +146,7 @@ public class Renderer { float green = color.getGreen() / 255f; float blue = color.getBlue() / 255f; float alpha = color.getAlpha() / 255f; - Camera c = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera c = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = c.getPos(); start = start.subtract(camPos); Vec3d end = start.add(dimensions); @@ -208,7 +208,7 @@ public class Renderer { float green = color.getGreen() / 255f; float blue = color.getBlue() / 255f; float alpha = color.getAlpha() / 255f; - Camera c = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera c = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = c.getPos(); start = start.subtract(camPos); Matrix4f matrix = matrices.peek().getPositionMatrix(); @@ -240,7 +240,7 @@ public class Renderer { float green = color.getGreen() / 255f; float blue = color.getBlue() / 255f; float alpha = color.getAlpha() / 255f; - Camera c = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera c = ShadowMain.client.gameRenderer.getCamera(); Vec3d camPos = c.getPos(); start = start.subtract(camPos); end = end.subtract(camPos); @@ -271,7 +271,7 @@ public class Renderer { public static Vec3d getCrosshairVector() { - Camera camera = CoffeeClientMain.client.gameRenderer.getCamera(); + Camera camera = ShadowMain.client.gameRenderer.getCamera(); float vec = 0.017453292F; float pi = (float) Math.PI; @@ -304,8 +304,8 @@ public class Renderer { * @return the start position (0,0) of the tooltip content, after considering where to place it */ public static Vec2f renderTooltip(MatrixStack stack, double arrowX, double arrowY, double width, double height, Color color, boolean renderUpsideDown) { - double centerX = CoffeeClientMain.client.getWindow().getScaledWidth() / 2d; - double centerY = CoffeeClientMain.client.getWindow().getScaledHeight() / 2d; + double centerX = ShadowMain.client.getWindow().getScaledWidth() / 2d; + double centerY = ShadowMain.client.getWindow().getScaledHeight() / 2d; /* left: * /\ @@ -387,8 +387,8 @@ public class Renderer { double height = endY - y; width = Math.max(0, width); height = Math.max(0, height); - float d = (float) CoffeeClientMain.client.getWindow().getScaleFactor(); - int ay = (int) ((CoffeeClientMain.client.getWindow().getScaledHeight() - (y + height)) * d); + float d = (float) ShadowMain.client.getWindow().getScaleFactor(); + int ay = (int) ((ShadowMain.client.getWindow().getScaledHeight() - (y + height)) * d); RenderSystem.enableScissor((int) (x * d), ay, (int) (width * d), (int) (height * d)); } @@ -575,21 +575,21 @@ public class Renderer { } public static Vec3d getScreenSpaceCoordinate(Vec3d pos, MatrixStack stack) { - Camera camera = CoffeeClientMain.client.getEntityRenderDispatcher().camera; + Camera camera = ShadowMain.client.getEntityRenderDispatcher().camera; Matrix4f matrix = stack.peek().getPositionMatrix(); double x = pos.x - camera.getPos().x; double y = pos.y - camera.getPos().y; double z = pos.z - camera.getPos().z; Vector4f vector4f = new Vector4f((float) x, (float) y, (float) z, 1.f); vector4f.transform(matrix); - int displayHeight = CoffeeClientMain.client.getWindow().getHeight(); + int displayHeight = ShadowMain.client.getWindow().getHeight(); Vector3D screenCoords = new Vector3D(); int[] viewport = new int[4]; GL11.glGetIntegerv(GL11.GL_VIEWPORT, viewport); Matrix4x4 matrix4x4Proj = Matrix4x4.copyFromColumnMajor(RenderSystem.getProjectionMatrix());//no more joml :) Matrix4x4 matrix4x4Model = Matrix4x4.copyFromColumnMajor(RenderSystem.getModelViewMatrix());//but I do the math myself now :( (heck math) matrix4x4Proj.mul(matrix4x4Model).project(vector4f.getX(), vector4f.getY(), vector4f.getZ(), viewport, screenCoords); - return new Vec3d(screenCoords.x / CoffeeClientMain.client.getWindow().getScaleFactor(), (displayHeight - screenCoords.y) / CoffeeClientMain.client.getWindow() + return new Vec3d(screenCoords.x / ShadowMain.client.getWindow().getScaleFactor(), (displayHeight - screenCoords.y) / ShadowMain.client.getWindow() .getScaleFactor(), screenCoords.z); } diff --git a/src/main/java/net/shadow/client/helper/util/Utils.java b/src/main/java/net/shadow/client/helper/util/Utils.java index 7c9974f..db27497 100644 --- a/src/main/java/net/shadow/client/helper/util/Utils.java +++ b/src/main/java/net/shadow/client/helper/util/Utils.java @@ -24,7 +24,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.RaycastContext; import net.minecraft.world.World; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.screen.CoffeeConsoleScreen; import net.shadow.client.helper.Texture; import net.shadow.client.helper.font.adapter.FontAdapter; @@ -61,7 +61,7 @@ public class Utils { } public static void setClientTps(float tps) { - IRenderTickCounterAccessor accessor = ((IRenderTickCounterAccessor) ((IMinecraftClientAccessor) CoffeeClientMain.client).getRenderTickCounter()); + IRenderTickCounterAccessor accessor = ((IRenderTickCounterAccessor) ((IMinecraftClientAccessor) ShadowMain.client).getRenderTickCounter()); accessor.setTickTime(1000f / tps); } @@ -72,7 +72,7 @@ public class Utils { public static Vec3d getInterpolatedEntityPosition(Entity entity) { Vec3d a = entity.getPos(); Vec3d b = new Vec3d(entity.prevX, entity.prevY, entity.prevZ); - float p = CoffeeClientMain.client.getTickDelta(); + float p = ShadowMain.client.getTickDelta(); return new Vec3d(MathHelper.lerp(p, b.x, a.x), MathHelper.lerp(p, b.y, a.y), MathHelper.lerp(p, b.z, a.z)); } @@ -85,7 +85,7 @@ public class Utils { ByteBuffer data = BufferUtils.createByteBuffer(bytes.length).put(bytes); data.flip(); NativeImageBackedTexture tex = new NativeImageBackedTexture(NativeImage.read(data)); - CoffeeClientMain.client.execute(() -> CoffeeClientMain.client.getTextureManager().registerTexture(i, tex)); + ShadowMain.client.execute(() -> ShadowMain.client.getTextureManager().registerTexture(i, tex)); } catch (Exception e) { System.out.println("failed to register"); e.printStackTrace(); @@ -177,7 +177,7 @@ public class Utils { Texture texIdent = new Texture("preview/" + uuid.hashCode() + ""); uCache.put(uuid, texIdent); HttpRequest hr = HttpRequest.newBuilder().uri(URI.create("https://crafatar.com/avatars/" + uuid + "?overlay")).header("User-Agent", "why").build(); - CoffeeClientMain.client.execute(() -> CoffeeClientMain.client.getTextureManager().registerTexture(texIdent, EMPTY)); + ShadowMain.client.execute(() -> ShadowMain.client.getTextureManager().registerTexture(texIdent, EMPTY)); downloader.sendAsync(hr, HttpResponse.BodyHandlers.ofByteArray()).thenAccept(httpResponse -> { try { BufferedImage bi = ImageIO.read(new ByteArrayInputStream(httpResponse.body())); @@ -202,7 +202,7 @@ public class Utils { NativeImage img = NativeImage.read(data); NativeImageBackedTexture texture = new NativeImageBackedTexture(img); - CoffeeClientMain.client.execute(() -> CoffeeClientMain.client.getTextureManager().registerTexture(tex, texture)); + ShadowMain.client.execute(() -> ShadowMain.client.getTextureManager().registerTexture(tex, texture)); } catch (Exception ignored) { } @@ -223,14 +223,14 @@ public class Utils { public static void drop(int index) { int translatedSlotId = slotIndexToId(index); - Objects.requireNonNull(CoffeeClientMain.client.interactionManager) - .clickSlot(Objects.requireNonNull(CoffeeClientMain.client.player).currentScreenHandler.syncId, translatedSlotId, 1, SlotActionType.THROW, CoffeeClientMain.client.player); + Objects.requireNonNull(ShadowMain.client.interactionManager) + .clickSlot(Objects.requireNonNull(ShadowMain.client.player).currentScreenHandler.syncId, translatedSlotId, 1, SlotActionType.THROW, ShadowMain.client.player); } public static void moveStackToOther(int slotIdFrom, int slotIdTo) { - Objects.requireNonNull(CoffeeClientMain.client.interactionManager).clickSlot(0, slotIdFrom, 0, SlotActionType.PICKUP, CoffeeClientMain.client.player); // pick up item from stack - CoffeeClientMain.client.interactionManager.clickSlot(0, slotIdTo, 0, SlotActionType.PICKUP, CoffeeClientMain.client.player); // put item to target - CoffeeClientMain.client.interactionManager.clickSlot(0, slotIdFrom, 0, SlotActionType.PICKUP, CoffeeClientMain.client.player); // (in case target slot had item) put item from target back to from + Objects.requireNonNull(ShadowMain.client.interactionManager).clickSlot(0, slotIdFrom, 0, SlotActionType.PICKUP, ShadowMain.client.player); // pick up item from stack + ShadowMain.client.interactionManager.clickSlot(0, slotIdTo, 0, SlotActionType.PICKUP, ShadowMain.client.player); // put item to target + ShadowMain.client.interactionManager.clickSlot(0, slotIdFrom, 0, SlotActionType.PICKUP, ShadowMain.client.player); // (in case target slot had item) put item from target back to from } } @@ -281,11 +281,11 @@ public class Utils { public static class Mouse { public static double getMouseX() { - return CoffeeClientMain.client.mouse.getX() / CoffeeClientMain.client.getWindow().getScaleFactor(); + return ShadowMain.client.mouse.getX() / ShadowMain.client.getWindow().getScaleFactor(); } public static double getMouseY() { - return CoffeeClientMain.client.mouse.getY() / CoffeeClientMain.client.getWindow().getScaleFactor(); + return ShadowMain.client.mouse.getY() / ShadowMain.client.getWindow().getScaleFactor(); } } @@ -378,7 +378,7 @@ public class Utils { public static void message0(String n, Color c) { LiteralText t = new LiteralText(n); t.setStyle(t.getStyle().withColor(TextColor.fromRgb(c.getRGB()))); - if (CoffeeClientMain.client.player != null) CoffeeClientMain.client.player.sendMessage(t, false); + if (ShadowMain.client.player != null) ShadowMain.client.player.sendMessage(t, false); // if (c.equals(Color.WHITE)) c = Color.BLACK; CoffeeConsoleScreen.instance().addLog(new CoffeeConsoleScreen.LogEntry(n, c)); } diff --git a/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java b/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java index 5a60d34..b30d729 100644 --- a/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java @@ -5,7 +5,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.Command; import net.shadow.client.feature.command.CommandRegistry; import net.shadow.client.feature.gui.screen.CoffeeConsoleScreen; @@ -43,9 +43,9 @@ public class AChatScreenMixin extends Screen { @Redirect(method = "keyPressed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ChatScreen;sendMessage(Ljava/lang/String;)V")) void atomic_interceptChatMessage(ChatScreen instance, String s) { if (s.startsWith(".")) { // filter all messages starting with . - CoffeeClientMain.client.inGameHud.getChatHud().addToMessageHistory(s); + ShadowMain.client.inGameHud.getChatHud().addToMessageHistory(s); if (s.equalsIgnoreCase(".console")) { - Utils.TickManager.runInNTicks(2, () -> CoffeeClientMain.client.setScreen(CoffeeConsoleScreen.instance())); + Utils.TickManager.runInNTicks(2, () -> ShadowMain.client.setScreen(CoffeeConsoleScreen.instance())); } else { CommandRegistry.execute(s.substring(1)); // cut off prefix } @@ -94,7 +94,7 @@ public class AChatScreenMixin extends Screen { if (cmd.isEmpty()) { return; } - float cmdTWidth = CoffeeClientMain.client.textRenderer.getWidth(cmd); + float cmdTWidth = ShadowMain.client.textRenderer.getWidth(cmd); double cmdXS = chatField.x + 5 + cmdTWidth; List<String> suggestions = getSuggestions(cmd); diff --git a/src/main/java/net/shadow/client/mixin/AECMixin.java b/src/main/java/net/shadow/client/mixin/AECMixin.java index 0000621..df51528 100644 --- a/src/main/java/net/shadow/client/mixin/AECMixin.java +++ b/src/main/java/net/shadow/client/mixin/AECMixin.java @@ -1,8 +1,7 @@ package net.shadow.client.mixin; import net.minecraft.entity.AreaEffectCloudEntity; -import net.shadow.client.CoffeeClientMain; -import net.shadow.client.feature.module.ModuleRegistry; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.impl.misc.AntiCrash; import net.shadow.client.mixinUtil.ParticleManagerDuck; import org.spongepowered.asm.mixin.Debug; @@ -17,7 +16,7 @@ public class AECMixin { int re(int value) { AntiCrash ac = AntiCrash.instance(); if (ac.isEnabled() && ac.getCapParticles().getValue()) { - int partTotal = ((ParticleManagerDuck) CoffeeClientMain.client.particleManager).getTotalParticles(); + int partTotal = ((ParticleManagerDuck) ShadowMain.client.particleManager).getTotalParticles(); int newCount = partTotal + value; if (newCount >= ac.getParticleMax().getValue()) { int space = (int) Math.floor(ac.getParticleMax().getValue() - partTotal); diff --git a/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java b/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java index 1b48a4f..7598281 100644 --- a/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java @@ -9,7 +9,7 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.option.GameOptions; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.movement.InventoryWalk; import org.lwjgl.glfw.GLFW; @@ -35,7 +35,7 @@ public abstract class AGenericContainerScreenMixin { protected int y; boolean keyPressed(KeyBinding bind) { - return InputUtil.isKeyPressed(CoffeeClientMain.client.getWindow().getHandle(), bind.getDefaultKey().getCode()); + return InputUtil.isKeyPressed(ShadowMain.client.getWindow().getHandle(), bind.getDefaultKey().getCode()); } void setState(KeyBinding bind) { @@ -47,7 +47,7 @@ public abstract class AGenericContainerScreenMixin { if (!ModuleRegistry.getByClass(InventoryWalk.class).isEnabled()) { return; } - GameOptions go = CoffeeClientMain.client.options; + GameOptions go = ShadowMain.client.options; setState(go.forwardKey); setState(go.rightKey); setState(go.backKey); @@ -69,8 +69,8 @@ public abstract class AGenericContainerScreenMixin { if (keyPressed(arrowDown)) { pitchOffset += 5f; } - Objects.requireNonNull(CoffeeClientMain.client.player).setYaw(CoffeeClientMain.client.player.getYaw() + yawOffset); - CoffeeClientMain.client.player.setPitch(CoffeeClientMain.client.player.getPitch() + pitchOffset); + Objects.requireNonNull(ShadowMain.client.player).setYaw(ShadowMain.client.player.getYaw() + yawOffset); + ShadowMain.client.player.setPitch(ShadowMain.client.player.getPitch() + pitchOffset); } } diff --git a/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java b/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java index a15d2bc..0e04ebf 100644 --- a/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java @@ -3,7 +3,7 @@ package net.shadow.client.mixin; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.screen.NbtEditorScreen; import net.shadow.client.feature.gui.widget.RoundButton; import net.shadow.client.helper.util.Utils; @@ -22,10 +22,10 @@ public class CreativeInventoryScreenMixin extends Screen { @Inject(method = "init", at = @At("RETURN")) void postInit(CallbackInfo ci) { RoundButton nbtEdit = new RoundButton(RoundButton.STANDARD, 5, 5, 64, 20, "NBT editor", () -> { - if (CoffeeClientMain.client.player.getInventory().getMainHandStack().isEmpty()) { + if (ShadowMain.client.player.getInventory().getMainHandStack().isEmpty()) { Utils.Logging.error("You need to hold an item!"); } else { - CoffeeClientMain.client.setScreen(new NbtEditorScreen(CoffeeClientMain.client.player.getInventory().getMainHandStack())); + ShadowMain.client.setScreen(new NbtEditorScreen(ShadowMain.client.player.getInventory().getMainHandStack())); } }); addDrawableChild(nbtEdit); diff --git a/src/main/java/net/shadow/client/mixin/EntityMixin.java b/src/main/java/net/shadow/client/mixin/EntityMixin.java index b1ba12b..e8ec6af 100644 --- a/src/main/java/net/shadow/client/mixin/EntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/EntityMixin.java @@ -8,7 +8,7 @@ package net.shadow.client.mixin; import net.minecraft.entity.Entity; import net.minecraft.util.math.Box; import net.minecraft.world.border.WorldBorder; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.movement.IgnoreWorldBorder; import net.shadow.client.feature.module.impl.render.FreeLook; @@ -28,6 +28,6 @@ public abstract class EntityMixin { @Redirect(method = "updateVelocity", at = @At(value = "INVOKE", target = "net/minecraft/entity/Entity.getYaw()F")) float atomic_overwriteFreelookYaw(Entity instance) { - return instance.equals(CoffeeClientMain.client.player) && ModuleRegistry.getByClass(FreeLook.class).isEnabled() ? ModuleRegistry.getByClass(FreeLook.class).newyaw : instance.getYaw(); + return instance.equals(ShadowMain.client.player) && ModuleRegistry.getByClass(FreeLook.class).isEnabled() ? ModuleRegistry.getByClass(FreeLook.class).newyaw : instance.getYaw(); } } diff --git a/src/main/java/net/shadow/client/mixin/GameRendererMixin.java b/src/main/java/net/shadow/client/mixin/GameRendererMixin.java index 9103283..7b96417 100644 --- a/src/main/java/net/shadow/client/mixin/GameRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/GameRendererMixin.java @@ -9,7 +9,7 @@ import net.minecraft.entity.Entity; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.Vec3d; import net.minecraft.world.RaycastContext; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.DoesMSAA; import net.shadow.client.feature.gui.screen.ClientScreen; import net.shadow.client.feature.module.Module; @@ -36,7 +36,7 @@ public class GameRendererMixin { @Inject(at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z", opcode = Opcodes.GETFIELD, ordinal = 0), method = "renderWorld") void atomic_dispatchWorldRender(float tickDelta, long limitTime, MatrixStack matrix, CallbackInfo ci) { if (vb) { - CoffeeClientMain.client.options.bobView = true; + ShadowMain.client.options.bobView = true; vb = false; } MSAAFramebuffer.use(MSAAFramebuffer.MAX_SAMPLES, () -> { @@ -76,9 +76,9 @@ public class GameRendererMixin { @Inject(at = @At("HEAD"), method = "bobView", cancellable = true) private void atomic_stopCursorBob(MatrixStack matrices, float f, CallbackInfo ci) { - if (CoffeeClientMain.client.options.bobView && dis) { + if (ShadowMain.client.options.bobView && dis) { vb = true; - CoffeeClientMain.client.options.bobView = false; + ShadowMain.client.options.bobView = false; dis = false; ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/KeyboardMixin.java b/src/main/java/net/shadow/client/mixin/KeyboardMixin.java index 477c328..d498900 100644 --- a/src/main/java/net/shadow/client/mixin/KeyboardMixin.java +++ b/src/main/java/net/shadow/client/mixin/KeyboardMixin.java @@ -2,7 +2,7 @@ package net.shadow.client.mixin; import net.minecraft.client.Keyboard; import net.minecraft.client.MinecraftClient; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; import net.shadow.client.helper.event.events.KeyboardEvent; @@ -26,8 +26,8 @@ public class KeyboardMixin { @Inject(method = "onKey", at = @At("RETURN")) void atomic_postKeyPressed(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { if (window == this.client.getWindow() - .getHandle() && CoffeeClientMain.client.currentScreen == null && System.currentTimeMillis() - CoffeeClientMain.lastScreenChange > 10) { // make sure we are in game and the screen has been there for at least 10 ms - if (CoffeeClientMain.client.player == null || CoffeeClientMain.client.world == null) { + .getHandle() && ShadowMain.client.currentScreen == null && System.currentTimeMillis() - ShadowMain.lastScreenChange > 10) { // make sure we are in game and the screen has been there for at least 10 ms + if (ShadowMain.client.player == null || ShadowMain.client.world == null) { return; // again, make sure we are in game and exist } KeybindingManager.updateSingle(key, action); diff --git a/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java b/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java index 207b2dd..31ea0c1 100644 --- a/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java @@ -5,7 +5,7 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.fluid.FluidState; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.movement.Jesus; import net.shadow.client.feature.module.impl.movement.NoLevitation; @@ -25,7 +25,7 @@ import java.util.Objects; public class LivingEntityMixin { @Inject(method = "onAttacking", at = @At("HEAD")) public void atomic_setLastAttacked(Entity target, CallbackInfo ci) { - if (this.equals(CoffeeClientMain.client.player) && target instanceof LivingEntity entity) { + if (this.equals(ShadowMain.client.player) && target instanceof LivingEntity entity) { AttackManager.registerLastAttacked(entity); } } @@ -36,11 +36,11 @@ public class LivingEntityMixin { // } @Inject(method = "canWalkOnFluid", at = @At("HEAD"), cancellable = true) public void atomic_overwriteCanWalkOnFluid(FluidState fluidState, CallbackInfoReturnable<Boolean> cir) { - if (CoffeeClientMain.client.player == null) { + if (ShadowMain.client.player == null) { return; } // shut up monkey these are mixins you fucking idiot - if (this.equals(CoffeeClientMain.client.player)) { + if (this.equals(ShadowMain.client.player)) { Jesus jesus = ModuleRegistry.getByClass(Jesus.class); if (jesus.isEnabled() && jesus.mode.getValue() == Jesus.Mode.Solid) { cir.setReturnValue(true); @@ -50,7 +50,7 @@ public class LivingEntityMixin { @Redirect(method = "travel", at = @At(value = "INVOKE", target = "net/minecraft/entity/LivingEntity.hasStatusEffect(Lnet/minecraft/entity/effect/StatusEffect;)Z")) boolean atomic_stopLevitationEffect(LivingEntity instance, StatusEffect effect) { - if (instance.equals(CoffeeClientMain.client.player) && ModuleRegistry.getByClass(NoLevitation.class).isEnabled() && effect == StatusEffects.LEVITATION) { + if (instance.equals(ShadowMain.client.player) && ModuleRegistry.getByClass(NoLevitation.class).isEnabled() && effect == StatusEffects.LEVITATION) { return false; } else { return instance.hasStatusEffect(effect); @@ -59,7 +59,7 @@ public class LivingEntityMixin { @Inject(method = "pushAwayFrom", at = @At("HEAD"), cancellable = true) public void atomic_cancelPush(Entity entity, CallbackInfo ci) { - if (this.equals(CoffeeClientMain.client.player)) { + if (this.equals(ShadowMain.client.player)) { if (Objects.requireNonNull(ModuleRegistry.getByClass(NoPush.class)).isEnabled()) { ci.cancel(); } @@ -68,7 +68,7 @@ public class LivingEntityMixin { @Redirect(method = "jump", at = @At(value = "INVOKE", target = "net/minecraft/entity/LivingEntity.getYaw()F")) private float atomic_overwriteFreelookYaw(LivingEntity instance) { - if (instance.equals(CoffeeClientMain.client.player) && ModuleRegistry.getByClass(FreeLook.class).isEnabled()) { + if (instance.equals(ShadowMain.client.player) && ModuleRegistry.getByClass(FreeLook.class).isEnabled()) { return ModuleRegistry.getByClass(FreeLook.class).newyaw; } return instance.getYaw(); diff --git a/src/main/java/net/shadow/client/mixin/LivingEntityRendererMixin.java b/src/main/java/net/shadow/client/mixin/LivingEntityRendererMixin.java index 4c6db57..99036fc 100644 --- a/src/main/java/net/shadow/client/mixin/LivingEntityRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/LivingEntityRendererMixin.java @@ -7,7 +7,7 @@ package net.shadow.client.mixin; import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.entity.LivingEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.Rotations; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -19,7 +19,7 @@ public class LivingEntityRendererMixin { @ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 2, at = @At(value = "STORE", ordinal = 0)) public float atomic_overwriteYaw(float oldValue, LivingEntity le) { - if (Rotations.isEnabled() && le.equals(CoffeeClientMain.client.player)) { + if (Rotations.isEnabled() && le.equals(ShadowMain.client.player)) { return Rotations.getClientYaw(); } return oldValue; @@ -28,7 +28,7 @@ public class LivingEntityRendererMixin { @ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 3, at = @At(value = "STORE", ordinal = 0)) public float atomic_overwriteHeadYaw(float oldValue, LivingEntity le) { - if (le.equals(CoffeeClientMain.client.player) && Rotations.isEnabled()) { + if (le.equals(ShadowMain.client.player) && Rotations.isEnabled()) { return Rotations.getClientYaw(); } return oldValue; @@ -37,7 +37,7 @@ public class LivingEntityRendererMixin { @ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 5, at = @At(value = "STORE", ordinal = 3)) public float atomic_overwritePitch(float oldValue, LivingEntity le) { - if (le.equals(CoffeeClientMain.client.player) && Rotations.isEnabled()) { + if (le.equals(ShadowMain.client.player) && Rotations.isEnabled()) { return Rotations.getClientPitch(); } return oldValue; diff --git a/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java b/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java index 92081bb..d93c2ac 100644 --- a/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java @@ -3,7 +3,7 @@ package net.shadow.client.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.RunArgs; import net.minecraft.client.gui.screen.Screen; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.world.FastUse; import net.shadow.client.helper.manager.ConfigManager; @@ -29,12 +29,12 @@ public class MinecraftClientMixin { @Inject(method = "<init>", at = @At("TAIL")) void atomic_postInit(RunArgs args, CallbackInfo ci) { - CoffeeClientMain.INSTANCE.postWindowInit(); + ShadowMain.INSTANCE.postWindowInit(); } @Inject(method = "setScreen", at = @At("HEAD")) void atomic_preSetScreen(Screen screen, CallbackInfo ci) { - CoffeeClientMain.lastScreenChange = System.currentTimeMillis(); + ShadowMain.lastScreenChange = System.currentTimeMillis(); } @Redirect(method = "handleInputEvents", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/MinecraftClient;itemUseCooldown:I")) diff --git a/src/main/java/net/shadow/client/mixin/MouseMixin.java b/src/main/java/net/shadow/client/mixin/MouseMixin.java index 5b48127..461fe1f 100644 --- a/src/main/java/net/shadow/client/mixin/MouseMixin.java +++ b/src/main/java/net/shadow/client/mixin/MouseMixin.java @@ -1,7 +1,7 @@ package net.shadow.client.mixin; import net.minecraft.client.Mouse; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; import net.shadow.client.helper.event.events.MouseEvent; @@ -15,7 +15,7 @@ public class MouseMixin { @Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true) public void atomic_dispatchMouseEvent(long window, int button, int action, int mods, CallbackInfo ci) { - if (window == CoffeeClientMain.client.getWindow().getHandle()) { + if (window == ShadowMain.client.getWindow().getHandle()) { if (Events.fireEvent(EventType.MOUSE_EVENT, new MouseEvent(button, action))) { ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java b/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java index 6ed98a5..25415cd 100644 --- a/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java @@ -3,7 +3,7 @@ package net.shadow.client.mixin; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; import net.minecraft.text.Text; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.gui.screen.ProxyManagerScreen; import net.shadow.client.feature.gui.widget.RoundButton; import org.spongepowered.asm.mixin.Mixin; @@ -22,7 +22,7 @@ public class MultiplayerScreenMixin extends Screen { @Inject(method = "init", at = @At("RETURN")) void init(CallbackInfo ci) { double sourceY = 32 / 2d - 20 / 2d; - RoundButton proxies = new RoundButton(new Color(40, 40, 40), 5, sourceY, 60, 20, "Proxies", () -> CoffeeClientMain.client.setScreen(new ProxyManagerScreen(this))); + RoundButton proxies = new RoundButton(new Color(40, 40, 40), 5, sourceY, 60, 20, "Proxies", () -> ShadowMain.client.setScreen(new ProxyManagerScreen(this))); addDrawableChild(proxies); } } diff --git a/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java b/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java index 2a62865..af7096a 100644 --- a/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java @@ -1,7 +1,7 @@ package net.shadow.client.mixin; import net.minecraft.entity.player.PlayerEntity; -import net.shadow.client.CoffeeClientMain; +import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.movement.Hyperspeed; import net.shadow.client.feature.module.impl.movement.LongJump; @@ -28,7 +28,7 @@ public class PlayerEntityMixin { @Inject(method = "getMovementSpeed", at = @At("RETURN"), cancellable = true) void a(CallbackInfoReturnable<Float> cir) { Hyperspeed hs = ModuleRegistry.getByClass(Hyperspeed.class); - if (!hs.isEnabled() || !equals(CoffeeClientMain.client.player)) { + if (!hs.isEnabled() || !equals(ShadowMain.client.player)) { return; } cir.setReturnValue((float) (cir.getReturnValue() * hs.speed.getValue())); @@ -36,7 +36,7 @@ public class PlayerEntityMixin { @Inject(method = "jump", at = @At("RETURN")) void atomic_applyLongJump(CallbackInfo ci) { - if (!this.equals(CoffeeClientMain.client.player)) { + if (!this.equals(ShadowMain.client.player)) { return; } if (ModuleRegistry.getByClass(LongJump.class).isEnabled()) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index d291086..7ddaf14 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,12 +1,12 @@ { "schemaVersion": 1, - "id": "coffeeclient", + "id": "shadow", "version": "${version}", - "name": "Coffee client", - "description": "YOOOOO 2500 KROMER WE GETTIN RICH BOYYS", + "name": "Shadow client", + "description": "incredibly real", "authors": [ "0x150", - "Kopamed" + "Saturn5VFive" ], "contributors": [], "contact": {}, @@ -15,13 +15,13 @@ "environment": "*", "entrypoints": { "main": [ - "net.shadow.client.CoffeeClientMain" + "net.shadow.client.ShadowMain" ], "client": [], "server": [] }, "mixins": [ - "sipoverprivate.mixins.json" + "shadow.mixins.json" ], "depends": { "fabricloader": ">=0.12.12" diff --git a/src/main/resources/sipoverprivate.mixins.json b/src/main/resources/shadow.mixins.json similarity index 100% rename from src/main/resources/sipoverprivate.mixins.json rename to src/main/resources/shadow.mixins.json