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;
}

View file

@ -5,13 +5,24 @@ api-version: "1.21.1"
author: AUTHOR
description: DESCRIPTION
commands:
ex:
description: Base command for EXAMPLE
usage: "For a list of commands, type /ex help"
aliases: example
home:
description: Just click your heels three times.
usage: "- /home [optional:name] -"
homes:
description: Lists all homes
usage: "- /homes -"
permissions:
example.test:
description: DESCRIPTION
ase.commands.*:
description: Allow all commands
default: false
children:
ase.commands.home: true
ase.commands.homes: true
ase.commands.home:
description: Allows usage of the /home command
default: true
ase.commands.homes:
description: Allows usage of the /homes command
default: true
example.*:
description: Grants all other permissions