dfghjkl;'
This commit is contained in:
parent
baf8d849b6
commit
412cabff8a
23 changed files with 706 additions and 18 deletions
|
@ -0,0 +1,32 @@
|
|||
package me.kawaiizenbo.moonlight.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
import me.kawaiizenbo.moonlight.command.Command;
|
||||
import me.kawaiizenbo.moonlight.command.CommandManager;
|
||||
import me.kawaiizenbo.moonlight.util.ChatUtils;
|
||||
import me.kawaiizenbo.moonlight.util.ColorUtils;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
public class Help extends Command
|
||||
{
|
||||
public Help()
|
||||
{
|
||||
super("help", "Gives you a list of all of the commands");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder)
|
||||
{
|
||||
builder.executes(context ->
|
||||
{
|
||||
for (Command cmd : CommandManager.get().getAll()) {
|
||||
ChatUtils.sendMsg(ColorUtils.aqua + "Command: " + ColorUtils.gray + cmd.getName());
|
||||
ChatUtils.sendMsg(ColorUtils.gray + cmd.getDescription());
|
||||
}
|
||||
return SINGLE_SUCCESS;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package me.kawaiizenbo.moonlight.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
import me.kawaiizenbo.moonlight.command.Command;
|
||||
import me.kawaiizenbo.moonlight.command.ModuleArgumentType;
|
||||
import me.kawaiizenbo.moonlight.module.Module_;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
public class Toggle extends Command
|
||||
{
|
||||
|
||||
public Toggle()
|
||||
{
|
||||
super("toggle", "Toggle a module.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder)
|
||||
{
|
||||
builder.then(argument("module", new ModuleArgumentType()).executes(context ->
|
||||
{
|
||||
ClientPlayerEntity player = mc.player;
|
||||
assert player != null;
|
||||
|
||||
Module_ m = context.getArgument("module", Module_.class);
|
||||
m.toggle();
|
||||
|
||||
return SINGLE_SUCCESS;
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
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 VClip extends Command
|
||||
{
|
||||
|
||||
public VClip()
|
||||
{
|
||||
super("vclip", "Teleports you vertically.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder)
|
||||
{
|
||||
builder.then(argument("blocks", DoubleArgumentType.doubleArg()).executes(context ->
|
||||
{
|
||||
ClientPlayerEntity player = mc.player;
|
||||
assert player != null;
|
||||
|
||||
double blocks = context.getArgument("blocks", Double.class);
|
||||
if (player.hasVehicle())
|
||||
{
|
||||
Entity vehicle = player.getVehicle();
|
||||
vehicle.setPosition(vehicle.getX(), vehicle.getY() + blocks, vehicle.getZ());
|
||||
}
|
||||
player.setPosition(player.getX(), player.getY() + blocks, player.getZ());
|
||||
|
||||
return SINGLE_SUCCESS;
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue