From 7396c2cfc0490c6e9971dea01e6a18000412a3b7 Mon Sep 17 00:00:00 2001 From: Saturn5Vfive Date: Sun, 10 Apr 2022 02:07:24 -0500 Subject: [PATCH] pwease fiwx the cwash uwu --- .../client/feature/module/ModuleRegistry.java | 12 ++ .../feature/module/impl/combat/Fling.java | 89 ++++++++++++++ .../feature/module/impl/combat/Reach.java | 51 ++++++++ .../module/impl/combat/ReverseKnockback.java | 79 +++++++++++++ .../module/impl/misc/SuperCrossbow.java | 80 +++++++++++++ .../feature/module/impl/misc/Unload.java | 53 +++++++++ .../feature/module/impl/movement/Speed.java | 111 ++++++++++++++++++ .../feature/module/impl/world/AutoSign.java | 54 +++++++++ .../feature/module/impl/world/MassUse.java | 70 +++++++++-- .../net/shadow/client/helper/util/Utils.java | 9 ++ .../shadow/client/mixin/AChatScreenMixin.java | 4 + .../client/mixin/AEntityRendererMixin.java | 1 + .../mixin/AGenericContainerScreenMixin.java | 1 + .../shadow/client/mixin/AInGameHudMixin.java | 1 + .../client/mixin/AbstractBlockStateMixin.java | 1 + .../mixin/AreaEffectCloudEntityMixin.java | 1 + .../client/mixin/BeaconScreenMixin.java | 1 + .../BlockEntityRenderDispatcherMixin.java | 1 + .../net/shadow/client/mixin/BlockMixin.java | 2 + .../net/shadow/client/mixin/CameraMixin.java | 1 + .../client/mixin/ClickableWidgetMixin.java | 1 + .../client/mixin/ClientConnection1Mixin.java | 1 + .../client/mixin/ClientConnectionMixin.java | 3 + .../client/mixin/ClientPlayerEntityMixin.java | 3 + .../ClientPlayerInteractionManagerMixin.java | 17 +++ .../mixin/CreativeInventoryScreenMixin.java | 1 + .../shadow/client/mixin/EntityModelMixin.java | 2 + .../mixin/EntityRenderDispatcherMixin.java | 1 + .../shadow/client/mixin/GameMenuMixin.java | 1 + .../client/mixin/GameRendererMixin.java | 1 + .../shadow/client/mixin/KeyboardMixin.java | 2 + .../client/mixin/LivingEntityMixin.java | 6 + .../client/mixin/MinecraftClientMixin.java | 4 + .../client/mixin/ModelPartCuboidMixin.java | 1 + .../shadow/client/mixin/ModelPartMixin.java | 1 + .../net/shadow/client/mixin/MouseMixin.java | 1 + .../client/mixin/MultiplayerScreenMixin.java | 1 + .../client/mixin/ParticleManagerMixin.java | 1 + .../client/mixin/PlayerEntityMixin.java | 3 + .../mixin/PlayerEntityRendererMixin.java | 1 + .../net/shadow/client/mixin/ScreenMixin.java | 1 + .../client/mixin/SelectWorldScreenMixin.java | 1 + .../client/mixin/SharedConstantsMixin.java | 1 + .../client/mixin/SignEditScreenMixin.java | 40 +++++++ .../shadow/client/mixin/TitleScreenMixin.java | 1 + src/main/resources/shadow.mixins.json | 3 +- 46 files changed, 710 insertions(+), 11 deletions(-) create mode 100644 src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/combat/Reach.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/combat/ReverseKnockback.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/misc/Unload.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/movement/Speed.java create mode 100644 src/main/java/net/shadow/client/feature/module/impl/world/AutoSign.java create mode 100644 src/main/java/net/shadow/client/mixin/SignEditScreenMixin.java diff --git a/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java b/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java index 6830d89..a6aa2cc 100644 --- a/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java +++ b/src/main/java/net/shadow/client/feature/module/ModuleRegistry.java @@ -11,7 +11,10 @@ import net.shadow.client.feature.module.impl.combat.AutoAttack; import net.shadow.client.feature.module.impl.combat.AutoTrap; import net.shadow.client.feature.module.impl.combat.Criticals; import net.shadow.client.feature.module.impl.combat.FireballDeflector; +import net.shadow.client.feature.module.impl.combat.Fling; import net.shadow.client.feature.module.impl.combat.Killaura; +import net.shadow.client.feature.module.impl.combat.Reach; +import net.shadow.client.feature.module.impl.combat.ReverseKnockback; import net.shadow.client.feature.module.impl.combat.ShulkerDeflector; import net.shadow.client.feature.module.impl.combat.TpRange; import net.shadow.client.feature.module.impl.combat.Velocity; @@ -48,6 +51,7 @@ import net.shadow.client.feature.module.impl.misc.MinehutAdBlocker; import net.shadow.client.feature.module.impl.misc.NoTitles; import net.shadow.client.feature.module.impl.misc.PortalGUI; import net.shadow.client.feature.module.impl.misc.Spinner; +import net.shadow.client.feature.module.impl.misc.SuperCrossbow; import net.shadow.client.feature.module.impl.misc.Test; import net.shadow.client.feature.module.impl.misc.Timer; import net.shadow.client.feature.module.impl.misc.XCarry; @@ -74,6 +78,7 @@ import net.shadow.client.feature.module.impl.movement.NoJumpCooldown; import net.shadow.client.feature.module.impl.movement.NoLevitation; import net.shadow.client.feature.module.impl.movement.NoPush; import net.shadow.client.feature.module.impl.movement.Phase; +import net.shadow.client.feature.module.impl.movement.Speed; import net.shadow.client.feature.module.impl.movement.Sprint; import net.shadow.client.feature.module.impl.movement.Step; import net.shadow.client.feature.module.impl.movement.Swing; @@ -103,6 +108,7 @@ import net.shadow.client.feature.module.impl.world.AirPlace; import net.shadow.client.feature.module.impl.world.AnyPlacer; import net.shadow.client.feature.module.impl.world.AutoFish; import net.shadow.client.feature.module.impl.world.AutoLavacast; +import net.shadow.client.feature.module.impl.world.AutoSign; import net.shadow.client.feature.module.impl.world.AutoTool; import net.shadow.client.feature.module.impl.world.BlockTagViewer; import net.shadow.client.feature.module.impl.world.Boom; @@ -278,6 +284,12 @@ public class ModuleRegistry { vanillaModules.add(new MinehutCrash()); vanillaModules.add(new ArmorStandCrash()); vanillaModules.add(new LoominaCrash()); + vanillaModules.add(new Reach()); + vanillaModules.add(new Fling()); + vanillaModules.add(new AutoSign()); + vanillaModules.add(new SuperCrossbow()); + vanillaModules.add(new ReverseKnockback()); + vanillaModules.add(new Speed()); rebuildSharedModuleList(); } diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java new file mode 100644 index 0000000..d15d2f1 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Fling.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.combat; + +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.config.DoubleSetting; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; +import net.shadow.client.helper.event.EventListener; +import net.shadow.client.helper.event.EventType; +import net.shadow.client.helper.event.Events; +import net.shadow.client.helper.event.events.PacketEvent; +import net.shadow.client.helper.util.Utils; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.math.Vec3d; + +public class Fling extends Module { + + final DoubleSetting delay = this.config.create(new DoubleSetting.Builder(250).min(1).max(500).name("Delay").description("the delay before going back down").get()); + final DoubleSetting updist = this.config.create(new DoubleSetting.Builder(3).min(1).max(3).name("Power").description("power of the fling").get()); + + + public Fling() { + super("Fling", "fling players", ModuleType.COMBAT); + Events.registerEventHandlerClass(this); + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } + + @EventListener(type=EventType.PACKET_SEND) + void sendPacket(PacketEvent event){ + if (event.getPacket() instanceof PlayerInteractItemC2SPacket) { + if (client.player.getInventory().getMainHandStack().getItem() == Items.FISHING_ROD && (client.player.fishHook != null || !client.player.fishHook.isRemoved())) { + client.player.setVelocity(Vec3d.ZERO); + event.setCancelled(true); + new Thread(() -> { + double staticy = client.player.getY(); + for (int i = 0; i < updist.getValue(); i++) { + staticy = staticy + 9; + Utils.sleep(5); + client.player.setVelocity(Vec3d.ZERO); + client.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(client.player.getX(), staticy, client.player.getZ(), true)); + } + Utils.sleep(delay.getValue().longValue()); + client.player.networkHandler.getConnection().send(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND)); + Utils.sleep(delay.getValue().longValue()); + for (int i = 0; i < updist.getValue(); i++) { + staticy = staticy - 9; + Utils.sleep(5); + client.player.setVelocity(Vec3d.ZERO); + client.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(client.player.getX(), staticy, client.player.getZ(), true)); + } + }).start(); + } + } + } + +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/Reach.java b/src/main/java/net/shadow/client/feature/module/impl/combat/Reach.java new file mode 100644 index 0000000..7443417 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/Reach.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.combat; + +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.config.DoubleSetting; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; + +public class Reach extends Module { + + final DoubleSetting reachDist = this.config.create(new DoubleSetting.Builder(0).min(3).max(10).name("Distance").description("how far to reach").get()); + + public Reach() { + super("Reach", "reach stuff", ModuleType.COMBAT); + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } + + public double getReachDistance(){ + return reachDist.getValue(); + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/combat/ReverseKnockback.java b/src/main/java/net/shadow/client/feature/module/impl/combat/ReverseKnockback.java new file mode 100644 index 0000000..fff651a --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/combat/ReverseKnockback.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.combat; + +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; +import net.shadow.client.helper.event.EventListener; +import net.shadow.client.helper.event.EventType; +import net.shadow.client.helper.event.Events; +import net.shadow.client.helper.event.events.PacketEvent; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.network.Packet; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.util.math.MathHelper; + +public class ReverseKnockback extends Module { + + public ReverseKnockback() { + super("ReverseKnockback", "reverse the knockback you deal", ModuleType.MISC); + Events.registerEventHandlerClass(this); + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } + + @EventListener(type=EventType.PACKET_SEND) + void packetSend(PacketEvent event){ + if (event.getPacket() instanceof PlayerMoveC2SPacket packet) { + if (!(packet instanceof PlayerMoveC2SPacket.LookAndOnGround || packet instanceof PlayerMoveC2SPacket.Full)) + return; + event.setCancelled(true); + double x = packet.getX(0); + double y = packet.getY(0); + double z = packet.getZ(0); + + Packet newPacket; + if (packet instanceof PlayerMoveC2SPacket.Full) { + newPacket = new PlayerMoveC2SPacket.Full(x, y, z, MathHelper.wrapDegrees(client.player.getYaw() + 180), 0, packet.isOnGround()); + } else { + newPacket = new PlayerMoveC2SPacket.LookAndOnGround(MathHelper.wrapDegrees(client.player.getYaw() + 180), 0, packet.isOnGround()); + } + + client.player.networkHandler.getConnection().send(newPacket); + } + if(event.getPacket() instanceof PlayerInteractEntityC2SPacket){ + client.player.networkHandler.sendPacket(new ClientCommandC2SPacket(client.player, ClientCommandC2SPacket.Mode.START_SPRINTING)); + } + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java b/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java new file mode 100644 index 0000000..b62238f --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/SuperCrossbow.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.misc; + + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.StringNbtReader; +import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.registry.Registry; +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; + +public class SuperCrossbow extends Module { + + public static final String inbt = "{Enchantments:[{id:\"minecraft:quick_charge\",lvl:5s}],ChargedProjectiles:[{},{id:\"minecraft:arrow\",Count:1b},{}],Charged:1b}"; + private static ItemStack stack; + ItemStack before = new ItemStack(Registry.ITEM.get(new Identifier("air")), 1); + + public SuperCrossbow() { + super("SuperCrossbow", "shoot arrows really quickly (press middle mouse)", ModuleType.MISC); + } + + @Override + public void tick() { + if (!getItemNameFromStack(client.player.getMainHandStack()).equals(getItemNameFromStack(stack))) { + before = client.player.getMainHandStack(); + } + if (client.options.pickItemKey.isPressed()) { + client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(36 + client.player.getInventory().selectedSlot, stack)); + client.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND)); + client.player.networkHandler.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), Direction.UP)); + client.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(36 + client.player.getInventory().selectedSlot, before)); + } + } + + @Override + public void enable() { + if (stack == null) { + stack = new ItemStack(Registry.ITEM.get(new Identifier("crossbow")), 1); + try { + stack.setNbt(StringNbtReader.parse(inbt)); + } catch (Exception ignored) { + + } + } + } + private String getItemNameFromStack(ItemStack hstack) { + String hs = hstack.getItem().getTranslationKey(); + hs = hs.replace("minecraft.", "").replace("block.", "").replace("item.", ""); + return hs; + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/misc/Unload.java b/src/main/java/net/shadow/client/feature/module/impl/misc/Unload.java new file mode 100644 index 0000000..1fc4a81 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/misc/Unload.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.misc; + +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.gui.notifications.Notification; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleRegistry; +import net.shadow.client.feature.module.ModuleType; + +public class Unload extends Module { + public static boolean loaded = true; + + public Unload() { + super("Unload", "unload the client for the most part", ModuleType.MISC); + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + loaded = false; + for(Module m : ModuleRegistry.getModules()){ + m.setEnabled(false); + } + Notification.create(1000, "Unload", Notification.Type.SUCCESS, "Client Unloaded!"); + this.setEnabled(false); + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/movement/Speed.java b/src/main/java/net/shadow/client/feature/module/impl/movement/Speed.java new file mode 100644 index 0000000..4ff96f9 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/movement/Speed.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.movement; + +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.attribute.EntityAttributes; +import net.shadow.client.feature.config.DoubleSetting; +import net.shadow.client.feature.config.EnumSetting; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; + +public class Speed extends Module { + static float fovEffectScal = 0; + static int ticksonground = 0; + static int ticksjustsneaking = 0; + final EnumSetting mode = this.config.create(new EnumSetting.Builder(Mode.OnGround).name("Mode").description("the way to apply speed").get()); + final DoubleSetting speed = this.config.create(new DoubleSetting.Builder(20).min(5).max(50).name("Speed").description("How fast to go").get()); + + public Speed() { + super("Speed", "gotta go fast", ModuleType.MOVEMENT); + } + + @Override + public void tick() { + fovEffectScal = client.options.fovEffectScale; + if (client.player == null) return; + ClientPlayerEntity player = client.player; + switch (mode.getValue()) { + case OnGround: + client.player.setSprinting(true); + client.options.fovEffectScale = 0F; + client.player.getAttributes().getCustomInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(Float.parseFloat(speed.getValue() + "") / 50); + break; + + case BHop: + client.player.airStrafingSpeed = Float.parseFloat(speed.getValue() + "") / 100; + if (client.player.isOnGround() && client.player.forwardSpeed != 0) { + client.player.jump(); + } else if (client.player.isOnGround() && client.player.sidewaysSpeed != 0) { + client.player.jump(); + } + break; + + case LowHop: + if (client.player.input.movementForward != 0 || client.player.input.movementSideways != 0) { + client.player.setSprinting(true); + + if (client.player.isOnGround()) client.player.addVelocity(0, 0.3, 0); + + if (client.player.isOnGround()) return; + + float sspeed = Float.parseFloat(speed.getValue() + "") / 50; + + float yaw = client.player.getYaw(); + float forward = 1; + + if (client.player.forwardSpeed < 0) { + yaw += 180; + forward = -0.5f; + } else if (client.player.forwardSpeed > 0) forward = 0.5f; + + if (client.player.sidewaysSpeed > 0) yaw -= 90 * forward; + if (client.player.sidewaysSpeed < 0) yaw += 90 * forward; + + yaw = (float) Math.toRadians(yaw); + + client.player.setVelocity(-Math.sin(yaw) * sspeed, client.player.getVelocity().y, Math.cos(yaw) * sspeed); + } + break; + + case CSGO: + client.player.setVelocity(client.player.getVelocity().multiply(1.1)); + break; + } + } + + @Override + public void enable() { + } + + @Override + public void disable() { + client.options.fovEffectScale = fovEffectScal; + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } + + + public enum Mode { + OnGround, + BHop, + LowHop, + CSGO + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/AutoSign.java b/src/main/java/net/shadow/client/feature/module/impl/world/AutoSign.java new file mode 100644 index 0000000..3832338 --- /dev/null +++ b/src/main/java/net/shadow/client/feature/module/impl/world/AutoSign.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) Shadow client, 0x150, Saturn5VFive 2022. All rights reserved. + */ + +package net.shadow.client.feature.module.impl.world; + +import net.minecraft.client.util.math.MatrixStack; +import net.shadow.client.feature.config.StringSetting; +import net.shadow.client.feature.module.Module; +import net.shadow.client.feature.module.ModuleType; + +public class AutoSign extends Module { + + final StringSetting ss1 = this.config.create(new StringSetting.Builder("discord.gg/moles").name("Line 1").description("the text for line 1").get()); + final StringSetting ss2 = this.config.create(new StringSetting.Builder("discord.gg/moles").name("Line 2").description("the text for line 2").get()); + final StringSetting ss3 = this.config.create(new StringSetting.Builder("discord.gg/moles").name("Line 3").description("the text for line 3").get()); + final StringSetting ss4 = this.config.create(new StringSetting.Builder("discord.gg/moles").name("Line 4").description("the text for line 4").get()); + + public AutoSign() { + super("AutoSign", "automatically write signs", ModuleType.WORLD); + } + + @Override + public void tick() { + + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + + @Override + public String getContext() { + return null; + } + + @Override + public void onWorldRender(MatrixStack matrices) { + + } + + @Override + public void onHudRender() { + + } + + public String[] getText(){ + return new String[]{ss1.getValue(), ss2.getValue(), ss3.getValue(), ss4.getValue()}; + } +} diff --git a/src/main/java/net/shadow/client/feature/module/impl/world/MassUse.java b/src/main/java/net/shadow/client/feature/module/impl/world/MassUse.java index ba2477a..a67e008 100644 --- a/src/main/java/net/shadow/client/feature/module/impl/world/MassUse.java +++ b/src/main/java/net/shadow/client/feature/module/impl/world/MassUse.java @@ -10,19 +10,30 @@ import net.minecraft.network.Packet; import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; import net.shadow.client.feature.config.DoubleSetting; +import net.shadow.client.feature.config.EnumSetting; import net.shadow.client.feature.module.Module; import net.shadow.client.feature.module.ModuleType; import net.shadow.client.helper.event.EventType; import net.shadow.client.helper.event.Events; import net.shadow.client.helper.event.events.PacketEvent; +import net.shadow.client.helper.util.Utils; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; +import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.Random; public class MassUse extends Module { final List> dontRepeat = new ArrayList<>(); // SliderValue uses = (SliderValue) this.config.create("Uses", 3, 1, 100, 0).description("How many times to use the item"); + final EnumSetting mode = this.config.create(new EnumSetting.Builder<>(Mode.Interact).name("Mode").description("How to mass use").get()); final DoubleSetting uses = this.config.create(new DoubleSetting.Builder(3).name("Uses").description("How many times to use the item").min(1).max(100).precision(0).get()); public MassUse() { @@ -36,17 +47,50 @@ public class MassUse extends Module { dontRepeat.remove(pe.getPacket()); return; } - if (pe.getPacket() instanceof PlayerInteractBlockC2SPacket p1) { - PlayerInteractBlockC2SPacket pp = new PlayerInteractBlockC2SPacket(p1.getHand(), p1.getBlockHitResult()); - for (int i = 0; i < uses.getValue(); i++) { - dontRepeat.add(pp); - Objects.requireNonNull(client.getNetworkHandler()).sendPacket(pp); + switch(mode.getValue()){ + case Interact -> { + if (pe.getPacket() instanceof PlayerInteractBlockC2SPacket p1) { + PlayerInteractBlockC2SPacket pp = new PlayerInteractBlockC2SPacket(p1.getHand(), p1.getBlockHitResult()); + for (int i = 0; i < uses.getValue(); i++) { + dontRepeat.add(pp); + Objects.requireNonNull(client.getNetworkHandler()).sendPacket(pp); + } + } else if (pe.getPacket() instanceof PlayerInteractItemC2SPacket p1) { + PlayerInteractItemC2SPacket pp = new PlayerInteractItemC2SPacket(p1.getHand()); + for (int i = 0; i < uses.getValue(); i++) { + dontRepeat.add(pp); + Objects.requireNonNull(client.getNetworkHandler()).sendPacket(pp); + } + } } - } else if (pe.getPacket() instanceof PlayerInteractItemC2SPacket p1) { - PlayerInteractItemC2SPacket pp = new PlayerInteractItemC2SPacket(p1.getHand()); - for (int i = 0; i < uses.getValue(); i++) { - dontRepeat.add(pp); - Objects.requireNonNull(client.getNetworkHandler()).sendPacket(pp); + + case Block -> { + BlockHitResult r = (BlockHitResult) client.crosshairTarget; + BlockPos p = r.getBlockPos(); + if (pe.getPacket() instanceof PlayerInteractBlockC2SPacket p1) { + for (int i = 0; i < uses.getValue(); i++) { + PlayerInteractBlockC2SPacket pp = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, r); + dontRepeat.add(pp); + client.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, p, Direction.UP)); + client.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, p, Direction.UP)); + client.player.networkHandler.sendPacket(pp); + } + } + } + + case Random -> { + if (pe.getPacket() instanceof PlayerInteractBlockC2SPacket p1) { + Random random = new Random(); + + for (int i = 0; i < uses.getValue(); i++) { + BlockPos pos = new BlockPos(client.player.getPos()).add( + random.nextInt(13) - 6, random.nextInt(13) - 6, + random.nextInt(13) - 6); + PlayerInteractBlockC2SPacket pp = Utils.Packets.generatePlace(pos); + dontRepeat.add(pp); + client.player.networkHandler.sendPacket(pp); + } + } } } }); @@ -81,5 +125,11 @@ public class MassUse extends Module { public void onHudRender() { } + + enum Mode { + Interact, + Block, + Random + } } 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 a7baf79..c51c3b1 100644 --- a/src/main/java/net/shadow/client/helper/util/Utils.java +++ b/src/main/java/net/shadow/client/helper/util/Utils.java @@ -247,6 +247,15 @@ public class Utils { } } + //---DO NOT REMOVE THIS--- + public static class Packets{ + + public static PlayerInteractBlockC2SPacket generatePlace(BlockPos pos){ + return new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5), Direction.UP, pos, false)); + } + + } + public static class Players { static final Map UUID_CACHE = new HashMap<>(); diff --git a/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java b/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java index 1cdcb18..153a887 100644 --- a/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/AChatScreenMixin.java @@ -50,6 +50,7 @@ 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 shadow_interceptChatMessage(ChatScreen instance, String s) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; String p = getPrefix(); if (s.startsWith(p)) { // filter all messages starting with . ShadowMain.client.inGameHud.getChatHud().addToMessageHistory(s); @@ -149,6 +150,7 @@ public class AChatScreenMixin extends Screen { @Inject(method = "render", at = @At("RETURN")) void shadow_renderText(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; String p = getPrefix(); String t = chatField.getText(); if (t.startsWith(p)) { @@ -161,6 +163,7 @@ public class AChatScreenMixin extends Screen { @Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true) void shadow_injectKeyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; String p = getPrefix(); if (keyCode == GLFW.GLFW_KEY_TAB && chatField.getText().startsWith(p)) { autocomplete(); @@ -170,6 +173,7 @@ public class AChatScreenMixin extends Screen { @Inject(method = {"init()V"}, at = @At("TAIL")) public void onInit(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; chatField.setMaxLength((ModuleRegistry.getByClass(InfChatLength.class).isEnabled()) ? Integer.MAX_VALUE : 256); } } diff --git a/src/main/java/net/shadow/client/mixin/AEntityRendererMixin.java b/src/main/java/net/shadow/client/mixin/AEntityRendererMixin.java index 800ad25..71829b7 100644 --- a/src/main/java/net/shadow/client/mixin/AEntityRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/AEntityRendererMixin.java @@ -19,6 +19,7 @@ public abstract class AEntityRendererMixin { @Inject(method = "renderLabelIfPresent", at = @At("HEAD"), cancellable = true) public void renderEntityLabel(T entity, Text text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (entity.getCustomName() != null && entity.getCustomName().equals(Text.of("DoNotRenderThisUsernamePlease"))) { ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java b/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java index 83170fe..1b0ab6d 100644 --- a/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/AGenericContainerScreenMixin.java @@ -43,6 +43,7 @@ public abstract class AGenericContainerScreenMixin { @Inject(method = "tick", at = @At("HEAD")) public void preTick(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (!ModuleRegistry.getByClass(InventoryWalk.class).isEnabled()) { return; } diff --git a/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java b/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java index 26a9b08..0a2571b 100644 --- a/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java +++ b/src/main/java/net/shadow/client/mixin/AInGameHudMixin.java @@ -25,6 +25,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public abstract class AInGameHudMixin extends DrawableHelper { @Inject(method = "render", at = @At("RETURN")) public void postRender(MatrixStack matrices, float tickDelta, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; AccurateFrameRateCounter.globalInstance.recordFrame(); MSAAFramebuffer.use(MSAAFramebuffer.MAX_SAMPLES, () -> { for (Module module : ModuleRegistry.getModules()) { diff --git a/src/main/java/net/shadow/client/mixin/AbstractBlockStateMixin.java b/src/main/java/net/shadow/client/mixin/AbstractBlockStateMixin.java index 43a8510..2f10240 100644 --- a/src/main/java/net/shadow/client/mixin/AbstractBlockStateMixin.java +++ b/src/main/java/net/shadow/client/mixin/AbstractBlockStateMixin.java @@ -19,6 +19,7 @@ public class AbstractBlockStateMixin { @Inject(method = "getLuminance", at = @At("HEAD"), cancellable = true) public void shadow_luminateBlock(CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) { cir.setReturnValue(15); } diff --git a/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java b/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java index 5b86a5e..903cd95 100644 --- a/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/AreaEffectCloudEntityMixin.java @@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable; public class AreaEffectCloudEntityMixin { @ModifyVariable(method = "tick", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/util/math/MathHelper;ceil(F)I"), index = 4) int re(int value) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return value; AntiCrash ac = AntiCrash.instance(); if (ac.isEnabled() && ac.getCapParticles().getValue()) { int partTotal = ((ParticleManagerDuck) ShadowMain.client.particleManager).getTotalParticles(); diff --git a/src/main/java/net/shadow/client/mixin/BeaconScreenMixin.java b/src/main/java/net/shadow/client/mixin/BeaconScreenMixin.java index dc47ba5..6c5ec03 100644 --- a/src/main/java/net/shadow/client/mixin/BeaconScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/BeaconScreenMixin.java @@ -28,6 +28,7 @@ public abstract class BeaconScreenMixin extends HandledScreen { diff --git a/src/main/java/net/shadow/client/mixin/BlockEntityRenderDispatcherMixin.java b/src/main/java/net/shadow/client/mixin/BlockEntityRenderDispatcherMixin.java index 787f61a..a3d954a 100644 --- a/src/main/java/net/shadow/client/mixin/BlockEntityRenderDispatcherMixin.java +++ b/src/main/java/net/shadow/client/mixin/BlockEntityRenderDispatcherMixin.java @@ -22,6 +22,7 @@ public class BlockEntityRenderDispatcherMixin { @Inject(method = "render(Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;)V", at = @At("HEAD"), cancellable = true) public void preRender(E blockEntity, float tickDelta, MatrixStack matrix, VertexConsumerProvider vertexConsumerProvider, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Events.fireEvent(EventType.BLOCK_ENTITY_RENDER, new BlockEntityRenderEvent(matrix, blockEntity))) { ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/BlockMixin.java b/src/main/java/net/shadow/client/mixin/BlockMixin.java index f7751b1..636602c 100644 --- a/src/main/java/net/shadow/client/mixin/BlockMixin.java +++ b/src/main/java/net/shadow/client/mixin/BlockMixin.java @@ -23,6 +23,7 @@ public class BlockMixin { @Inject(method = "shouldDrawSide", at = @At("HEAD"), cancellable = true) private static void overwriteShouldDrawSide(BlockState state, BlockView world, BlockPos pos, Direction side, BlockPos blockPos, CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) { cir.setReturnValue(XRAY.blocks.contains(state.getBlock())); } @@ -30,6 +31,7 @@ public class BlockMixin { @Inject(method = "isTranslucent", at = @At("HEAD"), cancellable = true) public void overwriteIsTranslucent(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) { cir.setReturnValue(!XRAY.blocks.contains(state.getBlock())); } diff --git a/src/main/java/net/shadow/client/mixin/CameraMixin.java b/src/main/java/net/shadow/client/mixin/CameraMixin.java index 5cdc47d..17dc323 100644 --- a/src/main/java/net/shadow/client/mixin/CameraMixin.java +++ b/src/main/java/net/shadow/client/mixin/CameraMixin.java @@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; public class CameraMixin { @Inject(method = "getSubmersionType", at = @At("RETURN"), cancellable = true) void pretendEverythingsFine(CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (NoLiquidFog.INSTANCE != null && NoLiquidFog.INSTANCE.isEnabled() && (cir.getReturnValue() == CameraSubmersionType.WATER || cir.getReturnValue() == CameraSubmersionType.LAVA)) { cir.setReturnValue(CameraSubmersionType.NONE); } diff --git a/src/main/java/net/shadow/client/mixin/ClickableWidgetMixin.java b/src/main/java/net/shadow/client/mixin/ClickableWidgetMixin.java index 1069edc..c11c81e 100644 --- a/src/main/java/net/shadow/client/mixin/ClickableWidgetMixin.java +++ b/src/main/java/net/shadow/client/mixin/ClickableWidgetMixin.java @@ -110,6 +110,7 @@ public abstract class ClickableWidgetMixin implements DoesMSAA, FastTickable { @Inject(method = "renderButton", at = @At("HEAD"), cancellable = true) void p(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (((Object) this) instanceof TextFieldWidget) return; ci.cancel(); diff --git a/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java b/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java index 2ce6263..70d8e85 100644 --- a/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientConnection1Mixin.java @@ -20,6 +20,7 @@ public class ClientConnection1Mixin { @Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At("HEAD")) public void applyProxy(Channel channel, CallbackInfo ci) { + //skipped this one as you probably don't want your proxy falling out ProxyManagerScreen.Proxy currentProxy = ProxyManagerScreen.currentProxy; if (currentProxy != null) { if (currentProxy.socks4()) { diff --git a/src/main/java/net/shadow/client/mixin/ClientConnectionMixin.java b/src/main/java/net/shadow/client/mixin/ClientConnectionMixin.java index 589484c..e466020 100644 --- a/src/main/java/net/shadow/client/mixin/ClientConnectionMixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientConnectionMixin.java @@ -23,6 +23,7 @@ public class ClientConnectionMixin { @Inject(method = "handlePacket", at = @At("HEAD"), cancellable = true) private static void dispatchPacketGet(Packet packet, PacketListener listener, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Events.fireEvent(EventType.PACKET_RECEIVE, new PacketEvent(packet))) { ci.cancel(); } @@ -30,6 +31,7 @@ public class ClientConnectionMixin { @Inject(method = "exceptionCaught", at = @At("HEAD"), cancellable = true) public void catchException(ChannelHandlerContext context, Throwable ex, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (ModuleRegistry.getByClass(AntiPacketKick.class).isEnabled()) { ci.cancel(); } @@ -37,6 +39,7 @@ public class ClientConnectionMixin { @Inject(method = "send(Lnet/minecraft/network/Packet;)V", cancellable = true, at = @At("HEAD")) public void dispatchPacketSend(Packet packet, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Events.fireEvent(EventType.PACKET_SEND, new PacketEvent(packet))) { ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/shadow/client/mixin/ClientPlayerEntityMixin.java index b0ad475..0e54871 100644 --- a/src/main/java/net/shadow/client/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientPlayerEntityMixin.java @@ -26,6 +26,7 @@ import java.util.Objects; public class ClientPlayerEntityMixin { @Inject(method = "tick", at = @At("HEAD")) public void preTick(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; Utils.TickManager.tick(); if (!ConfigManager.enabled) { ConfigManager.enableModules(); @@ -39,11 +40,13 @@ public class ClientPlayerEntityMixin { @Redirect(method = "updateNausea", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;shouldPause()Z")) public boolean overwriteIsPauseScreen(Screen screen) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return screen.shouldPause(); return Objects.requireNonNull(ModuleRegistry.getByClass(PortalGUI.class)).isEnabled() || screen.shouldPause(); } @Inject(method = "pushOutOfBlocks", at = @At("HEAD"), cancellable = true) public void preventPushOutFromBlocks(double x, double z, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Objects.requireNonNull(ModuleRegistry.getByClass(Freecam.class)).isEnabled() || Objects.requireNonNull(ModuleRegistry.getByClass(NoPush.class)) .isEnabled() || Objects.requireNonNull(ModuleRegistry.getByClass(Phase.class)).isEnabled()) { ci.cancel(); diff --git a/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java index e5186b7..d2a9f17 100644 --- a/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/shadow/client/mixin/ClientPlayerInteractionManagerMixin.java @@ -6,12 +6,15 @@ package net.shadow.client.mixin; import net.minecraft.client.network.ClientPlayerInteractionManager; import net.shadow.client.feature.module.ModuleRegistry; +import net.shadow.client.feature.module.impl.combat.Reach; import net.shadow.client.feature.module.impl.world.NoBreakDelay; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Objects; @@ -26,4 +29,18 @@ public class ClientPlayerInteractionManagerMixin { int cd = this.blockBreakingCooldown; return Objects.requireNonNull(ModuleRegistry.getByClass(NoBreakDelay.class)).isEnabled() ? 0 : cd; } + + @Inject(method = {"getReachDistance()F"}, at = {@At("HEAD")}, cancellable = true) + private void onReachDistance(CallbackInfoReturnable cir) { + if (ModuleRegistry.getByClass(Reach.class).isEnabled()) { + cir.setReturnValue((float)ModuleRegistry.getByClass(Reach.class).getReachDistance()); + } + } + + @Inject(method = {"hasExtendedReach()Z"}, at = {@At("HEAD")}, cancellable = true) + private void onExtendedReach(CallbackInfoReturnable cir) { + if (ModuleRegistry.getByClass(Reach.class).isEnabled()) { + cir.setReturnValue(true); + } + } } diff --git a/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java b/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java index 546e13b..e5ed164 100644 --- a/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/CreativeInventoryScreenMixin.java @@ -25,6 +25,7 @@ public class CreativeInventoryScreenMixin extends Screen { @Inject(method = "init", at = @At("RETURN")) void postInit(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; RoundButton nbtEdit = new RoundButton(RoundButton.STANDARD, 5, 5, 64, 20, "NBT editor", () -> { if (ShadowMain.client.player.getInventory().getMainHandStack().isEmpty()) { Utils.Logging.error("You need to hold an item!"); diff --git a/src/main/java/net/shadow/client/mixin/EntityModelMixin.java b/src/main/java/net/shadow/client/mixin/EntityModelMixin.java index 843d725..4c8e09d 100644 --- a/src/main/java/net/shadow/client/mixin/EntityModelMixin.java +++ b/src/main/java/net/shadow/client/mixin/EntityModelMixin.java @@ -19,6 +19,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public class EntityModelMixin { @Inject(method = "render", at = @At("HEAD")) void preRender(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; // shut up retard //noinspection ConstantConditions ModuleRegistry.getByClass(ESP.class).recording = ModuleRegistry.getByClass(ESP.class) @@ -28,6 +29,7 @@ public class EntityModelMixin { @Inject(method = "render", at = @At("TAIL")) void postRender(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; ModuleRegistry.getByClass(ESP.class).recording = false; } } diff --git a/src/main/java/net/shadow/client/mixin/EntityRenderDispatcherMixin.java b/src/main/java/net/shadow/client/mixin/EntityRenderDispatcherMixin.java index 7d3ad37..c64003d 100644 --- a/src/main/java/net/shadow/client/mixin/EntityRenderDispatcherMixin.java +++ b/src/main/java/net/shadow/client/mixin/EntityRenderDispatcherMixin.java @@ -21,6 +21,7 @@ public class EntityRenderDispatcherMixin { @Inject(method = "render", at = @At("HEAD"), cancellable = true) public void dispatchEntityRender(E entity, double x, double y, double z, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (Events.fireEvent(EventType.ENTITY_RENDER, new EntityRenderEvent(matrices, entity))) { ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/GameMenuMixin.java b/src/main/java/net/shadow/client/mixin/GameMenuMixin.java index 639e6e3..d886070 100644 --- a/src/main/java/net/shadow/client/mixin/GameMenuMixin.java +++ b/src/main/java/net/shadow/client/mixin/GameMenuMixin.java @@ -23,6 +23,7 @@ public class GameMenuMixin extends Screen { @Inject(method = "initWidgets", at = @At("RETURN")) void addAddons(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; addDrawableChild(new RoundButton(RoundButton.STANDARD, 5, 5, 60, 20, "Addons", () -> { assert client != null; client.setScreen(new AddonManagerScreen()); diff --git a/src/main/java/net/shadow/client/mixin/GameRendererMixin.java b/src/main/java/net/shadow/client/mixin/GameRendererMixin.java index 88a51b9..a97fbcc 100644 --- a/src/main/java/net/shadow/client/mixin/GameRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/GameRendererMixin.java @@ -40,6 +40,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 dispatchWorldRender(float tickDelta, long limitTime, MatrixStack matrix, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (vb) { ShadowMain.client.options.bobView = true; vb = false; diff --git a/src/main/java/net/shadow/client/mixin/KeyboardMixin.java b/src/main/java/net/shadow/client/mixin/KeyboardMixin.java index ba0de36..c3ba973 100644 --- a/src/main/java/net/shadow/client/mixin/KeyboardMixin.java +++ b/src/main/java/net/shadow/client/mixin/KeyboardMixin.java @@ -29,6 +29,7 @@ public class KeyboardMixin { @Inject(method = "onKey", at = @At("RETURN")) void postKeyPressed(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (window == this.client.getWindow() .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) { @@ -41,6 +42,7 @@ public class KeyboardMixin { @Inject(method = "setRepeatEvents", at = @At("HEAD"), cancellable = true) void repeatEvents(boolean repeatEvents, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; this.repeatEvents = true; ci.cancel(); } diff --git a/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java b/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java index ef028f0..a8d8e57 100644 --- a/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/LivingEntityMixin.java @@ -29,7 +29,9 @@ import java.util.Objects; public class LivingEntityMixin { @Inject(method = "onAttacking", at = @At("HEAD")) public void atomic_setLastAttacked(Entity target, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (this.equals(ShadowMain.client.player) && target instanceof LivingEntity entity) { + AttackManager.registerLastAttacked(entity); } } @@ -40,6 +42,7 @@ public class LivingEntityMixin { // } @Inject(method = "canWalkOnFluid", at = @At("HEAD"), cancellable = true) public void atomic_overwriteCanWalkOnFluid(FluidState fluidState, CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (ShadowMain.client.player == null) { return; } @@ -54,6 +57,7 @@ public class LivingEntityMixin { @Redirect(method = "travel", at = @At(value = "INVOKE", target = "net/minecraft/entity/LivingEntity.hasStatusEffect(Lnet/minecraft/entity/effect/StatusEffect;)Z"), require = 0) boolean atomic_stopLevitationEffect(LivingEntity instance, StatusEffect effect) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) instance.hasStatusEffect(effect); if (instance.equals(ShadowMain.client.player) && ModuleRegistry.getByClass(NoLevitation.class).isEnabled() && effect == StatusEffects.LEVITATION) { return false; } else { @@ -63,6 +67,7 @@ public class LivingEntityMixin { @Inject(method = "pushAwayFrom", at = @At("HEAD"), cancellable = true) public void atomic_cancelPush(Entity entity, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (this.equals(ShadowMain.client.player)) { if (Objects.requireNonNull(ModuleRegistry.getByClass(NoPush.class)).isEnabled()) { ci.cancel(); @@ -72,6 +77,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(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return instance.getYaw(); if (instance.equals(ShadowMain.client.player) && ModuleRegistry.getByClass(FreeLook.class).isEnabled()) { return ModuleRegistry.getByClass(FreeLook.class).newyaw; } diff --git a/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java b/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java index ca7ad23..3d4472c 100644 --- a/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/shadow/client/mixin/MinecraftClientMixin.java @@ -31,22 +31,26 @@ public class MinecraftClientMixin { @Inject(method = "stop", at = @At("HEAD")) void real(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; ConfigManager.saveState(); Events.fireEvent(EventType.GAME_EXIT, new NonCancellableEvent()); } @Inject(method = "", at = @At("TAIL")) void postInit(RunArgs args, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; ShadowMain.INSTANCE.postWindowInit(); } @Inject(method = "setScreen", at = @At("HEAD")) void preSetScreen(Screen screen, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; ShadowMain.lastScreenChange = System.currentTimeMillis(); } @Redirect(method = "handleInputEvents", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/MinecraftClient;itemUseCooldown:I")) public int replaceItemUseCooldown(MinecraftClient minecraftClient) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return this.itemUseCooldown; if (Objects.requireNonNull(ModuleRegistry.getByClass(FastUse.class)).isEnabled()) { return 0; } else { diff --git a/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java b/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java index d219d3b..2f55d22 100644 --- a/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java +++ b/src/main/java/net/shadow/client/mixin/ModelPartCuboidMixin.java @@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class ModelPartCuboidMixin { @Redirect(method = "renderCuboid", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/VertexConsumer;vertex(FFFFFFFFFIIFFF)V")) void bruh(VertexConsumer instance, float x, float y, float z, float red, float green, float blue, float alpha, float u, float v, int overlay, int light, float normalX, float normalY, float normalZ) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; instance.vertex(x, y, z, red, green, blue, alpha, u, v, overlay, light, normalX, normalY, normalZ); if (ModuleRegistry.getByClass(ESP.class).recording) { ModuleRegistry.getByClass(ESP.class).vertexDumps.add(new double[]{x, y, z}); diff --git a/src/main/java/net/shadow/client/mixin/ModelPartMixin.java b/src/main/java/net/shadow/client/mixin/ModelPartMixin.java index 2489fab..c5e44e6 100644 --- a/src/main/java/net/shadow/client/mixin/ModelPartMixin.java +++ b/src/main/java/net/shadow/client/mixin/ModelPartMixin.java @@ -18,6 +18,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public class ModelPartMixin { @Inject(method = "renderCuboids", at = @At("HEAD")) void renderCub(MatrixStack.Entry entry, VertexConsumer vertexConsumer, int light, int overlay, float red, float green, float blue, float alpha, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (ModuleRegistry.getByClass(ESP.class).recording) { ModuleRegistry.getByClass(ESP.class).vertexDumps.add(new double[0]); } diff --git a/src/main/java/net/shadow/client/mixin/MouseMixin.java b/src/main/java/net/shadow/client/mixin/MouseMixin.java index 8b912c5..d686017 100644 --- a/src/main/java/net/shadow/client/mixin/MouseMixin.java +++ b/src/main/java/net/shadow/client/mixin/MouseMixin.java @@ -19,6 +19,7 @@ public class MouseMixin { @Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true) public void dispatchMouseEvent(long window, int button, int action, int mods, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; 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 b82c0f4..bb66555 100644 --- a/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/MultiplayerScreenMixin.java @@ -25,6 +25,7 @@ public class MultiplayerScreenMixin extends Screen { @Inject(method = "init", at = @At("RETURN")) void init(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; double sourceY = 32 / 2d - 20 / 2d; 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/ParticleManagerMixin.java b/src/main/java/net/shadow/client/mixin/ParticleManagerMixin.java index ff4fc79..907eef1 100644 --- a/src/main/java/net/shadow/client/mixin/ParticleManagerMixin.java +++ b/src/main/java/net/shadow/client/mixin/ParticleManagerMixin.java @@ -32,6 +32,7 @@ public class ParticleManagerMixin implements ParticleManagerDuck { @Inject(method = "addParticle(Lnet/minecraft/client/particle/Particle;)V", at = @At("HEAD"), cancellable = true) void tick(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; AntiCrash ac = AntiCrash.instance(); if (ac.isEnabled()) { if (ac.getCapParticles().getValue()) { diff --git a/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java b/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java index 20f457a..fb9d5cc 100644 --- a/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java +++ b/src/main/java/net/shadow/client/mixin/PlayerEntityMixin.java @@ -24,6 +24,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; public class PlayerEntityMixin { @Redirect(method = "tick", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerEntity;noClip:Z", opcode = Opcodes.PUTFIELD)) void tickNoClip(PlayerEntity playerEntity, boolean value) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; PlayerNoClipQueryEvent q = new PlayerNoClipQueryEvent(playerEntity); Events.fireEvent(EventType.NOCLIP_QUERY, q); playerEntity.noClip = q.getNoClip(); @@ -31,6 +32,7 @@ public class PlayerEntityMixin { @Inject(method = "getMovementSpeed", at = @At("RETURN"), cancellable = true) void a(CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; Hyperspeed hs = ModuleRegistry.getByClass(Hyperspeed.class); if (!hs.isEnabled() || !equals(ShadowMain.client.player)) { return; @@ -40,6 +42,7 @@ public class PlayerEntityMixin { @Inject(method = "jump", at = @At("RETURN")) void applyLongJump(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (!this.equals(ShadowMain.client.player)) { return; } diff --git a/src/main/java/net/shadow/client/mixin/PlayerEntityRendererMixin.java b/src/main/java/net/shadow/client/mixin/PlayerEntityRendererMixin.java index fb0cc68..6d020da 100644 --- a/src/main/java/net/shadow/client/mixin/PlayerEntityRendererMixin.java +++ b/src/main/java/net/shadow/client/mixin/PlayerEntityRendererMixin.java @@ -21,6 +21,7 @@ public class PlayerEntityRendererMixin { @Inject(method = "renderLabelIfPresent(Lnet/minecraft/client/network/AbstractClientPlayerEntity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At("HEAD"), cancellable = true) void real(AbstractClientPlayerEntity abstractClientPlayerEntity, Text text, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; NameTags nt = ModuleRegistry.getByClass(NameTags.class); if (nt.isEnabled()) { nt.render(matrixStack, abstractClientPlayerEntity, text); diff --git a/src/main/java/net/shadow/client/mixin/ScreenMixin.java b/src/main/java/net/shadow/client/mixin/ScreenMixin.java index 320982a..80aa0e9 100644 --- a/src/main/java/net/shadow/client/mixin/ScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/ScreenMixin.java @@ -30,6 +30,7 @@ public class ScreenMixin { @Inject(method = "renderBackgroundTexture", at = @At("HEAD"), cancellable = true) void real(int vOffset, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; float r = c.getRed() / 255f; float g = c.getGreen() / 255f; float b = c.getBlue() / 255f; diff --git a/src/main/java/net/shadow/client/mixin/SelectWorldScreenMixin.java b/src/main/java/net/shadow/client/mixin/SelectWorldScreenMixin.java index cf4bf60..d6e180b 100644 --- a/src/main/java/net/shadow/client/mixin/SelectWorldScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/SelectWorldScreenMixin.java @@ -20,6 +20,7 @@ public class SelectWorldScreenMixin extends Screen { @Inject(method = "render", at = @At("HEAD")) void a(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; renderBackground(matrices); } } diff --git a/src/main/java/net/shadow/client/mixin/SharedConstantsMixin.java b/src/main/java/net/shadow/client/mixin/SharedConstantsMixin.java index ed841e7..e9d050b 100644 --- a/src/main/java/net/shadow/client/mixin/SharedConstantsMixin.java +++ b/src/main/java/net/shadow/client/mixin/SharedConstantsMixin.java @@ -18,6 +18,7 @@ public class SharedConstantsMixin { @Inject(method = "isValidChar", at = @At("HEAD"), cancellable = true) private static void replaceValidChar(char chr, CallbackInfoReturnable cir) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; if (ModuleRegistry.getByClass(AllowFormatCodes.class).isEnabled() && chr == 'ยง') { cir.setReturnValue(true); } diff --git a/src/main/java/net/shadow/client/mixin/SignEditScreenMixin.java b/src/main/java/net/shadow/client/mixin/SignEditScreenMixin.java new file mode 100644 index 0000000..ef36426 --- /dev/null +++ b/src/main/java/net/shadow/client/mixin/SignEditScreenMixin.java @@ -0,0 +1,40 @@ +package net.shadow.client.mixin; + +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.ingame.SignEditScreen; +import net.minecraft.text.Text; +import net.shadow.client.feature.module.ModuleRegistry; +import net.shadow.client.feature.module.impl.world.AutoSign; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(SignEditScreen.class) +public class SignEditScreenMixin extends Screen { + + @Shadow + @Final + private String[] text; + + protected SignEditScreenMixin(Text title) { + super(title); + } + + @Inject(at = {@At("HEAD")}, method = {"init()V"}) + private void onInit(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; + if (ModuleRegistry.getByClass(AutoSign.class).isEnabled()) { + text = ModuleRegistry.getByClass(AutoSign.class).getText(); + finishEditing(); + } + } + + @Shadow + private void finishEditing() { + + } +} diff --git a/src/main/java/net/shadow/client/mixin/TitleScreenMixin.java b/src/main/java/net/shadow/client/mixin/TitleScreenMixin.java index 0378284..b351e14 100644 --- a/src/main/java/net/shadow/client/mixin/TitleScreenMixin.java +++ b/src/main/java/net/shadow/client/mixin/TitleScreenMixin.java @@ -23,6 +23,7 @@ public class TitleScreenMixin extends Screen { @Inject(method = "init", at = @At("RETURN")) void real(CallbackInfo ci) { + if(!net.shadow.client.feature.module.impl.misc.Unload.loaded) return; Objects.requireNonNull(client).setScreen(LoadingScreen.instance()); } } diff --git a/src/main/resources/shadow.mixins.json b/src/main/resources/shadow.mixins.json index f168112..651adf6 100644 --- a/src/main/resources/shadow.mixins.json +++ b/src/main/resources/shadow.mixins.json @@ -63,7 +63,8 @@ "TitleScreenMixin", "WorldRendererAccessor", "WorldRendererMixin", - "BeaconScreenMixin" + "BeaconScreenMixin", + "SignEditScreenMixin" ], "client": [], "server": [],