From 72bec0fbbf0736ae753afad9b53559b14c8d5fe5 Mon Sep 17 00:00:00 2001 From: blackilykat Date: Sun, 10 Sep 2023 12:32:56 +0200 Subject: [PATCH] Removed hack features from the GUI and added selfcare and rainbowname to it, also renamed the categories --- .../chipmunkmod/command/CommandManager.java | 1 - .../chipmunkmod/commands/AutoDeopCommand.java | 62 ------------------- .../ClearAntiChatSpamQueueCommand.java | 6 -- .../chipmunkmod/mixin/ChatHudMixin.java | 18 +----- .../mixin/ClientConnectionMixin.java | 21 +------ .../ElderGuardianAppearanceParticleMixin.java | 2 +- .../chipmunkmod/mixin/FontStorageMixin.java | 4 +- .../chipmunkmod/mixin/KeyboardMixin.java | 21 ++----- .../mixin/PacketBundleHandlerMixin.java | 22 +++++++ .../chipmunkmod/mixin/PlayerEntityMixin.java | 10 +-- .../chipmunkmod/mixin/WorldRendererMixin.java | 2 +- .../chipmunkmod/modules/CommandCore.java | 4 ++ .../chipmunkmod/modules/RainbowName.java | 11 ++-- .../chipmunkmod/modules/SelfCare.java | 7 ++- .../chipmunkmod/testclient/gui/Gui.java | 53 ++++++---------- .../testclient/gui/components/Module.java | 4 +- .../options/BooleanCheckboxOption.java | 54 ++++++++++++++++ .../gui/components/options/StringOption.java | 12 ++++ .../AntiChatSpamModule.java | 2 +- .../AntiTeleportModule.java | 2 +- .../anti_annoyances/SelfCareModule.java | 52 ++++++++++++++++ .../modules/antip2w/DelayPacketsModule.java | 21 ------- .../modules/combat/KillAuraModule.java | 61 ------------------ .../modules/fun/RainbowNameModule.java | 23 +++++++ .../AntiParticleKickModule.java | 3 +- .../AntiTextObfuscationLagModule.java | 2 +- .../BlockGuardianParticlesModule.java | 3 +- .../modules/movement/AirJumpModule.java | 25 -------- .../modules/movement/AntiVoidModule.java | 18 ------ .../modules/movement/FlightModule.java | 19 ------ .../modules/movement/FreezeModule.java | 22 ------- .../modules/movement/JesusModule.java | 45 -------------- .../modules/movement/SlipperyWorldModule.java | 13 ---- .../modules/movement/SpeedModule.java | 43 ------------- .../testclient/modules/op/AutoDeopModule.java | 21 ------- .../testclient/modules/op/AutoOpModule.java | 20 ------ .../modules/op/AutoSudoKickModule.java | 20 ------ .../modules/utility/AutoToolsModule.java | 42 ------------- .../modules/utility/GuiMoveModule.java | 12 ---- src/main/resources/chipmunkmod.mixins.json | 1 + 40 files changed, 218 insertions(+), 566 deletions(-) delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/commands/AutoDeopCommand.java create mode 100644 src/main/java/land/chipmunk/chipmunkmod/mixin/PacketBundleHandlerMixin.java create mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/BooleanCheckboxOption.java rename src/main/java/land/chipmunk/chipmunkmod/testclient/modules/{utility => anti_annoyances}/AntiChatSpamModule.java (98%) rename src/main/java/land/chipmunk/chipmunkmod/testclient/modules/{op => anti_annoyances}/AntiTeleportModule.java (95%) create mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/SelfCareModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/antip2w/DelayPacketsModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/combat/KillAuraModule.java create mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/fun/RainbowNameModule.java rename src/main/java/land/chipmunk/chipmunkmod/testclient/modules/{utility => lag_prevention}/AntiParticleKickModule.java (73%) rename src/main/java/land/chipmunk/chipmunkmod/testclient/modules/{utility => lag_prevention}/AntiTextObfuscationLagModule.java (87%) rename src/main/java/land/chipmunk/chipmunkmod/testclient/modules/{utility => lag_prevention}/BlockGuardianParticlesModule.java (84%) delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AirJumpModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AntiVoidModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FlightModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FreezeModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/JesusModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SlipperyWorldModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SpeedModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoDeopModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoOpModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoSudoKickModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AutoToolsModule.java delete mode 100644 src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/GuiMoveModule.java diff --git a/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java b/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java index 107ab8c..ffdb6c4 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java +++ b/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java @@ -39,7 +39,6 @@ public class CommandManager { AutoSkinCommand.register(this.dispatcher); ReloadConfigCommand.register(this.dispatcher); // LoopCrouchCommand.register(this.dispatcher); // ^??????????????????? - AutoDeopCommand.register(this.dispatcher); DebugCommand.register(this.dispatcher); ClearAntiChatSpamQueueCommand.register(this.dispatcher); } diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/AutoDeopCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/AutoDeopCommand.java deleted file mode 100644 index 09e27ba..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/AutoDeopCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -package land.chipmunk.chipmunkmod.commands; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule; -import land.chipmunk.chipmunkmod.util.Chat; -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.text.Text; - -import static com.mojang.brigadier.arguments.StringArgumentType.getString; -import static com.mojang.brigadier.arguments.StringArgumentType.string; -import static land.chipmunk.chipmunkmod.command.CommandManager.argument; -import static land.chipmunk.chipmunkmod.command.CommandManager.literal; - -public class AutoDeopCommand { - public static void register (CommandDispatcher dispatcher) { - final AutoDeopCommand instance = new AutoDeopCommand(); - dispatcher.register( - literal("autodeop") - .then( - literal("add") - .then(argument("username", string()).executes(instance::add)) - ) - .then( - literal("remove") - .then(argument("username", string()).executes(instance::remove)) - ) - .then( - literal("list").executes(instance::list) - ) - ); - } - - - public int add(CommandContext context) throws CommandSyntaxException { - String username = getString(context, "username"); - if(AutoDeopModule.players.contains(username)) { - throw new SimpleCommandExceptionType(Text.translatable("That player is already in the AutoDeop list!")).create(); - } - AutoDeopModule.players.add(username); - Chat.sendGreen("Added " + username + " to the AutoDeop list!"); - return 1; - } - public int remove(CommandContext context) throws CommandSyntaxException { - String username = getString(context, "username"); - if(!AutoDeopModule.players.contains(username)) { - throw new SimpleCommandExceptionType(Text.translatable("That player is not in the AutoDeop list!")).create(); - } - AutoDeopModule.players.remove(username); - Chat.sendGreen("Removed " + username + " to the AutoDeop list!"); - return 1; - } - public int list(CommandContext context) { - Chat.sendGold("AutoDeop player list:"); - for (String player : AutoDeopModule.players) { - Chat.send(" - " + player); - } - return 1; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/ClearAntiChatSpamQueueCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/ClearAntiChatSpamQueueCommand.java index 7e920f3..f28e384 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/ClearAntiChatSpamQueueCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/ClearAntiChatSpamQueueCommand.java @@ -3,19 +3,13 @@ package land.chipmunk.chipmunkmod.commands; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule; import land.chipmunk.chipmunkmod.util.Chat; import land.chipmunk.chipmunkmod.util.Executor; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.text.Text; import java.util.List; import java.util.concurrent.Executors; -import static com.mojang.brigadier.arguments.StringArgumentType.getString; -import static com.mojang.brigadier.arguments.StringArgumentType.string; -import static land.chipmunk.chipmunkmod.command.CommandManager.argument; import static land.chipmunk.chipmunkmod.command.CommandManager.literal; public class ClearAntiChatSpamQueueCommand { diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java index 28bc0e4..9be480a 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java @@ -1,11 +1,9 @@ package land.chipmunk.chipmunkmod.mixin; -import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; import land.chipmunk.chipmunkmod.modules.RainbowName; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule; -import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiChatSpamModule; +import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiChatSpamModule; import land.chipmunk.chipmunkmod.util.Debug; import land.chipmunk.chipmunkmod.util.Executor; import net.minecraft.client.MinecraftClient; @@ -21,9 +19,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - @Mixin(net.minecraft.client.gui.hud.ChatHud.class) public abstract class ChatHudMixin { @@ -33,17 +28,6 @@ public abstract class ChatHudMixin { @Shadow protected abstract void logChatMessage(Text message, @Nullable MessageIndicator indicator); - @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("TAIL")) - private void testclient$autoDeopListener(Text message, MessageSignatureData signature, MessageIndicator indicator, CallbackInfo ci) { - String pattern = "\\[(.*?)\\: Made (.*?) a server operator\\]"; - - - Matcher matcher = Pattern.compile(pattern).matcher(message.getString()); - - if (matcher.find()) { - AutoDeopModule.execute(matcher.group(1), matcher.group(2)); - } - } @Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("HEAD"), cancellable = true) public void chipmunkmod$preventDoubleMessageLogging(Text message, MessageSignatureData signature, MessageIndicator indicator, CallbackInfo ci) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientConnectionMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientConnectionMixin.java index e3430b5..0c17b6a 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientConnectionMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientConnectionMixin.java @@ -2,15 +2,12 @@ package land.chipmunk.chipmunkmod.mixin; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.DecoderException; -import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; -import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule; -import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiParticleKickModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiParticleKickModule; import land.chipmunk.chipmunkmod.util.Chat; import net.minecraft.network.listener.PacketListener; import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket; import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; @@ -25,8 +22,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Optional; -import java.util.ArrayList; - @Mixin(net.minecraft.network.ClientConnection.class) public class ClientConnectionMixin { @Inject(at = @At("HEAD"), method = "disconnect", cancellable = true) @@ -88,19 +83,5 @@ public class ClientConnectionMixin { } } - @Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true) - private void testclient$delayPackets(Packet packet, CallbackInfo ci) { - if(DelayPacketsModule.instance.isEnabled) { - DelayPacketsModule.packetsToSend.add(packet); - ci.cancel(); - } - } - - @Inject(method = "disconnect", at = @At("TAIL")) - private void testclient$disablePacketDelayerOnDisconnect(Text disconnectReason, CallbackInfo ci) { - DelayPacketsModule.instance.isEnabled = false; - DelayPacketsModule.packetsToSend = new ArrayList<>(); - } - } diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ElderGuardianAppearanceParticleMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ElderGuardianAppearanceParticleMixin.java index 6be7fd1..0358ff4 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ElderGuardianAppearanceParticleMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ElderGuardianAppearanceParticleMixin.java @@ -1,6 +1,6 @@ package land.chipmunk.chipmunkmod.mixin; -import land.chipmunk.chipmunkmod.testclient.modules.utility.BlockGuardianParticlesModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.BlockGuardianParticlesModule; import land.chipmunk.chipmunkmod.util.SharedVariables; import net.minecraft.client.particle.ElderGuardianAppearanceParticle; import net.minecraft.client.particle.Particle; diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/FontStorageMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/FontStorageMixin.java index 368aed6..eb664ba 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/FontStorageMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/FontStorageMixin.java @@ -1,8 +1,6 @@ package land.chipmunk.chipmunkmod.mixin; -import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiTextObfuscationLagModule; -import land.chipmunk.chipmunkmod.util.Debug; -import net.minecraft.client.MinecraftClient; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule; import net.minecraft.client.font.FontStorage; import net.minecraft.client.font.Glyph; import net.minecraft.client.font.GlyphRenderer; diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardMixin.java index dc86edd..035004c 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardMixin.java @@ -1,7 +1,5 @@ package land.chipmunk.chipmunkmod.mixin; -import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule; -import land.chipmunk.chipmunkmod.testclient.modules.utility.GuiMoveModule; import net.minecraft.client.Keyboard; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; @@ -16,18 +14,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(Keyboard.class) public class KeyboardMixin { - @Inject(method = "onKey", at = @At("HEAD"), cancellable = true) - private void testclient$keyBindsOverrides(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { - if(key == GLFW.GLFW_KEY_KP_0 && action == 1) { - DelayPacketsModule.instance.isEnabled = !DelayPacketsModule.instance.isEnabled; - if(!DelayPacketsModule.instance.isEnabled) { - DelayPacketsModule.instance.deactivateRunnable.run(); - } - ci.cancel(); - } - } // Don't @ me. It half-works + // LUNA WHAT THE FUCK IS THIS MIXIN AM I SUPPOSED TO UNDERSTAND THIS @Redirect(method = "onKey(JIIII)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", opcode = Opcodes.GETFIELD), slice = @Slice( @@ -36,10 +25,10 @@ public class KeyboardMixin { ) ) private Screen currentScreen(MinecraftClient instance) { - if (GuiMoveModule.instance.isEnabled) { - return null; - } else { +// if (GuiMoveModule.instance.isEnabled) { +// return null; +// } else { return instance.currentScreen; - } +// } } } diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/PacketBundleHandlerMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/PacketBundleHandlerMixin.java new file mode 100644 index 0000000..8e80aa5 --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/PacketBundleHandlerMixin.java @@ -0,0 +1,22 @@ +package land.chipmunk.chipmunkmod.mixin; + +import net.minecraft.network.PacketBundleHandler; +import net.minecraft.network.listener.PacketListener; +import net.minecraft.network.packet.BundlePacket; +import net.minecraft.network.packet.BundleSplitterPacket; +import net.minecraft.network.packet.Packet; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; + +@Mixin(PacketBundleHandler.class) +public interface PacketBundleHandlerMixin { + +} diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/PlayerEntityMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/PlayerEntityMixin.java index f791d91..e94d590 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/PlayerEntityMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/PlayerEntityMixin.java @@ -1,6 +1,4 @@ package land.chipmunk.chipmunkmod.mixin; - -import land.chipmunk.chipmunkmod.testclient.modules.movement.SlipperyWorldModule; import net.minecraft.block.Block; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -9,10 +7,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Block.class) public class PlayerEntityMixin { - @Inject(method = "getSlipperiness", at = @At("HEAD"), cancellable = true) - private void testclient$slipperyWorld(CallbackInfoReturnable cir) { - if(SlipperyWorldModule.instance.isEnabled) { - cir.setReturnValue(((Double) SlipperyWorldModule.instance.optionList.get(0).optionValue).floatValue()); - } - } + //slippery world was here + //TODO: remove } diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/WorldRendererMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/WorldRendererMixin.java index 05e46b3..7796d43 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/WorldRendererMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/WorldRendererMixin.java @@ -1,6 +1,6 @@ package land.chipmunk.chipmunkmod.mixin; -import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiTextObfuscationLagModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule; import net.minecraft.client.render.WorldRenderer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index 8e00299..5644b79 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -139,6 +139,10 @@ public class CommandCore { final ClientConnection connection = client.getNetworkHandler().getConnection(); final BlockPos currentBlock = currentBlockAbsolute(); +// String prefix = new Throwable().getStackTrace()[1].getClassName(); +// String block = currentBlock.toShortString(); +// ChipmunkMod.LOGGER.info(prefix + " ran command in block " + block + " of core"); + // TODO: Support using repeating command blocks (on kaboom-like servers) (because less packets) connection.send(new UpdateCommandBlockC2SPacket(currentBlock, "", CommandBlockBlockEntity.Type.REDSTONE, false, false, false)); connection.send(new UpdateCommandBlockC2SPacket(currentBlock, command, CommandBlockBlockEntity.Type.REDSTONE, false, false, true)); diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java b/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java index 1099357..e0a78ad 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java @@ -1,11 +1,11 @@ package land.chipmunk.chipmunkmod.modules; +import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.util.ColorUtilities; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.TextColor; -import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; @@ -29,6 +29,7 @@ public class RainbowName { public String displayName; private int startHue = 0; + public double speed = 1; public void init () { final TimerTask task = new TimerTask() { @@ -90,6 +91,7 @@ public class RainbowName { public void enable () { enabled = true; + this.displayName = ChipmunkMod.CONFIG.defaultUsername; } public void disable () { @@ -100,7 +102,7 @@ public class RainbowName { public RainbowName (MinecraftClient client) { this.client = client; - this.displayName = client.getSession().getUsername(); + this.displayName = ChipmunkMod.CONFIG.defaultUsername; } private void tick () { @@ -113,9 +115,8 @@ public class RainbowName { } if (!enabled) return; - int hue = startHue; - int increment = (int) (360.0 / Math.max(displayName.length(), 20)); + int increment = (int) (360.0 / Math.max(displayName.length(), 20) * speed); Component component = Component.empty(); StringBuilder essentialsNickname = new StringBuilder(); @@ -127,7 +128,7 @@ public class RainbowName { hue = (hue + increment) % 360; } - CommandCore.INSTANCE.run("essentials:nick " + client.getSession().getUsername() + " " + essentialsNickname); + CommandCore.INSTANCE.run("essentials:nick " + ChipmunkMod.CONFIG.defaultUsername + " " + essentialsNickname); startHue = (startHue + increment) % 360; } catch (Exception e) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java b/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java index 3fc5aff..0bfb899 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java @@ -3,6 +3,7 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; +import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.SelfCareModule; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayerEntity; @@ -81,7 +82,9 @@ public class SelfCare extends Listener { gameMode = -1; hasSkin = false; + cspy = false; // cspy too mabe? + // why was cspy not here lol } @Override @@ -99,19 +102,21 @@ public class SelfCare extends Listener { } public void tick () { - final ClientPlayerEntity player = client.player; final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler(); if (networkHandler == null) { cleanup(); return; } + if(!SelfCareModule.instance.isEnabled) return; + final ClientPlayerEntity player = client.player; if (player != null && !player.hasPermissionLevel(2) && opEnabled) { if (serverHasCommand("op")) networkHandler.sendChatCommand("op @s[type=player]"); } else if (gameMode != 1 && gamemodeEnabled) networkHandler.sendChatCommand("gamemode creative"); } public void chatTick () { + if(!SelfCareModule.instance.isEnabled) return; final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler(); if (!cspy && cspyEnabled) { if (serverHasCommand("c")) networkHandler.sendChatCommand("c on"); } diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/Gui.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/Gui.java index 8f832aa..5de1cb6 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/Gui.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/Gui.java @@ -3,28 +3,27 @@ package land.chipmunk.chipmunkmod.testclient.gui; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.testclient.gui.components.Category; -import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule; -import land.chipmunk.chipmunkmod.testclient.modules.combat.KillAuraModule; -import land.chipmunk.chipmunkmod.testclient.modules.movement.*; -import land.chipmunk.chipmunkmod.testclient.modules.op.AntiTeleportModule; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoOpModule; -import land.chipmunk.chipmunkmod.testclient.modules.op.AutoSudoKickModule; -import land.chipmunk.chipmunkmod.testclient.modules.utility.*; +import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiChatSpamModule; +import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.SelfCareModule; +import land.chipmunk.chipmunkmod.testclient.modules.fun.RainbowNameModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiParticleKickModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule; +import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.BlockGuardianParticlesModule; +import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiTeleportModule; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Drawable; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicInteger; -public class Gui extends Screen{ +public class +Gui extends Screen{ public static ArrayList categoryList = new ArrayList<>(); @@ -162,36 +161,22 @@ public class Gui extends Screen{ public static void addComponents() { - new Category("Movement") - .withModule(new FlightModule()) - .withModule(new SpeedModule()) - .withModule(new FreezeModule()) - .withModule(new AirJumpModule()) - .withModule(new JesusModule()) - .withModule(SlipperyWorldModule.instance) - .register(); - new Category("Combat") - .withModule(new KillAuraModule()) - .withModule(new Module("Reach")) - .withModule(new Module("Bow Aimbot")) - .register(); - new Category("Utility") - .withModule(AutoToolsModule.instance) - .withModule(AntiVoidModule.instance) + new Category("Lag prevention") + .withModule(AntiParticleKickModule.instance) //TODO: make kick prevention module .withModule(BlockGuardianParticlesModule.instance) - .withModule(GuiMoveModule.instance) - .withModule(AntiChatSpamModule.instance) .withModule(AntiTextObfuscationLagModule.instance) .register(); - new Category("OP") + new Category("Anti annoyances") + .withModule(AntiChatSpamModule.instance) .withModule(new AntiTeleportModule()) - .withModule(AutoDeopModule.instance) - .withModule(AutoOpModule.instance) - .withModule(AutoSudoKickModule.instance) + .withModule(SelfCareModule.instance) .register(); - new Category("p2w") - .withModule(DelayPacketsModule.instance) + new Category("Fun") + .withModule(RainbowNameModule.instance) .register(); +// new Category("OP") +// .withModule(AutoOpModule.instance) //TODO: make selfcare module +// .register(); } diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/Module.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/Module.java index a7d7e63..abf3fc9 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/Module.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/Module.java @@ -112,11 +112,11 @@ public class Module extends ButtonWidget { // } // } - public Module atActivate(Runnable runnable) { + public Module onActivate(Runnable runnable) { activateRunnable = runnable; return this; } - public Module atDeactivate(Runnable runnable) { + public Module onDeactivate(Runnable runnable) { deactivateRunnable = runnable; return this; } diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/BooleanCheckboxOption.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/BooleanCheckboxOption.java new file mode 100644 index 0000000..f2d3c20 --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/BooleanCheckboxOption.java @@ -0,0 +1,54 @@ +package land.chipmunk.chipmunkmod.testclient.gui.components.options; + +import land.chipmunk.chipmunkmod.testclient.gui.components.Option; +import net.minecraft.client.gui.widget.CheckboxWidget; +import net.minecraft.client.gui.widget.SliderWidget; +import net.minecraft.text.Text; + +import java.lang.reflect.Field; + +public class BooleanCheckboxOption extends Option { + private RunnableWithParameter onPress = value -> {}; + + CheckboxWidget checkboxWidget = new CheckboxWidget(0, 0, 20, 20, Text.empty(), optionValue) { + @Override + public void onPress() { + optionValue = !optionValue; + onPress.run(optionValue); + + // equivalent of `checked = optionValue`, but checked is private so i have to use this :( + try { + Field checked = CheckboxWidget.class.getDeclaredField("checked"); + checked.setAccessible(true); + checked.set(this, optionValue); + } catch(NoSuchFieldException | IllegalAccessException e) {e.printStackTrace();} + } + }; + + public BooleanCheckboxOption(String name, boolean defaultValue) { + super(name, defaultValue); + optionValue = defaultValue; + widget = checkboxWidget; + } + public BooleanCheckboxOption(String name, boolean defaultValue, RunnableWithParameter onPress) { + super(name, defaultValue); + optionValue = defaultValue; + widget = checkboxWidget; + this.onPress = onPress; + } + + @Override + public void setValueFromString(String string) { + optionValue = Boolean.valueOf(string); + } + + @Override + public String getValueAsString() { + return Boolean.toString(optionValue); + } + + public interface RunnableWithParameter { + void run(T value); + } +} + diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/StringOption.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/StringOption.java index 405c64e..84d6abf 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/StringOption.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/gui/components/options/StringOption.java @@ -5,6 +5,8 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.text.Text; +import java.util.function.Consumer; + public class StringOption extends Option { TextFieldWidget textFieldWidget = new TextFieldWidget(MinecraftClient.getInstance().textRenderer, 0, 0, 200, 20, Text.empty()); public StringOption(String name, String defaultValue) { @@ -15,6 +17,16 @@ public class StringOption extends Option { }); widget = textFieldWidget; } + public StringOption(String name, String defaultValue, Consumer onChanged) { + super(name, defaultValue); + textFieldWidget.setText(defaultValue); + textFieldWidget.setChangedListener(text -> { + optionValue = text; + onChanged.accept(text); + }); + widget = textFieldWidget; + + } @Override public void setValueFromString(String string) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiChatSpamModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiChatSpamModule.java similarity index 98% rename from src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiChatSpamModule.java rename to src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiChatSpamModule.java index 4f7b6f9..f871726 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiChatSpamModule.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiChatSpamModule.java @@ -1,4 +1,4 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; +package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AntiTeleportModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiTeleportModule.java similarity index 95% rename from src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AntiTeleportModule.java rename to src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiTeleportModule.java index 2c4ff6e..e846cd4 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AntiTeleportModule.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/AntiTeleportModule.java @@ -1,4 +1,4 @@ -package land.chipmunk.chipmunkmod.testclient.modules.op; +package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; import land.chipmunk.chipmunkmod.util.Chat; diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/SelfCareModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/SelfCareModule.java new file mode 100644 index 0000000..60cd1d8 --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/anti_annoyances/SelfCareModule.java @@ -0,0 +1,52 @@ +package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances; + +import land.chipmunk.chipmunkmod.ChipmunkMod; +import land.chipmunk.chipmunkmod.modules.SelfCare; +import land.chipmunk.chipmunkmod.testclient.gui.components.Module; +import land.chipmunk.chipmunkmod.testclient.gui.components.options.BooleanCheckboxOption; +import land.chipmunk.chipmunkmod.testclient.gui.components.options.StringOption; + +public class SelfCareModule extends Module { + public static SelfCareModule instance = new SelfCareModule(); + BooleanCheckboxOption opOption = new BooleanCheckboxOption( + "OP", + SelfCare.INSTANCE.opEnabled, + value -> SelfCare.INSTANCE.opEnabled = value + ); + BooleanCheckboxOption gmcOption = new BooleanCheckboxOption( + "Creative mode", + SelfCare.INSTANCE.gamemodeEnabled, + value -> SelfCare.INSTANCE.gamemodeEnabled = value + ); + BooleanCheckboxOption cspyOption = new BooleanCheckboxOption( + "Command spy", + SelfCare.INSTANCE.cspyEnabled, + value -> SelfCare.INSTANCE.cspyEnabled = value + ); + StringOption skinUsernameOption = new StringOption( + "Skin's username", + ChipmunkMod.CONFIG.defaultUsername, + s -> { + SelfCare.INSTANCE.hasSkin = false; + } + ); + BooleanCheckboxOption skinOption = new BooleanCheckboxOption( + "Skin", + SelfCare.INSTANCE.skin.equals("off") +// value -> { +// SelfCare.INSTANCE.skin = value ? skinUsernameOption.optionValue : "off"; +// } + ); + public SelfCareModule() { + super("Self care"); + withOption(opOption); + withOption(gmcOption); + withOption(cspyOption); + withOption(skinOption); + withOption(skinUsernameOption); + endTickRunnable = () -> { + // make it update the skin self acre username + SelfCare.INSTANCE.skin = skinOption.optionValue ? skinUsernameOption.optionValue : "off"; + }; + } +} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/antip2w/DelayPacketsModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/antip2w/DelayPacketsModule.java deleted file mode 100644 index cfddf9c..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/antip2w/DelayPacketsModule.java +++ /dev/null @@ -1,21 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.antip2w; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; -import net.minecraft.network.packet.Packet; - -import java.util.ArrayList; - -public class DelayPacketsModule extends Module { - public static DelayPacketsModule instance = new DelayPacketsModule(); - public static ArrayList> packetsToSend = new ArrayList<>(); - public DelayPacketsModule() { - super("Delay packets"); - deactivateRunnable = () -> { - packetsToSend.forEach(packet -> { - MinecraftClient.getInstance().getNetworkHandler().getConnection().send(packet); - }); - packetsToSend = new ArrayList<>(); - }; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/combat/KillAuraModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/combat/KillAuraModule.java deleted file mode 100644 index 9985472..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/combat/KillAuraModule.java +++ /dev/null @@ -1,61 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.combat; - -import land.chipmunk.chipmunkmod.ChipmunkMod; -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; -import net.minecraft.command.argument.EntityAnchorArgumentType; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.text.Text; -import net.minecraft.util.math.Box; - -import java.util.ArrayList; -import java.util.Objects; - -public class KillAuraModule extends Module { - ArrayList attackEntityList = new ArrayList<>(); - double reach = 10; - static boolean debug = false; - public KillAuraModule() { - super("KillAura"); - attackEntityList.add(EntityType.ZOMBIE); - endTickRunnable = () -> { - - debug("Ticked!"); - for (Entity entity : MinecraftClient.getInstance().world.getOtherEntities(MinecraftClient.getInstance().player, Box.of(MinecraftClient.getInstance().player.getEyePos(), reach / 2, reach / 2, reach / 2))) { - debug("Found entity " + entity.getType().toString()); - for (EntityType entityType : attackEntityList) { - if(Objects.equals(entity.getType().toString(), entityType.toString())) { - debug("And is of the correct entity type"); - MinecraftClient.getInstance().inGameHud.setSubtitle(Text.literal(entity.getType().toString())); - MinecraftClient.getInstance().player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, entity.getPos()); - if(MinecraftClient.getInstance().player.getAttackCooldownProgress(0)==1) { - MinecraftClient.getInstance().interactionManager.attackEntity(MinecraftClient.getInstance().player, entity); - } - return; - } - } - } -// for (Entity entity : MinecraftClient.getInstance().world.getEntities()) { -// if(entity.equals(MinecraftClient.getInstance().player)) return; -// debug(WorldUtil.getPlayerDistance(entity.getPos()) + " blocks away"); -// if(WorldUtil.getPlayerDistance(entity.getPos()) > reach) return; -// debug("Which is close enough to the player"); -// MinecraftClient.getInstance().inGameHud.setTitle(Text.literal(entity.getType().toString())); -// debug("Found entity " + entity.getType().toString()); -// for (EntityType entityType : attackEntityList) { -// if(Objects.equals(entity.getType().toString(), entityType.toString())) { -// debug("And is of the correct entity type"); -// MinecraftClient.getInstance().inGameHud.setSubtitle(Text.literal(entity.getType().toString())); -//// MinecraftClient.getInstance().player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, entity.getPos()); -// MinecraftClient.getInstance().interactionManager.attackEntity(MinecraftClient.getInstance().player, entity); -// } -// } -// } - }; - } - private static void debug(String message) { - if(debug) ChipmunkMod.LOGGER.info("[KillAura] " + message); - } - -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/fun/RainbowNameModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/fun/RainbowNameModule.java new file mode 100644 index 0000000..bedcbe0 --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/fun/RainbowNameModule.java @@ -0,0 +1,23 @@ +package land.chipmunk.chipmunkmod.testclient.modules.fun; + +import land.chipmunk.chipmunkmod.modules.RainbowName; +import land.chipmunk.chipmunkmod.testclient.gui.components.Module; +import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption; + +public class RainbowNameModule extends Module { + public static RainbowNameModule instance = new RainbowNameModule(); + public static DoubleSliderOption speedOption; + public RainbowNameModule() { + super("Rainbow name"); + speedOption = new DoubleSliderOption("Speed", 1, 0.1, 2, 2); + withOption(speedOption); + needsInWorld = true; +// onActivate(RainbowName.INSTANCE::enable); + onDeactivate(RainbowName.INSTANCE::disable); + atEndTick(() -> { + RainbowName.INSTANCE.enable(); + RainbowName.INSTANCE.speed = speedOption.optionValue; + }); + + } +} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiParticleKickModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiParticleKickModule.java similarity index 73% rename from src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiParticleKickModule.java rename to src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiParticleKickModule.java index 14178aa..b0ad475 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiParticleKickModule.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiParticleKickModule.java @@ -1,7 +1,6 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; +package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; public class AntiParticleKickModule extends Module { public static AntiParticleKickModule instance = new AntiParticleKickModule(); diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiTextObfuscationLagModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiTextObfuscationLagModule.java similarity index 87% rename from src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiTextObfuscationLagModule.java rename to src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiTextObfuscationLagModule.java index adfe20d..59029b5 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AntiTextObfuscationLagModule.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/AntiTextObfuscationLagModule.java @@ -1,4 +1,4 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; +package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/BlockGuardianParticlesModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/BlockGuardianParticlesModule.java similarity index 84% rename from src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/BlockGuardianParticlesModule.java rename to src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/BlockGuardianParticlesModule.java index 6018d36..1578653 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/BlockGuardianParticlesModule.java +++ b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/lag_prevention/BlockGuardianParticlesModule.java @@ -1,9 +1,8 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; +package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention; import land.chipmunk.chipmunkmod.testclient.gui.components.Module; import land.chipmunk.chipmunkmod.testclient.gui.components.options.StringOption; import land.chipmunk.chipmunkmod.util.Chat; -import net.minecraft.client.MinecraftClient; public class BlockGuardianParticlesModule extends Module { public static BlockGuardianParticlesModule instance = new BlockGuardianParticlesModule(); diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AirJumpModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AirJumpModule.java deleted file mode 100644 index 6354e5e..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AirJumpModule.java +++ /dev/null @@ -1,25 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; -import net.minecraft.util.math.Vec3d; - -public class AirJumpModule extends Module { - boolean wasSpacePressed; - public AirJumpModule() { - super("Air Jump"); - wasSpacePressed = false; - endTickRunnable = new Runnable() { - @Override - public void run() { - if(MinecraftClient.getInstance().options.jumpKey.wasPressed() && !wasSpacePressed) { - wasSpacePressed = true; - Vec3d v = MinecraftClient.getInstance().player.getVelocity(); - MinecraftClient.getInstance().player.setVelocity(v.x, 0.35, v.z); - } else if (!MinecraftClient.getInstance().options.jumpKey.wasPressed()) { - wasSpacePressed = false; - } - } - }; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AntiVoidModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AntiVoidModule.java deleted file mode 100644 index 8fb74ee..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/AntiVoidModule.java +++ /dev/null @@ -1,18 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; - -public class AntiVoidModule extends Module { - public static AntiVoidModule instance = new AntiVoidModule(); - public AntiVoidModule() { - super("Anti void"); - endTickRunnable = () -> { - if(MinecraftClient.getInstance().player.getY() < -64) { - MinecraftClient.getInstance().player.setPosition(MinecraftClient.getInstance().player.getX(), -64, MinecraftClient.getInstance().player.getZ()); - MinecraftClient.getInstance().player.setOnGround(true); - } - }; - isEnabled = true; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FlightModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FlightModule.java deleted file mode 100644 index e851df5..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FlightModule.java +++ /dev/null @@ -1,19 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; - -public class FlightModule extends Module { - public FlightModule() { - super("Flight"); - endTickRunnable = () -> MinecraftClient.getInstance().player.getAbilities().allowFlying = true; - deactivateRunnable = () -> { - if(MinecraftClient.getInstance().player != null) - MinecraftClient.getInstance().player.getAbilities().allowFlying = MinecraftClient.getInstance().player.getAbilities().creativeMode; - }; - - } - - - -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FreezeModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FreezeModule.java deleted file mode 100644 index 0cd9151..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/FreezeModule.java +++ /dev/null @@ -1,22 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; -import net.minecraft.util.math.Vec3d; - -public class FreezeModule extends Module { - public static Vec3d mantainPos; - public FreezeModule() { - super("Freeze"); - activateRunnable = () -> { - mantainPos = MinecraftClient.getInstance().player.getPos(); - }; - endTickRunnable = new Runnable() { - @Override - public void run() { - MinecraftClient.getInstance().player.setVelocity(0, 0, 0); - MinecraftClient.getInstance().player.setPosition(mantainPos); - } - }; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/JesusModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/JesusModule.java deleted file mode 100644 index 0f6bb1a..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/JesusModule.java +++ /dev/null @@ -1,45 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption; -import net.minecraft.block.Blocks; -import net.minecraft.client.MinecraftClient; -import net.minecraft.block.Block; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; - -public class JesusModule extends Module { - public static boolean forceOnGround = false; - public JesusModule() { - super("Jesus"); - withOption(new DoubleSliderOption("Float strength", 0.2, 0, 2, 3)); - withOption(new DoubleSliderOption("Recognise top offset", 0.4, 0, 1, 4)); - withOption(new DoubleSliderOption("Walk offset", 0.4, 0, 1, 4)); - endTickRunnable = () -> { - // do stuffs -// Material material = MinecraftClient.getInstance().player.getBlockStateAtPos().getMaterial(); - Vec3d pos = MinecraftClient.getInstance().player.getPos(); - pos = new Vec3d(pos.x, pos.y-((double) optionList.get(2).optionValue), pos.z); - Block material = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(pos)).getBlock(); - Vec3d posRightAbove = new Vec3d(pos.x, ((int) (pos.y+((double) optionList.get(1).optionValue))), pos.z); - Vec3d posRightUnder = new Vec3d(pos.x, ((int) (pos.y-((double) optionList.get(1).optionValue))), pos.z); -// posRightAbove.floorAlongAxes(EnumSet.of(Direction.Axis.Y)); - Block materialRightAbove = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(posRightAbove.x, posRightAbove.y, posRightAbove.z)).getBlock(); - Block materialRightUnder = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(posRightUnder.x, posRightUnder.y, posRightUnder.z)).getBlock(); - Vec3d walkOn = new Vec3d(posRightAbove.x, posRightAbove.y+((double) optionList.get(2).optionValue), posRightAbove.z); - - if(material == Blocks.WATER || material == Blocks.LAVA) { - Vec3d v = MinecraftClient.getInstance().player.getVelocity(); - if(materialRightAbove == Blocks.AIR || materialRightUnder == Blocks.AIR) { - MinecraftClient.getInstance().player.setPosition(walkOn); - MinecraftClient.getInstance().player.setOnGround(true); - MinecraftClient.getInstance().player.setVelocity(v.x, 0, v.z); - return; - } - // if there isn't air *right above* the feet, send player up - MinecraftClient.getInstance().player.setVelocity(v.x, ((double) optionList.get(0).optionValue), v.z); - } else forceOnGround = false; - MinecraftClient.getInstance().player.isOnGround(); - }; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SlipperyWorldModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SlipperyWorldModule.java deleted file mode 100644 index cc6f366..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SlipperyWorldModule.java +++ /dev/null @@ -1,13 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption; -import net.minecraft.client.MinecraftClient; - -public class SlipperyWorldModule extends Module { - public static SlipperyWorldModule instance = new SlipperyWorldModule(); - public SlipperyWorldModule() { - super("Slippery world"); - withOption(new DoubleSliderOption("Slipperiness", 0, -5, 5, 2)); - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SpeedModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SpeedModule.java deleted file mode 100644 index 2ce18e0..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/movement/SpeedModule.java +++ /dev/null @@ -1,43 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.movement; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption; -import land.chipmunk.chipmunkmod.util.AttributeModifier; -import net.minecraft.client.MinecraftClient; -import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; - -public class SpeedModule extends Module { - public static AttributeModifier attributeModifier; - public SpeedModule() { - super("Speed"); - withOption(new DoubleSliderOption("multiplier", 0, 0, 10, 3)); - endTickRunnable = new Runnable() { - @Override - public void run() { - if(MinecraftClient.getInstance().player == null) return; - if(attributeModifier == null) { - attributeModifier = new AttributeModifier( - EntityAttributes.GENERIC_MOVEMENT_SPEED, - 2, - EntityAttributeModifier.Operation.MULTIPLY_TOTAL - ); - } else { - - float value = ((Double)optionList.get(0).optionValue).floatValue(); - if(attributeModifier.getValue() != value) { - attributeModifier.setValue(value); -// Chat.sendGold("Speed multiplier: " + value); - } - } - if(!attributeModifier.isOnPlayer()) attributeModifier.add(); - } - }; - deactivateRunnable = new Runnable() { - @Override - public void run() { - attributeModifier.remove(); - } - }; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoDeopModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoDeopModule.java deleted file mode 100644 index 01369a8..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoDeopModule.java +++ /dev/null @@ -1,21 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.op; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; - -import java.util.ArrayList; - -public class AutoDeopModule extends Module { - public static ArrayList players = new ArrayList<>(); - public static AutoDeopModule instance = new AutoDeopModule(); - public AutoDeopModule() { - super("Auto Deop"); - } - - public static void execute(String opper, String opped) { - if(!instance.isEnabled) return; - if(players.contains(opped)) { - MinecraftClient.getInstance().getNetworkHandler().sendChatCommand("deop " + opped); - } - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoOpModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoOpModule.java deleted file mode 100644 index c1638a3..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoOpModule.java +++ /dev/null @@ -1,20 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.op; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import land.chipmunk.chipmunkmod.util.WorldUtil; -import net.minecraft.client.MinecraftClient; -import net.minecraft.server.MinecraftServer; - -public class AutoOpModule extends Module { - public static AutoOpModule instance = new AutoOpModule(); - public AutoOpModule() { - super("Auto OP"); -// endTickRunnable = () -> { -// if(!WorldUtil.isPlayerOP()) MinecraftClient.getInstance().getNetworkHandler().sendCommand("op " + MinecraftClient.getInstance().getSession().getUsername()); -// }; - } - public void run(MinecraftServer server) { - if(!WorldUtil.isPlayerOP(server)) MinecraftClient.getInstance().getNetworkHandler().sendCommand("op " + MinecraftClient.getInstance().getSession().getUsername()); - - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoSudoKickModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoSudoKickModule.java deleted file mode 100644 index 8699d12..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/op/AutoSudoKickModule.java +++ /dev/null @@ -1,20 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.op; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; - -import java.util.ArrayList; - -public class AutoSudoKickModule extends Module { - public static AutoSudoKickModule instance = new AutoSudoKickModule(); - public static ArrayList players = new ArrayList<>(); - public AutoSudoKickModule() { - super("Auto SudoKick"); - isEnabled = true; - } - - public static void execute(String username) { - if(instance.isEnabled && players.contains(username)) - MinecraftClient.getInstance().getNetworkHandler().sendCommand("sudo " + username + " msg @s @e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e"); - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AutoToolsModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AutoToolsModule.java deleted file mode 100644 index 4b06b22..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/AutoToolsModule.java +++ /dev/null @@ -1,42 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.block.BlockState; -import net.fabricmc.fabric.api.event.player.AttackBlockCallback; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ActionResult; - -public class AutoToolsModule extends Module { - public static AutoToolsModule instance = new AutoToolsModule(); - - public AutoToolsModule() { - super("Auto tools"); - // it's all in the event listener below - } - - public static void registerListener() { - AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> { - if (!instance.isEnabled) return ActionResult.PASS; - final BlockState blockState = world.getBlockState(pos); - final PlayerInventory inventory = player.getInventory(); - - // If the player already has the appropriate tool, don't do anything - if (inventory.getMainHandStack().getMiningSpeedMultiplier(blockState) > 1) return ActionResult.PASS; - - for (int slot = 0; slot < 9; slot++) { - if (slot == inventory.selectedSlot) continue; // We already checked the current slot - final ItemStack item = inventory.getStack(slot); - if (item.getMiningSpeedMultiplier(blockState) > 1) { - inventory.selectedSlot = slot; - break; - } - } - return ActionResult.PASS; - }); - } - - static { - registerListener(); - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/GuiMoveModule.java b/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/GuiMoveModule.java deleted file mode 100644 index ea2c41d..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/testclient/modules/utility/GuiMoveModule.java +++ /dev/null @@ -1,12 +0,0 @@ -package land.chipmunk.chipmunkmod.testclient.modules.utility; - -import land.chipmunk.chipmunkmod.testclient.gui.components.Module; -import net.minecraft.client.MinecraftClient; - -public class GuiMoveModule extends Module { - public static GuiMoveModule instance = new GuiMoveModule(); - - public GuiMoveModule() { - super("GUI Move"); - } -} diff --git a/src/main/resources/chipmunkmod.mixins.json b/src/main/resources/chipmunkmod.mixins.json index f2d0e92..f86e1f3 100644 --- a/src/main/resources/chipmunkmod.mixins.json +++ b/src/main/resources/chipmunkmod.mixins.json @@ -36,6 +36,7 @@ }, "mixins": [ "NbtIoInvoker", + "PacketBundleHandlerMixin", "PlayerEntityMixin", "TextMixin", "TextSerializerMixin"