update to 1.19.3 and starts of clickgui

This commit is contained in:
kawaiizenbo 2022-12-07 12:40:49 -07:00
parent 412cabff8a
commit 05ff377b5c
11 changed files with 115 additions and 15 deletions

View file

@ -28,6 +28,7 @@ public class CommandManager
add(new VClip());
add(new Help());
add(new Toggle());
add(new Teleport());
commands.sort(Comparator.comparing(Command::getName));
}
@ -81,6 +82,6 @@ public class CommandManager
}
public String getPrefix() {
return "?";
return ".";
}
}

View file

@ -0,0 +1,46 @@
package me.kawaiizenbo.moonlight.command.commands;
import com.mojang.brigadier.arguments.DoubleArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.kawaiizenbo.moonlight.command.Command;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.command.CommandSource;
import net.minecraft.entity.Entity;
public class Teleport extends Command
{
public Teleport()
{
super("teleport", "Teleports you to specified coordinates.");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder)
{
builder
.then(argument("x", DoubleArgumentType.doubleArg())
.then(argument("y", DoubleArgumentType.doubleArg())
.then(argument("z", DoubleArgumentType.doubleArg())
.executes(context ->
{
ClientPlayerEntity player = mc.player;
assert player != null;
double x = context.getArgument("x", Double.class);
double y = context.getArgument("y", Double.class);
double z = context.getArgument("z", Double.class);
if (player.hasVehicle())
{
Entity vehicle = player.getVehicle();
vehicle.setPosition(x, y, z);
}
player.setPosition(x, y, z);
return SINGLE_SUCCESS;
}))));
}
}