Cleans up message logging quite a bit

Adds methods to Stargate for easier logging and less redundancy
Loads the language loader in two parts to make it available while loading
Adds a translated string to the reload-message
Uses String.format to make long messages more readable
Makes it possible to get strings directly from the backup language to make debugging easier
This commit is contained in:
2021-10-26 15:05:05 +02:00
parent eaf7596014
commit 1c906528f2
22 changed files with 154 additions and 118 deletions

View File

@ -4,8 +4,6 @@ import net.knarcraft.stargate.Stargate;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import static net.knarcraft.stargate.Stargate.getString;
/**
* The Stargate gate config keeps track of all global config values related to gates
*/
@ -181,8 +179,7 @@ public final class StargateGateConfig {
} catch (IllegalArgumentException | NullPointerException ignored) {
}
}
Stargate.getConsoleLogger().warning(getString("prefix") +
"You have specified an invalid color in your config.yml. Defaulting to BLACK");
Stargate.logWarning("You have specified an invalid color in your config.yml. Defaulting to BLACK");
this.signColor = ChatColor.BLACK;
}