Moved registry unfreeze

This commit is contained in:
OakLoaf
2024-11-01 12:02:49 +00:00
parent 3cd6aead64
commit a385a43250
@@ -66,8 +66,6 @@ public class AwfulBukkitHacks {
} }
})); }));
Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry<?>) biomeRegistry, true); // freeze registry again :)
LOGGER.info("Doing tag garbage...."); LOGGER.info("Doing tag garbage....");
Map<TagKey<Biome>, List<Holder<Biome>>> collect = biomeRegistry Map<TagKey<Biome>, List<Holder<Biome>>> collect = biomeRegistry
.getTags() // streamKeysAndEntries .getTags() // streamKeysAndEntries
@@ -97,6 +95,8 @@ public class AwfulBukkitHacks {
biomeRegistry.bindAllTagsToEmpty(); biomeRegistry.bindAllTagsToEmpty();
ImmutableMap.copyOf(collect).forEach(biomeRegistry::bindTag); ImmutableMap.copyOf(collect).forEach(biomeRegistry::bindTag);
Reflection.MAPPED_REGISTRY.setFrozen(biomeRegistry, true); // freeze registry again :)
} catch(SecurityException | IllegalArgumentException exception) { } catch(SecurityException | IllegalArgumentException exception) {
throw new RuntimeException(exception); throw new RuntimeException(exception);
} }