Adds debug output and a new working position
All checks were successful
KnarCraft/BlacksmithVisuals/pipeline/head This commit looks good

This commit is contained in:
2024-11-27 12:20:01 +01:00
parent 9b04dd042e
commit b094d34c62
5 changed files with 22 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ public final class BlacksmithVisuals extends JavaPlugin {
private static BlacksmithVisuals instance;
private ConfigurationManager configurationManager;
private NPCDataManager npcDataManager;
private boolean debug = false;
@Override
public void onEnable() {
@@ -35,6 +36,8 @@ public final class BlacksmithVisuals extends JavaPlugin {
this.reloadConfig();
this.saveConfig();
this.debug = this.getConfig().getBoolean("debug", false);
try {
this.configurationManager = new ConfigurationManager(this.getConfig());
} catch (InvalidConfigurationException exception) {
@@ -68,7 +71,12 @@ public final class BlacksmithVisuals extends JavaPlugin {
* @param message <p>The debug message to log</p>
*/
public static void debug(@NotNull String message) {
getInstance().getLogger().log(Level.FINE, message);
BlacksmithVisuals instance = getInstance();
if (instance.debug) {
instance.getLogger().log(Level.INFO, "[Debug] " + message);
} else {
instance.getLogger().log(Level.FINE, message);
}
}
/**