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

This commit is contained in:
Frank 2023-05-16 14:51:31 +02:00
parent 6f80069627
commit 7c1775f443

View file

@ -41,9 +41,12 @@ public class WorldBootstrap {
return LAST_REGISTRY_ACCESS; return LAST_REGISTRY_ACCESS;
} }
private static byte WARN_COUNT_GLOBAL_REGISTRY = 0;
public static RegistryAccess getLastRegistryAccessOrElseBuiltin() { 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!"); WorldsTogether.LOGGER.error("Tried to read from global registry!");
WARN_COUNT_GLOBAL_REGISTRY++;
} }
return LAST_REGISTRY_ACCESS; return LAST_REGISTRY_ACCESS;
} }