From 563d17d53b3fb967108de939870685161d2fa41c Mon Sep 17 00:00:00 2001 From: Len <40720638+destro174@users.noreply.github.com> Date: Wed, 14 Aug 2024 20:46:24 +0200 Subject: [PATCH] Use plugin logger. --- .../com/alttd/essentia/configuration/Config.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/com/alttd/essentia/configuration/Config.java b/plugin/src/main/java/com/alttd/essentia/configuration/Config.java index 8ae6d08..c270677 100755 --- a/plugin/src/main/java/com/alttd/essentia/configuration/Config.java +++ b/plugin/src/main/java/com/alttd/essentia/configuration/Config.java @@ -35,7 +35,7 @@ public class Config { config.load(CONFIG_FILE); } catch (IOException ignore) { } catch (InvalidConfigurationException ex) { - Bukkit.getLogger().log(Level.SEVERE, "Could not load config.yml, please correct your syntax errors", ex); + EssentiaPlugin.instance().getLogger().log(Level.SEVERE, "Could not load config.yml, please correct your syntax errors", ex); Throwables.throwIfUnchecked(ex); } config.options().header(HEADER); @@ -44,6 +44,7 @@ public class Config { version = getInt("config-version", 1); set("config-version", 1); + EssentiaPlugin.instance().getLogger().info("Essentia Configuration loaded!"); readConfig(Config.class, null); } @@ -57,7 +58,7 @@ public class Config { } catch (InvocationTargetException ex) { Throwables.throwIfUnchecked(ex); } catch (Exception ex) { - Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex); + EssentiaPlugin.instance().getLogger().log(Level.SEVERE, "Error invoking " + method, ex); } } } @@ -69,7 +70,7 @@ public class Config { try { config.save(CONFIG_FILE); } catch (IOException ex) { - Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex); + EssentiaPlugin.instance().getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex); } } @@ -104,7 +105,7 @@ public class Config { } protected static void log(Level level, String s) { - Bukkit.getLogger().log(level, s); + EssentiaPlugin.instance().getLogger().log(level, s); } public static int TELEPORT_REQUEST_TIMEOUT = 30; @@ -171,6 +172,9 @@ public class Config { public static String TOGGLED_FLIGHT_BY_OTHER = "Toggled flight on ."; public static String TOGGLED_FLIGHT_PLAYER = " toggled flight ."; public static String TOGGLED_FLIGHT = "Toggled fly ."; + public static String TOGGLED_GOD_BY_OTHER = "Toggled God mode on ."; + public static String TOGGLED_GOD_PLAYER = " toggled God mode ."; + public static String TOGGLED_GOD = "Toggled God mode ."; public static String NO_BACK_LOCATION = "No back location found!"; public static String TELEPORTING_BACK = "Teleporting back to previous location."; public static String NO_DEATH_LOCATION = "No death location found!"; @@ -191,6 +195,10 @@ public class Config { public static String BURN_SELF = "You have set yourself on fire."; public static String BURN_OTHER = "'s has been set in fire."; public static String BURN_BY_OTHER = " has set you on fire."; + + public static String SMITE_SELF = "You have smited yourself."; + public static String SMITE_OTHER = " has been smited."; + public static String SMITE_BY_OTHER = " has smited you."; private static void messages() { REQUEST_TIMED_OUT = getString("messages.request.time-out", REQUEST_TIMED_OUT); TELEPORT_ACCEPT_TARGET = getString("messages.request.teleport-accept-target", TELEPORT_ACCEPT_TARGET);