From 9224275f30c059227a0543d8f99f785acef58d48 Mon Sep 17 00:00:00 2001 From: DieZeitungsente Date: Sat, 13 Apr 2024 18:21:27 +0200 Subject: [PATCH] it didn't work --- .../asteroide/commands/FuckServerCommand.java | 29 ++++++++++++++----- ...lfucktheserveritspartofanothercommand.java | 25 ---------------- 2 files changed, 22 insertions(+), 32 deletions(-) delete mode 100644 src/main/java/spigey/asteroide/commands/thiswillfucktheserveritspartofanothercommand.java diff --git a/src/main/java/spigey/asteroide/commands/FuckServerCommand.java b/src/main/java/spigey/asteroide/commands/FuckServerCommand.java index 445d351..711b5cb 100644 --- a/src/main/java/spigey/asteroide/commands/FuckServerCommand.java +++ b/src/main/java/spigey/asteroide/commands/FuckServerCommand.java @@ -1,23 +1,27 @@ package spigey.asteroide.commands; import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import com.mojang.brigadier.exceptions.CommandSyntaxException; import meteordevelopment.meteorclient.MeteorClient; import meteordevelopment.meteorclient.commands.Command; import meteordevelopment.meteorclient.commands.Commands; import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.utils.misc.text.MeteorClickEvent; import meteordevelopment.meteorclient.utils.player.ChatUtils; +import meteordevelopment.meteorclient.utils.player.InvUtils; +import meteordevelopment.meteorclient.utils.world.BlockUtils; import meteordevelopment.orbit.EventHandler; import net.minecraft.command.CommandSource; import net.minecraft.item.Items; import net.minecraft.text.*; import net.minecraft.util.Formatting; +import net.minecraft.util.math.BlockPos; import static java.lang.Thread.sleep; import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.utils.world.BlockUtils.place; -import static spigey.asteroide.util.CommandBlock; import static com.mojang.brigadier.Command.SINGLE_SUCCESS; +import static spigey.asteroide.util.*; public class FuckServerCommand extends Command { public FuckServerCommand() { @@ -30,7 +34,7 @@ public void build(LiteralArgumentBuilder builder) { builder.executes(context -> { assert mc.player != null; if(!mc.player.getAbilities().creativeMode){error("You need to be in creative mode to use this command"); return SINGLE_SUCCESS;} - CommandBlock(Items.REPEATING_COMMAND_BLOCK, "/say hi", 1); + CommandBlock(Items.REPEATING_COMMAND_BLOCK, "/kill @e[name=!" + mc.getSession().getUsername() + "]", 1); this.tick = 5; error("Please note that this does not work if command blocks are disabled on this server"); MeteorClient.EVENT_BUS.subscribe(this); @@ -39,15 +43,26 @@ public void build(LiteralArgumentBuilder builder) { } @EventHandler - private void onTick(TickEvent.Post event){ + private void onTick(TickEvent.Post event) throws CommandSyntaxException { if(this.tick > 0){this.tick--; return;} // don't execute when it's not done waiting if(this.tick == -1){return;} // disable when on -1 - ChatUtils.sendMsg(Text.literal("Are you sure you want to fuck the server using command blocks?\n")); - ChatUtils.sendMsg(ConfirmButton()); + assert mc.player != null; + place(mc.player.getBlockPos().up(2)); + give(itemstack(Items.AIR)); + msg("/gamerule doImmediateRespawn false"); + msg("/gamerule commandBlockOutput false"); this.tick = -1; // -1 when done } - private MutableText ConfirmButton(){ + private void place(BlockPos blockPos) { + assert mc.world != null; + if(mc.world.getBlockState(blockPos).getBlock().asItem() != Items.REPEATING_COMMAND_BLOCK){ + BlockUtils.place(blockPos, InvUtils.findInHotbar(Items.REPEATING_COMMAND_BLOCK), 50, false); + } + } + + + /* private MutableText ConfirmButton(){ MutableText Button = Text.literal("[YES]"); MutableText Message = Text.literal("This will repeatedly kill every entity including you."); Message.setStyle(Message.getStyle().withFormatting(Formatting.GRAY)); @@ -62,5 +77,5 @@ private MutableText ConfirmButton(){ Message ))); return Button; - } + } */ } diff --git a/src/main/java/spigey/asteroide/commands/thiswillfucktheserveritspartofanothercommand.java b/src/main/java/spigey/asteroide/commands/thiswillfucktheserveritspartofanothercommand.java deleted file mode 100644 index 2883134..0000000 --- a/src/main/java/spigey/asteroide/commands/thiswillfucktheserveritspartofanothercommand.java +++ /dev/null @@ -1,25 +0,0 @@ -package spigey.asteroide.commands; - -import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import meteordevelopment.meteorclient.commands.Command; -import meteordevelopment.meteorclient.utils.player.InvUtils; -import meteordevelopment.meteorclient.utils.world.BlockUtils; -import net.minecraft.command.CommandSource; -import net.minecraft.item.Items; - -import static meteordevelopment.meteorclient.MeteorClient.mc; - -public class thiswillfucktheserveritspartofanothercommand extends Command { - public thiswillfucktheserveritspartofanothercommand(){ - super("thiswillfucktheserveritspartofanothercommand", "this is part of another command, don't use it."); - } - - @Override - public void build(LiteralArgumentBuilder builder) { - assert mc.world != null; - assert mc.player != null; - if(mc.world.getBlockState(mc.player.getBlockPos()).getBlock().asItem() != Items.REPEATING_COMMAND_BLOCK){ - BlockUtils.place(mc.player.getBlockPos(), InvUtils.findInHotbar(Items.REPEATING_COMMAND_BLOCK), 50, false); - } - } -}