From 05ed35e0ef5f4cb17ccc0f8480b92deb26c9fe01 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Sat, 25 Nov 2023 10:35:51 -0600 Subject: [PATCH] console reload support --- src/main/java/one/oth3r/sit/SitCommand.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/one/oth3r/sit/SitCommand.java b/src/main/java/one/oth3r/sit/SitCommand.java index 8d59a80..88d8d2e 100644 --- a/src/main/java/one/oth3r/sit/SitCommand.java +++ b/src/main/java/one/oth3r/sit/SitCommand.java @@ -36,7 +36,6 @@ public class SitCommand { } private static int command(ServerCommandSource source, String arg) { ServerPlayerEntity player = source.getPlayer(); - if (player == null) return 1; //trim all the arguments before the command String keyword = "sit"; int index = Integer.MAX_VALUE; @@ -46,6 +45,14 @@ public class SitCommand { String[] args = arg.split(" "); if (args[0].equalsIgnoreCase("sit")) args = arg.replaceFirst("sit ", "").split(" "); + // if console + if (player == null) { + if (args[0].equalsIgnoreCase("reload")) { + config.load(); + Sit.LOGGER.info(Sit.lang("key.sit.command.reloaded").getString()); + } + return 1; + } if (args[0].equalsIgnoreCase("sit")) { BlockPos pos = player.getBlockPos(); if (!(player.getY() -((int) player.getY()) > 0.00)) {