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