Use plugin logger.

This commit is contained in:
Len 2024-08-14 20:46:24 +02:00
parent bd3e537199
commit 563d17d53b

View File

@ -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 <status> on <target>.";
public static String TOGGLED_FLIGHT_PLAYER = "<player> toggled flight <status>.";
public static String TOGGLED_FLIGHT = "Toggled fly <status>.";
public static String TOGGLED_GOD_BY_OTHER = "Toggled God mode <status> on <target>.";
public static String TOGGLED_GOD_PLAYER = "<player> toggled God mode <status>.";
public static String TOGGLED_GOD = "Toggled God mode <status>.";
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 = "<target>'s has been set in fire.";
public static String BURN_BY_OTHER = "<requester> has set you on fire.";
public static String SMITE_SELF = "You have smited yourself.";
public static String SMITE_OTHER = "<target> has been smited.";
public static String SMITE_BY_OTHER = "<requester> 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);