Begin to implement
This commit is contained in:
parent
4512d2f728
commit
3b2712151a
5 changed files with 65 additions and 6 deletions
17
src/main/java/dev/zontreck/ase/Bootstrapper.java
Normal file
17
src/main/java/dev/zontreck/ase/Bootstrapper.java
Normal 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());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
10
src/main/java/dev/zontreck/ase/commands/CommandRegistry.java
Normal file
10
src/main/java/dev/zontreck/ase/commands/CommandRegistry.java
Normal 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());
|
||||
}
|
||||
}
|
15
src/main/java/dev/zontreck/ase/commands/HomesCommand.java
Normal file
15
src/main/java/dev/zontreck/ase/commands/HomesCommand.java
Normal 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;
|
||||
}
|
||||
}
|
6
src/main/java/dev/zontreck/ase/homes/Home.java
Normal file
6
src/main/java/dev/zontreck/ase/homes/Home.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dev.zontreck.ase.homes;
|
||||
|
||||
public class Home {
|
||||
String homeName;
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue