Adds debug output and a new working position
All checks were successful
KnarCraft/BlacksmithVisuals/pipeline/head This commit looks good
All checks were successful
KnarCraft/BlacksmithVisuals/pipeline/head This commit looks good
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user