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;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue