new commands
This commit is contained in:
@@ -65,11 +65,13 @@
|
|||||||
- `stopMomentum`
|
- `stopMomentum`
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
- `.center`
|
||||||
- `.ghost` (Ported from [AntiGhost](https://github.com/gbl/AntiGhost/blob/fabric_1_16/src/main/java/de/guntram/mcmod/antighost/AntiGhost.java))
|
- `.ghost` (Ported from [AntiGhost](https://github.com/gbl/AntiGhost/blob/fabric_1_16/src/main/java/de/guntram/mcmod/antighost/AntiGhost.java))
|
||||||
- `.save-skin`
|
- `.save-skin`
|
||||||
- `.heads`
|
- `.heads`
|
||||||
- `.seed` (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/1300))
|
- `.seed` (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/1300))
|
||||||
- `.setblock`
|
- `.setblock`
|
||||||
|
- `.set-velocity`
|
||||||
- `.teleport`
|
- `.teleport`
|
||||||
- `.terrain-export` (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.17/src/main/java/bleach/hack/command/commands/CmdTerrain.java))
|
- `.terrain-export` (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.17/src/main/java/bleach/hack/command/commands/CmdTerrain.java))
|
||||||
- `.kick` (Ported from [LiquidBounce](https://github.com/CCBlueX/LiquidBounce/blob/nextgen/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/ModuleKick.kt))
|
- `.kick` (Ported from [LiquidBounce](https://github.com/CCBlueX/LiquidBounce/blob/nextgen/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/ModuleKick.kt))
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
|
|
||||||
// Commands
|
// Commands
|
||||||
Commands commands = Commands.get();
|
Commands commands = Commands.get();
|
||||||
|
commands.add(new CenterCommand());
|
||||||
commands.add(new GhostCommand());
|
commands.add(new GhostCommand());
|
||||||
commands.add(new GiveCommand());
|
commands.add(new GiveCommand());
|
||||||
commands.add(new SaveSkinCommand());
|
commands.add(new SaveSkinCommand());
|
||||||
@@ -81,6 +82,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
// commands.add(new LocateCommand()); I wish it was that simple -_-
|
// commands.add(new LocateCommand()); I wish it was that simple -_-
|
||||||
commands.add(new ServerCommand());
|
commands.add(new ServerCommand());
|
||||||
commands.add(new SetBlockCommand());
|
commands.add(new SetBlockCommand());
|
||||||
|
commands.add(new SetVelocityCommand());
|
||||||
commands.add(new TeleportCommand());
|
commands.add(new TeleportCommand());
|
||||||
commands.add(new TerrainExport());
|
commands.add(new TerrainExport());
|
||||||
|
|
||||||
|
|||||||
36
src/main/java/anticope/rejects/commands/CenterCommand.java
Normal file
36
src/main/java/anticope/rejects/commands/CenterCommand.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package anticope.rejects.commands;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
|
import meteordevelopment.meteorclient.systems.commands.Command;
|
||||||
|
import net.minecraft.command.CommandSource;
|
||||||
|
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||||
|
|
||||||
|
public class CenterCommand extends Command {
|
||||||
|
public CenterCommand() {
|
||||||
|
super("center", "Centers the player on a block.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||||
|
builder.then(literal("middle").executes(context -> {
|
||||||
|
double x = MathHelper.floor(mc.player.getX()) + 0.5;
|
||||||
|
double z = MathHelper.floor(mc.player.getZ()) + 0.5;
|
||||||
|
mc.player.setPosition(x, mc.player.getY(), z);
|
||||||
|
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround()));
|
||||||
|
|
||||||
|
return SINGLE_SUCCESS;
|
||||||
|
}));
|
||||||
|
|
||||||
|
builder.then(literal("center").executes(context -> {
|
||||||
|
double x = MathHelper.floor(mc.player.getX());
|
||||||
|
double z = MathHelper.floor(mc.player.getZ());
|
||||||
|
mc.player.setPosition(x, mc.player.getY(), z);
|
||||||
|
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround()));
|
||||||
|
|
||||||
|
return SINGLE_SUCCESS;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package anticope.rejects.commands;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.arguments.DoubleArgumentType;
|
||||||
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
|
import meteordevelopment.meteorclient.systems.commands.Command;
|
||||||
|
import net.minecraft.command.CommandSource;
|
||||||
|
|
||||||
|
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||||
|
|
||||||
|
public class SetVelocityCommand extends Command {
|
||||||
|
public SetVelocityCommand() {
|
||||||
|
super("set-velocity", "Sets player velocity", "velocity", "vel");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||||
|
builder.then(argument("y", DoubleArgumentType.doubleArg()).executes(ctx -> {
|
||||||
|
var currentVelocity = mc.player.getVelocity();
|
||||||
|
mc.player.setVelocity(currentVelocity.x, DoubleArgumentType.getDouble(ctx, "y"), currentVelocity.z);
|
||||||
|
return SINGLE_SUCCESS;
|
||||||
|
}));
|
||||||
|
|
||||||
|
builder.then(argument("x", DoubleArgumentType.doubleArg()).then(argument("z", DoubleArgumentType.doubleArg()).executes(ctx -> {
|
||||||
|
double x = DoubleArgumentType.getDouble(ctx, "x");
|
||||||
|
double z = DoubleArgumentType.getDouble(ctx, "z");
|
||||||
|
mc.player.setVelocity(x, mc.player.getVelocity().y, z);
|
||||||
|
return SINGLE_SUCCESS;
|
||||||
|
})));
|
||||||
|
|
||||||
|
builder.then(argument("x", DoubleArgumentType.doubleArg()).then(argument("y", DoubleArgumentType.doubleArg()).then(argument("z", DoubleArgumentType.doubleArg()).executes(ctx -> {
|
||||||
|
double x = DoubleArgumentType.getDouble(ctx, "x");
|
||||||
|
double y = DoubleArgumentType.getDouble(ctx, "y");
|
||||||
|
double z = DoubleArgumentType.getDouble(ctx, "z");
|
||||||
|
mc.player.setVelocity(x, y, z);
|
||||||
|
return SINGLE_SUCCESS;
|
||||||
|
}))));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user