diff --git a/src/main/java/net/shadow/client/feature/command/argument/PlayerFromNameArgumentParser.java b/src/main/java/net/shadow/client/feature/command/argument/PlayerFromNameArgumentParser.java index 6b9213f..097b3aa 100644 --- a/src/main/java/net/shadow/client/feature/command/argument/PlayerFromNameArgumentParser.java +++ b/src/main/java/net/shadow/client/feature/command/argument/PlayerFromNameArgumentParser.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.shadow.client.ShadowMain; import net.shadow.client.feature.command.exception.CommandException; +@SuppressWarnings("ClassCanBeRecord") public class PlayerFromNameArgumentParser implements ArgumentParser { final boolean ignoreCase; diff --git a/src/main/java/net/shadow/client/feature/command/argument/StringArgumentParser.java b/src/main/java/net/shadow/client/feature/command/argument/StringArgumentParser.java index 910d50c..a66fd26 100644 --- a/src/main/java/net/shadow/client/feature/command/argument/StringArgumentParser.java +++ b/src/main/java/net/shadow/client/feature/command/argument/StringArgumentParser.java @@ -8,7 +8,7 @@ import net.shadow.client.feature.command.exception.CommandException; public class StringArgumentParser implements ArgumentParser { @Override - public String parse(String argument) throws CommandException { + public String parse(String argument) { return argument; } } diff --git a/src/main/java/net/shadow/client/feature/command/impl/Config.java b/src/main/java/net/shadow/client/feature/command/impl/Config.java index 4417293..67495f5 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Config.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Config.java @@ -32,7 +32,7 @@ public class Config extends Command { } @Override - public void onExecute(String[] args) throws CommandException { + public void onExecute(String[] args) { // validateArgumentsLength(args, 1); if (args.length == 0) { message("Syntax: .config (module) "); diff --git a/src/main/java/net/shadow/client/feature/command/impl/Open.java b/src/main/java/net/shadow/client/feature/command/impl/Open.java deleted file mode 100644 index 4ae3801..0000000 --- a/src/main/java/net/shadow/client/feature/command/impl/Open.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. - */ - -package net.shadow.client.feature.command.impl; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; -import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; -import net.shadow.client.ShadowMain; -import net.shadow.client.feature.command.Command; - -import java.util.Arrays; - -public class Open extends Command { - private static final ItemStack[] ITEMS = new ItemStack[27]; - - public Open() { - super("Open", "Open contianers", "open"); - } - - private static void getItemsInContainerItem(ItemStack itemStack) { - Arrays.fill(Open.ITEMS, ItemStack.EMPTY); - NbtCompound nbt = itemStack.getNbt(); - - if (nbt != null && nbt.contains("ShadowItemTag")) { - NbtCompound nbt2 = nbt.getCompound("ShadowItemTag"); - if (nbt2.contains("Items")) { - NbtList nbt3 = (NbtList) nbt2.get("Items"); - for (int i = 0; i < nbt3.size(); i++) { - ShadowMain.client.player.networkHandler.sendPacket( - new CreativeInventoryActionC2SPacket(nbt3.getCompound(i).getByte("Slot") + 9, ItemStack.fromNbt(nbt3.getCompound(i)))); - } - } - } - if (nbt != null && nbt.contains("BlockEntityTag")) { - NbtCompound nbt2 = nbt.getCompound("BlockEntityTag"); - if (nbt2.contains("Items")) { - NbtList nbt3 = (NbtList) nbt2.get("Items"); - for (int i = 0; i < nbt3.size(); i++) { - ShadowMain.client.player.networkHandler.sendPacket( - new CreativeInventoryActionC2SPacket(nbt3.getCompound(i).getByte("Slot") + 9, ItemStack.fromNbt(nbt3.getCompound(i)))); - } - } - } - } - - @Override - public void onExecute(String[] args) { - success("Done!"); - getItemsInContainerItem(ShadowMain.client.player.getMainHandStack()); - } - -} 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 17bb8d5..67933a6 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 @@ -66,7 +66,8 @@ public class Taco extends Command { } catch (Exception ignored) { } - if (!gifPath.exists()) gifPath.mkdir(); + if (!gifPath.exists()) //noinspection ResultOfMethodCallIgnored + gifPath.mkdir(); try { if (!storage.isFile()) { //noinspection ResultOfMethodCallIgnored @@ -95,7 +96,7 @@ public class Taco extends Command { } } - static void initFrames() throws Exception { + static void initFrames() { checkGifPath(); for (Frame frame : frames) { ShadowMain.client.getTextureManager().destroyTexture(frame.getI()); diff --git a/src/main/java/net/shadow/client/feature/command/impl/Template.java b/src/main/java/net/shadow/client/feature/command/impl/Template.java index 7125917..2b6ab1b 100644 --- a/src/main/java/net/shadow/client/feature/command/impl/Template.java +++ b/src/main/java/net/shadow/client/feature/command/impl/Template.java @@ -18,6 +18,6 @@ public class Template extends Command { } @Override - public void onExecute(String[] args) throws CommandException { + public void onExecute(String[] args) { } } diff --git a/src/main/java/net/shadow/client/feature/config/SettingBase.java b/src/main/java/net/shadow/client/feature/config/SettingBase.java index a7c2fe9..c35eaf2 100644 --- a/src/main/java/net/shadow/client/feature/config/SettingBase.java +++ b/src/main/java/net/shadow/client/feature/config/SettingBase.java @@ -29,7 +29,7 @@ public abstract class SettingBase { */ V value; - Consumer onChanged; + final Consumer onChanged; /** * Constructs a new Setting 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 1d54c29..782b4f9 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 @@ -184,21 +184,6 @@ public class ParticleRenderer { stack.push(); double radToUse = pk * circleRad; Renderer.R2D.renderCircle(stack, Renderer.Util.lerp(theme.getAccent(), DYING, pk), x - radToUse / 2d, y - radToUse / 2d, radToUse, 30); -// double maxDist = 100; -// for (Particle particle : others.stream().filter(particle -> particle != this).toList()) { -// double px = particle.x; -// double py = particle.y; -// double dist = Math.sqrt(Math.pow((px - this.x), 2) + Math.pow((py - this.y), 2)); -// if (dist < maxDist) { -// long sd1 = Math.min(particle.origLife - particle.life, fadeTime); -// long ed1 = Math.min(particle.life, fadeTime); -// long do1 = Math.min(sd1, ed1); -// double pk1 = (do1 / (double) fadeTime); -// double p = 1 - (dist / maxDist); -// p = Math.min(p, Math.min(pk1, pk)); -// Renderer.R2D.renderLine(stack, Renderer.Util.lerp(theme.getAccent(), DYING, p), this.x, this.y, px, py); -// } -// } stack.pop(); } 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 6a53e81..f86906f 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 @@ -153,9 +153,6 @@ public class NotificationRenderer { double notificationWidth = texPadding + iconDimensions + texPadding + Math.max(minWidth, contentWidth) + texPadding; // take padding for the icon into account as well double notificationX = notification.posX = bottomRightStartX - notificationWidth; double notificationY = bottomRightStartY - notificationHeight - yOffset; -// notification.renderPosX = notification.posX = bottomRightStartX-notificationWidth; -// notification.posY = bottomRightStartY-notificationHeight-yOffset; -// if (notification.renderPosY < 0) notification.renderPosY = notification.posY; double interpolatedAnimProgress = Transitions.easeOutExpo(notification.animationProgress); Renderer.R2D.renderRoundedQuad(ms, new Color(20, 20, 20, (int) Math.min(255, 255 * interpolatedAnimProgress)), notificationX, notificationY, notificationX + notificationWidth, notificationY + notificationHeight, 5, 20); RenderSystem.setShaderTexture(0, notification.type.getI()); diff --git a/src/main/java/net/shadow/client/feature/gui/screen/ConsoleScreen.java b/src/main/java/net/shadow/client/feature/gui/screen/ConsoleScreen.java index c2c0197..e390e8b 100644 --- a/src/main/java/net/shadow/client/feature/gui/screen/ConsoleScreen.java +++ b/src/main/java/net/shadow/client/feature/gui/screen/ConsoleScreen.java @@ -32,7 +32,7 @@ public class ConsoleScreen extends ClientScreen implements FastTickable { private static ConsoleScreen instance; final Color background = new Color(0, 0, 0, 120); final List logs = new ArrayList<>(); - ClientScreen parent = null; + final ClientScreen parent = null; RoundTextFieldWidget command; double scroll = 0; double smoothScroll = 0; diff --git a/src/main/java/net/shadow/client/feature/items/Option.java b/src/main/java/net/shadow/client/feature/items/Option.java index 70d0ed8..c587316 100644 --- a/src/main/java/net/shadow/client/feature/items/Option.java +++ b/src/main/java/net/shadow/client/feature/items/Option.java @@ -37,6 +37,7 @@ public class Option { getValueRef().set(value); } + @SuppressWarnings("unchecked") public void accept(Object o) { getValueRef().set((T) o); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/AutoTrap.java b/src/main/java/net/shadow/client/feature/module/impl/combat/AutoTrap.java index b713f43..42f2f71 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/combat/AutoTrap.java +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/AutoTrap.java @@ -113,8 +113,7 @@ public class AutoTrap extends Module { int slot = -1; for (int i = 0; i < 9; i++) { ItemStack real = ShadowMain.client.player.getInventory().getStack(i); - if (real.getItem() instanceof BlockItem bi && Block.isShapeFullCube(bi.getBlock() - .getOutlineShape(bi.getBlock().getDefaultState(), ShadowMain.client.world, new BlockPos(0, 0, 0), ShapeContext.absent()))) { + if (real.getItem() instanceof BlockItem bi && Block.isShapeFullCube(bi.getBlock().getDefaultState().getOutlineShape(ShadowMain.client.world, new BlockPos(0, 0, 0), ShapeContext.absent()))) { slot = i; } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/crash/AnimationCrash.java b/src/main/java/net/shadow/client/feature/module/impl/crash/AnimationCrash.java index caed409..be10353 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/crash/AnimationCrash.java +++ b/src/main/java/net/shadow/client/feature/module/impl/crash/AnimationCrash.java @@ -34,7 +34,7 @@ public class AnimationCrash extends Module { for (int i = 0; i < power.getValue(); i++) { Objects.requireNonNull(ShadowMain.client.player.networkHandler).sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND)); } - } catch (NullPointerException e) { + } catch (NullPointerException ignored) { } } diff --git a/src/main/java/net/shadow/client/feature/module/impl/grief/AutoFireball.java b/src/main/java/net/shadow/client/feature/module/impl/grief/AutoFireball.java index 413cf85..092bdea 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/grief/AutoFireball.java +++ b/src/main/java/net/shadow/client/feature/module/impl/grief/AutoFireball.java @@ -32,8 +32,8 @@ public class AutoFireball extends Module { final DoubleSetting radius = this.config.create(new DoubleSetting.Builder(15).max(100).min(10).name("Radius").description("The radius to search in").get()); final Block[] blocks = new Block[]{Blocks.COBBLESTONE, Blocks.GLASS, Blocks.GLASS_PANE, Blocks.OAK_DOOR, Blocks.IRON_DOOR, Blocks.BRICKS, Blocks.OAK_PLANKS, Blocks.DARK_OAK_PLANKS, Blocks.WHITE_WOOL, Blocks.BLACK_WOOL, Blocks.BARREL, Blocks.CHEST, Blocks.CRAFTING_TABLE, Blocks.FURNACE}; - BlockPos walkman = new BlockPos(0, 0, 0); - List targets = new ArrayList<>(); + final BlockPos walkman = new BlockPos(0, 0, 0); + final List targets = new ArrayList<>(); public AutoFireball() { super("AutoFireball", "auto nuke shit using fireballs", ModuleType.MISC); 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 3bab72c..466ec29 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 @@ -35,11 +35,13 @@ public class AntiCrash extends Module { .description("Prevents an abnormal sized velocity packet from going through") .get()); @Getter + final BooleanSetting capParticles = this.config.create(new BooleanSetting.Builder(true) .name("Cap particles") .description("Prevents too many particles from being rendered") .get()); @Getter + final DoubleSetting particleMax = this.config.create(new DoubleSetting.Builder(1000) .name("Particle max") .description("How many particles to allow at once") @@ -48,11 +50,13 @@ public class AntiCrash extends Module { .precision(0) .get()); @Getter + final BooleanSetting capNames = this.config.create(new BooleanSetting.Builder(true) .name("Cap entity names") .description("Cap the max size an entity name can be") .get()); @Getter + final DoubleSetting nameMax = this.config.create(new DoubleSetting.Builder(64) .name("Name max") .description("How long a name should be allowed to be") diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/ClientSettings.java b/src/main/java/net/shadow/client/feature/module/impl/misc/ClientSettings.java index f9eaab0..bce335d 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/ClientSettings.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/ClientSettings.java @@ -13,6 +13,7 @@ import net.shadow.client.feature.module.ModuleType; public class ClientSettings extends Module { @Getter + final StringSetting ss = this.config.create(new StringSetting.Builder(">") .name("Prefix") .description("The prefix to use for commands") diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/DiscordRPC.java b/src/main/java/net/shadow/client/feature/module/impl/misc/DiscordRPC.java index 5916219..60d0972 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/DiscordRPC.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/DiscordRPC.java @@ -20,26 +20,22 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class DiscordRPC extends Module { - static ExecutorService offThreadExec = Executors.newFixedThreadPool(1); + static final ExecutorService offThreadExec = Executors.newFixedThreadPool(1); Timer rpcUpdate = new Timer(); long updateRequested = 0; boolean updateOutstanding = false; - StringSetting details = this.config.create( + final StringSetting details = this.config.create( new StringSetting.Builder("Using Shadow V2") .name("Title") .description("What to put as the title of the rpc") - .onChanged(s -> { - update(); - }) + .onChanged(s -> update()) .get() ); - StringSetting state = this.config.create( + final StringSetting state = this.config.create( new StringSetting.Builder("Obliterating minecraft") .name("Description") .description("What to put as the description of the rpc") - .onChanged(s -> { - update(); - }) + .onChanged(s -> update()) .get() ); long startTime; diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/Test.java b/src/main/java/net/shadow/client/feature/module/impl/misc/Test.java index f688ced..9c768b1 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/misc/Test.java +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/Test.java @@ -39,7 +39,7 @@ public class Test extends Module { }); } - Timer timer = new Timer(); + final Timer timer = new Timer(); @Override public void tick() { if (timer.hasExpired(500)) { diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/BlockHighlighting.java b/src/main/java/net/shadow/client/feature/module/impl/render/BlockHighlighting.java index 9e67b5b..d5b1dd7 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/BlockHighlighting.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/BlockHighlighting.java @@ -66,8 +66,6 @@ public class BlockHighlighting extends Module { Color outline = new Color(50, 50, 50, 255); Color fill = new Color(20, 20, 20, 100); Renderer.R3D.renderEdged(stack, start, len, fill, outline); -// Renderer.R3D.renderFilled(start,len,fill,stack); -// Renderer.R3D.renderOutline(start,len,outline,stack); } 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 28a4465..52b8548 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 @@ -28,6 +28,7 @@ import java.util.function.BooleanSupplier; public class TabGui extends Module { @Getter + final Stack tabStack = new Stack<>(); public TabGui() { diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/Nuker.java b/src/main/java/net/shadow/client/feature/module/impl/world/Nuker.java index e8ebc63..39b9604 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/Nuker.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/Nuker.java @@ -34,7 +34,7 @@ public class Nuker extends Module { } return piss; }); - EnumSetting modeSetting = this.config.create(new EnumSetting.Builder<>(Mode.Interaction) + final EnumSetting modeSetting = this.config.create(new EnumSetting.Builder<>(Mode.Interaction) .name("Mode") .description("How to break block") .get()); @@ -60,43 +60,37 @@ public class Nuker extends Module { @Override public void tick() { switch (modeSetting.getValue()) { - case Packet -> { - iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { - BlockPos bp = new BlockPos(vec3d); - BlockState bs = client.world.getBlockState(bp); - if (bs.isAir()) return; - Block b = bs.getBlock(); - if (b == Blocks.WATER || b == Blocks.LAVA) return; + case Packet -> iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { + BlockPos bp = new BlockPos(vec3d); + BlockState bs = client.world.getBlockState(bp); + if (bs.isAir()) return; + Block b = bs.getBlock(); + if (b == Blocks.WATER || b == Blocks.LAVA) return; // BlockHitResult bhr = new BlockHitResult(vec3d, Direction.DOWN,bp,false); + client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, bp, Direction.DOWN)); + client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, bp, Direction.DOWN)); + Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(bp), new Vec3d(1, 1, 1), 1000); +// client.getNetworkHandler().sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND,bhr)); + }); + case Griefing -> iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { + BlockPos bp = new BlockPos(vec3d); + BlockState bs = client.world.getBlockState(bp); + if (bs.isAir()) return; + if (instantBreaks.contains(bs.getBlock())) { client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, bp, Direction.DOWN)); client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, bp, Direction.DOWN)); Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(bp), new Vec3d(1, 1, 1), 1000); -// client.getNetworkHandler().sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND,bhr)); - }); - } - case Griefing -> { - iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { - BlockPos bp = new BlockPos(vec3d); - BlockState bs = client.world.getBlockState(bp); - if (bs.isAir()) return; - if (instantBreaks.contains(bs.getBlock())) { - client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, bp, Direction.DOWN)); - client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, bp, Direction.DOWN)); - Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(bp), new Vec3d(1, 1, 1), 1000); - } - }); - } - case Interaction -> { - iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { - BlockPos bp = new BlockPos(vec3d); - BlockState bs = client.world.getBlockState(bp); - if (bs.isAir()) return; - Block b = bs.getBlock(); - if (b == Blocks.WATER || b == Blocks.LAVA) return; - client.interactionManager.attackBlock(bp, Direction.DOWN); - Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(bp), new Vec3d(1, 1, 1), 1000); - }); - } + } + }); + case Interaction -> iterateOverRange(client.interactionManager.getReachDistance(), vec3d -> { + BlockPos bp = new BlockPos(vec3d); + BlockState bs = client.world.getBlockState(bp); + if (bs.isAir()) return; + Block b = bs.getBlock(); + if (b == Blocks.WATER || b == Blocks.LAVA) return; + client.interactionManager.attackBlock(bp, Direction.DOWN); + Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(bp), new Vec3d(1, 1, 1), 1000); + }); } } diff --git a/src/main/java/net/shadow/client/helper/AccurateFrameRateCounter.java b/src/main/java/net/shadow/client/helper/AccurateFrameRateCounter.java index e4e5b98..45a266c 100644 --- a/src/main/java/net/shadow/client/helper/AccurateFrameRateCounter.java +++ b/src/main/java/net/shadow/client/helper/AccurateFrameRateCounter.java @@ -9,7 +9,7 @@ import java.util.List; public class AccurateFrameRateCounter { public static final AccurateFrameRateCounter globalInstance = new AccurateFrameRateCounter(); - List records = new ArrayList<>(); + final List records = new ArrayList<>(); public void recordFrame() { long c = System.currentTimeMillis(); diff --git a/src/main/java/net/shadow/client/helper/Rotations.java b/src/main/java/net/shadow/client/helper/Rotations.java index 69aef7e..98b3078 100644 --- a/src/main/java/net/shadow/client/helper/Rotations.java +++ b/src/main/java/net/shadow/client/helper/Rotations.java @@ -83,6 +83,7 @@ public class Rotations { FreeLook fl = ModuleRegistry.getByClass(FreeLook.class); double required = Math.toDegrees(Math.atan2(delZ, delX)) - 90, delta, add, speed; double sqrt1 = Math.sqrt(delX * delX + delZ * delZ); + double degTan = -Math.toDegrees(Math.atan2(delY, sqrt1)); if (fl.isEnabled()) { // setting yaw @@ -95,7 +96,7 @@ public class Rotations { fl.newyaw = (fl.newyaw + (float) add); // setting pitch - required = -Math.toDegrees(Math.atan2(delY, sqrt1)); + required = degTan; delta = MathHelper.wrapDegrees(required - fl.newpitch); speed = Math.abs(delta / laziness); add = speed * (delta >= 0 ? 1 : -1); @@ -114,7 +115,7 @@ public class Rotations { ShadowMain.client.player.setYaw(ShadowMain.client.player.getYaw() + (float) add); // setting pitch - required = -Math.toDegrees(Math.atan2(delY, sqrt1)); + required = degTan; delta = MathHelper.wrapDegrees(required - ShadowMain.client.player.getPitch()); speed = Math.abs(delta / laziness); add = speed * (delta >= 0 ? 1 : -1); diff --git a/src/main/java/net/shadow/client/helper/font/adapter/FontAdapter.java b/src/main/java/net/shadow/client/helper/font/adapter/FontAdapter.java index 804dfe4..aa9dfa5 100644 --- a/src/main/java/net/shadow/client/helper/font/adapter/FontAdapter.java +++ b/src/main/java/net/shadow/client/helper/font/adapter/FontAdapter.java @@ -11,7 +11,7 @@ public interface FontAdapter { void drawString(MatrixStack matrices, String text, double x, double y, int color); - int drawString(MatrixStack matrices, String text, float x, float y, float r, float g, float b, float a); + void drawString(MatrixStack matrices, String text, float x, float y, float r, float g, float b, float a); void drawCenteredString(MatrixStack matrices, String text, double x, double y, int color); diff --git a/src/main/java/net/shadow/client/helper/font/adapter/impl/BruhAdapter.java b/src/main/java/net/shadow/client/helper/font/adapter/impl/BruhAdapter.java index 37ab1fe..0da361d 100644 --- a/src/main/java/net/shadow/client/helper/font/adapter/impl/BruhAdapter.java +++ b/src/main/java/net/shadow/client/helper/font/adapter/impl/BruhAdapter.java @@ -44,9 +44,8 @@ public class BruhAdapter implements FontAdapter { } @Override - public int drawString(MatrixStack matrices, String text, float x, float y, float r, float g, float b, float a) { + public void drawString(MatrixStack matrices, String text, float x, float y, float r, float g, float b, float a) { renderer.drawString(matrices, text, x, y, r, g, b, a); - return 0; } @Override diff --git a/src/main/java/net/shadow/client/helper/nbt/NbtGroup.java b/src/main/java/net/shadow/client/helper/nbt/NbtGroup.java index 4769d2b..4f96e24 100644 --- a/src/main/java/net/shadow/client/helper/nbt/NbtGroup.java +++ b/src/main/java/net/shadow/client/helper/nbt/NbtGroup.java @@ -8,12 +8,7 @@ import net.minecraft.nbt.NbtCompound; import java.util.Arrays; -public class NbtGroup { - final NbtElement[] elements; - - public NbtGroup(NbtElement... elements) { - this.elements = elements; - } +public record NbtGroup(NbtElement... elements) { @Override public String toString() { diff --git a/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java b/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java index f150e90..5b86a5e 100644 --- a/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java @@ -8,12 +8,10 @@ import net.minecraft.entity.AreaEffectCloudEntity; 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; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -@Debug(export = true) @Mixin(AreaEffectCloudEntity.class) public class AreaEffectCloudEntityMixin { @ModifyVariable(method = "tick", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/util/math/MathHelper;ceil(F)I"), index = 4) diff --git a/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java b/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java index 7a515aa..63ab11a 100644 --- a/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java @@ -8,7 +8,6 @@ import io.netty.channel.Channel; import io.netty.handler.proxy.Socks4ProxyHandler; import io.netty.handler.proxy.Socks5ProxyHandler; import net.shadow.client.feature.gui.screen.ProxyManagerScreen; -import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -17,7 +16,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.net.InetSocketAddress; @Mixin(targets = "net/minecraft/network/ClientConnection$1") -@Debug(export = true) public class ClientConnection1Mixin { @Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At("HEAD")) diff --git a/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java b/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java index 619e19d..d219d3b 100644 --- a/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java +++ b/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java @@ -8,12 +8,10 @@ import net.minecraft.client.model.ModelPart; import net.minecraft.client.render.VertexConsumer; import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.render.ESP; -import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; -@Debug(export = true) @Mixin(ModelPart.Cuboid.class) public class ModelPartCuboidMixin { @Redirect(method = "renderCuboid", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/VertexConsumer;vertex(FFFFFFFFFIIFFF)V")) diff --git a/src/main/java/net/shadow/client/mixin/PlayerSkinMixin.java b/src/main/java/net/shadow/client/mixin/PlayerSkinMixin.java index 78d94bd..cbb7b48 100644 --- a/src/main/java/net/shadow/client/mixin/PlayerSkinMixin.java +++ b/src/main/java/net/shadow/client/mixin/PlayerSkinMixin.java @@ -13,7 +13,6 @@ import com.mojang.authlib.minecraft.MinecraftSessionService; import net.minecraft.client.texture.PlayerSkinProvider; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -26,7 +25,6 @@ import java.io.InputStreamReader; import java.net.URL; import java.util.Map; -@Debug(export = true) @Mixin(PlayerSkinProvider.class) public class PlayerSkinMixin { private static JsonObject capes; @@ -74,7 +72,7 @@ public class PlayerSkinMixin { private void setupCapes() { try { URL url = new URL("https://moleapi.pythonanywhere.com/retrieve"); - capes = new JsonParser().parse(new InputStreamReader(url.openStream())).getAsJsonObject(); + capes = JsonParser.parseReader(new InputStreamReader(url.openStream())).getAsJsonObject(); } catch (Exception e) { System.err.println("[Shadow] Failed to load capes from API"); e.printStackTrace(); diff --git a/src/main/java/net/shadow/client/mixin/SliderWidgetMixin.java b/src/main/java/net/shadow/client/mixin/SliderWidgetMixin.java index c663a20..d4d5c00 100644 --- a/src/main/java/net/shadow/client/mixin/SliderWidgetMixin.java +++ b/src/main/java/net/shadow/client/mixin/SliderWidgetMixin.java @@ -5,12 +5,10 @@ package net.shadow.client.mixin; import net.minecraft.client.gui.widget.SliderWidget; -import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.Constant; import org.spongepowered.asm.mixin.injection.ModifyConstant; -@Debug(export = true) @Mixin(SliderWidget.class) public class SliderWidgetMixin { // Makes the mouse click more accurate by replacing the expected indicator width (8px) with the actual, new indicator width (1.5 px, rounded to 2) diff --git a/src/main/java/net/shadow/client/mixin/WorldRendererMixin.java b/src/main/java/net/shadow/client/mixin/WorldRendererMixin.java index 488ccff..51e77e5 100644 --- a/src/main/java/net/shadow/client/mixin/WorldRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/WorldRendererMixin.java @@ -13,7 +13,6 @@ import net.shadow.client.feature.module.ModuleRegistry; import net.shadow.client.feature.module.impl.render.BlockHighlighting; import net.shadow.client.feature.module.impl.render.Freecam; import net.shadow.client.feature.module.impl.world.XRAY; -import org.spongepowered.asm.mixin.Debug; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArg; @@ -21,7 +20,6 @@ import org.spongepowered.asm.mixin.injection.Redirect; import java.util.SortedSet; -@Debug(export = true) @Mixin(WorldRenderer.class) public class WorldRendererMixin { @ModifyArg(method = "render", @@ -37,9 +35,6 @@ public class WorldRendererMixin { ObjectSet>> a(Long2ObjectMap> instance, MatrixStack matrices) { BlockHighlighting bbr = ModuleRegistry.getByClass(BlockHighlighting.class); if (bbr.isEnabled()) { -// for (Long2ObjectMap.Entry> sortedSetEntry : instance.long2ObjectEntrySet()) { -// bbr.renderEntry(matrices, sortedSetEntry); -// } return ObjectSet.of(); } return instance.long2ObjectEntrySet();