Update Bungee version check, create logger earlier (#4697)

* use the logger where possible instead of system.out.print

* make loggers final

* yeet unused constructors

* velocity is more complicated
This commit is contained in:
chris 2024-05-28 17:23:19 +02:00 committed by GitHub
parent fe63665d88
commit 0fcf0f9b4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 67 additions and 83 deletions

View file

@ -766,6 +766,7 @@ public class GeyserImpl implements GeyserApi {
return 0;
}
//noinspection DataFlowIssue
return Integer.parseInt(BUILD_NUMBER);
}

View file

@ -148,9 +148,9 @@ public class GeyserLocale {
} catch (IOException ignored) {}
}
} else {
if (GeyserImpl.getInstance() != null && !validLocalLanguage) {
if (!validLocalLanguage) {
// Don't warn on missing locales if a local file has been found
GeyserImpl.getInstance().getLogger().warning("Missing locale: " + locale);
bootstrap.getGeyserLogger().warning("Missing locale: " + locale);
}
}
@ -162,12 +162,7 @@ public class GeyserLocale {
localeProp.load(stream);
} catch (IOException e) {
String message = "Unable to load custom language override!";
if (GeyserImpl.getInstance() != null) {
GeyserImpl.getInstance().getLogger().error(message, e);
} else {
System.err.println(message);
e.printStackTrace();
}
bootstrap.getGeyserLogger().error(message, e);
}
LOCALE_MAPPINGS.putIfAbsent(locale, localeProp);