SteamWar/SpigotCore
Archiviert
13
0

Improve control flow readability
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-05-24 09:12:43 +02:00
Ursprung 298aa9d3de
Commit 7b3162ece3
2 geänderte Dateien mit 5 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -332,11 +332,7 @@ public class SQLProvider implements Provider {
private SteamwarUser newSteamwarUser(ResultSet rs) throws SQLException {
String dbLocale = rs.getString("Locale");
Locale locale = null;
if (dbLocale != null) {
locale = Locale.forLanguageTag(dbLocale);
}
return new SteamwarUser(rs.getInt("id"), UUID.fromString(rs.getString("UUID")), rs.getString("UserName"), UserGroup.getUsergroup(rs.getString("UserGroup")), rs.getInt("Team"), rs.getBoolean("Bedrock"), locale);
return new SteamwarUser(rs.getInt("id"), UUID.fromString(rs.getString("UUID")), rs.getString("UserName"), UserGroup.getUsergroup(rs.getString("UserGroup")), rs.getInt("Team"), rs.getBoolean("Bedrock"), dbLocale != null ? Locale.forLanguageTag(dbLocale) : null);
}
private static final Statement insert = new Statement("INSERT INTO Exception (server, message, stacktrace) VALUES (?, ?, ?)");

Datei anzeigen

@ -55,7 +55,7 @@ public class SteamwarUser {
private final UserGroup userGroup;
private final int team;
private final boolean bedrock;
private final Locale locale;
private Locale locale;
public SteamwarUser(int id, UUID uuid, String userName, UserGroup userGroup, int team, boolean bedrock, Locale locale) {
this.id = id;
@ -96,9 +96,9 @@ public class SteamwarUser {
}
public Locale getLocale() {
Locale locale = this.locale;
if (locale == null)
locale = WorldOfColorWrapper.impl.getLocale(Bukkit.getPlayer(uuid));
if(locale != null)
return locale;
locale = WorldOfColorWrapper.impl.getLocale(Bukkit.getPlayer(uuid));
if (locale != null)
return locale;
return Locale.getDefault();