From 26f635293a50a498ff69762afe4aa8e10fca419e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czopek?= <44530932+Grabsky@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:15:03 +0100 Subject: [PATCH] re-add missing check for `register_commands` option --- src/main/java/de/oliver/fancynpcs/FancyNpcs.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/oliver/fancynpcs/FancyNpcs.java b/src/main/java/de/oliver/fancynpcs/FancyNpcs.java index cf25d32a..40359f45 100644 --- a/src/main/java/de/oliver/fancynpcs/FancyNpcs.java +++ b/src/main/java/de/oliver/fancynpcs/FancyNpcs.java @@ -297,10 +297,14 @@ Please update to the newest version (%s). // Creating new instance of CloudCommandManager and registering all needed components. // NOTE: Brigadier is disabled by default. More detailed information about that can be found in CloudCommandManager class. - commandManager = new CloudCommandManager(this, false) - .registerArguments() - .registerExceptionHandlers() - .registerCommands(); + if (config.isRegisterCommands()) { + commandManager = new CloudCommandManager(this, false) + .registerArguments() + .registerExceptionHandlers() + .registerCommands(); + } else { + getLogger().warning("Commands and related components have not been registered. This can be changed by setting 'register_commands' to true, and restarting the server."); + } fancyLogger.info("FancyNpcs (" + versionConfig.getVersion() + ") has been enabled."); }