From d19f10b099e553ce272a9c3af0c0f150b6e80a83 Mon Sep 17 00:00:00 2001 From: Frog-That-code Date: Sat, 8 Jun 2024 20:35:44 -0400 Subject: added the EPHS and command and register associated with it --- src/main/java/los/numeros/command/EPHSCommand.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/los/numeros/command/EPHSCommand.java (limited to 'src/main/java/los/numeros/command') diff --git a/src/main/java/los/numeros/command/EPHSCommand.java b/src/main/java/los/numeros/command/EPHSCommand.java new file mode 100644 index 0000000..f5b44d0 --- /dev/null +++ b/src/main/java/los/numeros/command/EPHSCommand.java @@ -0,0 +1,30 @@ +package los.numeros.command; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; + +import los.numeros.EPHS.Main; +import net.minecraft.server.command.CommandManager; +import net.minecraft.server.command.ServerCommandSource; + +public class EPHSCommand { + public static void + register(CommandDispatcher dispatcher, boolean dedicated) + { + dispatcher.register(CommandManager.literal("epsh") + .then(CommandManager.literal("start").executes(EPHSCommand::run))); + } + + public static int + run(CommandContext ctx) throws CommandSyntaxException + { + /* get the minecraft server object */ + ServerCommandSource source = ctx.getSource(); + + /* pass in the minecraft server object and start it */ + new Main(source, 1); + + return 0; + } +} -- cgit v1.2.1