From bc33d7d8f14067ba57f0d24fee58e558ebff2ba7 Mon Sep 17 00:00:00 2001 From: 0x3C50 Date: Thu, 31 Mar 2022 23:55:20 +0200 Subject: [PATCH] f --- .../module/impl/render/BlockHighlighting.java | 13 +++++-------- .../module/impl/render/ItemByteSize.java | 1 + .../feature/module/impl/world/AirPlace.java | 17 ++++++++--------- .../client/feature/module/impl/world/Nuker.java | 1 + .../feature/module/impl/world/Scaffold.java | 2 +- .../shadow/client/helper/render/Renderer.java | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) 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 1ede93a..9e67b5b 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 @@ -8,6 +8,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import net.minecraft.block.BlockState; import net.minecraft.client.render.BlockBreakingInfo; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; @@ -15,10 +16,6 @@ import net.minecraft.util.shape.VoxelShape; import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; -import net.minecraft.network.packet.s2c.play.BlockEventS2CPacket; -import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; import net.shadow.client.helper.event.events.PacketEvent; @@ -33,11 +30,11 @@ public class BlockHighlighting extends Module { public BlockHighlighting() { super("BlockHighlighting", "Renders better block breaking animations", ModuleType.RENDER); Events.registerEventHandler(EventType.PACKET_RECEIVE, p -> { - if(!this.isEnabled()) return; - PacketEvent event = (PacketEvent)p; - if(event.getPacket() instanceof BlockUpdateS2CPacket packet){ + if (!this.isEnabled()) return; + PacketEvent event = (PacketEvent) p; + if (event.getPacket() instanceof BlockUpdateS2CPacket packet) { BlockPos real = packet.getPos(); - Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255),Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(),Vec3d.of(real),new Vec3d(1,1,1), 1000); + Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(real), new Vec3d(1, 1, 1), 1000); } }); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/render/ItemByteSize.java b/src/main/java/net/shadow/client/feature/module/impl/render/ItemByteSize.java index 7bf84c3..67c9417 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/render/ItemByteSize.java +++ b/src/main/java/net/shadow/client/feature/module/impl/render/ItemByteSize.java @@ -21,6 +21,7 @@ public class ItemByteSize extends Module { if (!this.isEnabled()) { return; } + LoreQueryEvent e = (LoreQueryEvent) event; ByteCounter inst = ByteCounter.instance(); inst.reset(); diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/AirPlace.java b/src/main/java/net/shadow/client/feature/module/impl/world/AirPlace.java index ef9bb65..27ff9f8 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/AirPlace.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/AirPlace.java @@ -9,6 +9,7 @@ import net.minecraft.item.BlockItem; import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.Vec3d; import net.shadow.client.ShadowMain; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; @@ -17,10 +18,6 @@ import net.shadow.client.helper.event.Events; import net.shadow.client.helper.event.events.MouseEvent; import net.shadow.client.helper.render.Renderer; import net.shadow.client.helper.util.Utils; -import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; -import net.minecraft.util.Hand; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.Vec3d; public class AirPlace extends Module { @@ -29,13 +26,15 @@ public class AirPlace extends Module { public AirPlace() { super("AirPlace", "template", ModuleType.MISC); Events.registerEventHandler(EventType.MOUSE_EVENT, event -> { - if(!this.isEnabled()) return; - if(enabled && ((MouseEvent)event).getButton() == 1 && ((MouseEvent)event).getAction() == 1){ - if(ShadowMain.client.currentScreen != null) return; + if (!this.isEnabled()) return; + if (enabled && ((MouseEvent) event).getButton() == 1 && ((MouseEvent) event).getAction() == 1) { + if (ShadowMain.client.currentScreen != null) return; try { - if(!client.world.getBlockState(((BlockHitResult) ShadowMain.client.crosshairTarget).getBlockPos()).isAir()) return; + if (!client.world.getBlockState(((BlockHitResult) ShadowMain.client.crosshairTarget).getBlockPos()).isAir()) + return; ShadowMain.client.player.networkHandler.sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, (BlockHitResult) ShadowMain.client.crosshairTarget)); - if((client.player.getMainHandStack().getItem() instanceof BlockItem)) Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255),Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(),Vec3d.of(((BlockHitResult) ShadowMain.client.crosshairTarget).getBlockPos()),new Vec3d(1,1,1), 1000); + if ((client.player.getMainHandStack().getItem() instanceof BlockItem)) + Renderer.R3D.renderFadingBlock(Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 255), Renderer.Util.modify(Utils.getCurrentRGB(), -1, -1, -1, 100).darker(), Vec3d.of(((BlockHitResult) ShadowMain.client.crosshairTarget).getBlockPos()), new Vec3d(1, 1, 1), 1000); ShadowMain.client.player.swingHand(Hand.MAIN_HAND); event.setCancelled(true); } catch (Exception ignored) { 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 1c1f038..e8ebc63 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 @@ -38,6 +38,7 @@ public class Nuker extends Module { .name("Mode") .description("How to break block") .get()); + public Nuker() { super("Nuker", "The nuke", ModuleType.WORLD); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/Scaffold.java b/src/main/java/net/shadow/client/feature/module/impl/world/Scaffold.java index a3199ec..ee1565b 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/Scaffold.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/Scaffold.java @@ -118,7 +118,7 @@ public class Scaffold extends Module { int c = Objects.requireNonNull(client.player).getInventory().selectedSlot; client.player.getInventory().selectedSlot = s; BlockHitResult bhr = new BlockHitResult(new Vec3d(bp.getX(), bp.getY(), bp.getZ()), Direction.DOWN, bp, false); - 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); + 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); Objects.requireNonNull(client.interactionManager).interactBlock(client.player, client.world, Hand.MAIN_HAND, bhr); client.player.getInventory().selectedSlot = c; } 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 46a781d..97cc88e 100644 --- a/src/main/java/net/shadow/client/helper/render/Renderer.java +++ b/src/main/java/net/shadow/client/helper/render/Renderer.java @@ -39,7 +39,7 @@ public class Renderer { public static void renderFadingBlocks(MatrixStack stack) { fades.removeIf(FadingBlock::isDead); - for (FadingBlock fade : fades) { + for (FadingBlock fade : new ArrayList<>(fades)) { long lifetimeLeft = fade.getLifeTimeLeft(); double progress = lifetimeLeft / (double) fade.lifeTime; Color out = Util.modify(fade.outline, -1, -1, -1, (int) (fade.outline.getAlpha() * progress));