[Change] global registry warning only with verbose logging (#90)

This commit is contained in:
Frank 2023-05-16 14:51:31 +02:00
parent 8a8e73348c
commit 22627f69ac

View file

@ -44,9 +44,12 @@ public class WorldBootstrap {
return LAST_REGISTRY_ACCESS;
}
private static byte WARN_COUNT_GLOBAL_REGISTRY = 0;
public static RegistryAccess getLastRegistryAccessOrElseBuiltin() {
if (LAST_REGISTRY_ACCESS == null) {
if (WARN_COUNT_GLOBAL_REGISTRY < 10 && LAST_REGISTRY_ACCESS == null && Configs.MAIN_CONFIG.verboseLogging()) {
WorldsTogether.LOGGER.error("Tried to read from global registry!");
WARN_COUNT_GLOBAL_REGISTRY++;
}
return LAST_REGISTRY_ACCESS;
}