Begin to implement

This commit is contained in:
zontreck 2025-03-29 02:19:55 -07:00
parent 4512d2f728
commit 3b2712151a
5 changed files with 65 additions and 6 deletions

View file

@ -0,0 +1,17 @@
package dev.zontreck.ase;
import dev.zontreck.ase.commands.CommandRegistry;
import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
public class Bootstrapper implements PluginBootstrap {
@Override
public void bootstrap(BootstrapContext context) {
context.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, commands -> {
CommandRegistry.register(commands.registrar());
});
}
}

View file

@ -0,0 +1,10 @@
package dev.zontreck.ase.commands;
import io.papermc.paper.command.brigadier.Commands;
public class CommandRegistry {
public static void register(Commands cmds) {
cmds.register(Commands.literal("homes").requires(x -> x.getSender().hasPermission(HomesCommand.PERMISSION))
.executes(ctx -> HomesCommand.execute(ctx)).build());
}
}

View file

@ -0,0 +1,15 @@
package dev.zontreck.ase.commands;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.command.brigadier.CommandSourceStack;
public class HomesCommand {
public static final String PERMISSION = "ase.commands.homes";
public static int execute(CommandContext<CommandSourceStack> ctx) {
ctx.getSource().getSender().sendMessage("TEST MESSAGE");
return Command.SINGLE_SUCCESS;
}
}

View file

@ -0,0 +1,6 @@
package dev.zontreck.ase.homes;
public class Home {
String homeName;
}