mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-09 09:16:34 +00:00
use getCheckedRegistry where possible
This commit is contained in:
@@ -249,7 +249,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
for(ConfigType<?, ?> configType : configTypeRegistry.entries()) {
|
||||
for(AbstractableTemplate config : abstractConfigLoader.loadConfigs(configs.getOrDefault(configType, Collections.emptyList()), () -> configType.getTemplate(this, main))) {
|
||||
try {
|
||||
((CheckedRegistry) getRegistry(configType.getTypeClass())).register(config.getID(), ((ConfigFactory) configType.getFactory()).build(config, main));
|
||||
((CheckedRegistry) getCheckedRegistry(configType.getTypeClass())).register(config.getID(), ((ConfigFactory) configType.getFactory()).build(config, main));
|
||||
} catch(DuplicateEntryException e) {
|
||||
throw new LoadException("Duplicate registry entry: ", e);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class WorldConfigImpl implements WorldConfig {
|
||||
pack.getRegistryMap().forEach((clazz, pair) -> registryMap.put(clazz, new LockedRegistryImpl<>(pair.getLeft())));
|
||||
|
||||
OpenRegistry<TerraBiome> biomeOpenRegistry = new OpenRegistryImpl<>();
|
||||
pack.getRegistry(BiomeBuilder.class).forEach((id, biome) -> biomeOpenRegistry.register(id, biome.apply(world.getWorld().getSeed())));
|
||||
pack.getCheckedRegistry(BiomeBuilder.class).forEach((id, biome) -> biomeOpenRegistry.register(id, biome.apply(world.getWorld().getSeed())));
|
||||
registryMap.put(TerraBiome.class, new LockedRegistryImpl<>(biomeOpenRegistry));
|
||||
|
||||
this.provider = pack.getBiomeProviderBuilder().build(world.getWorld().getSeed());
|
||||
|
||||
Reference in New Issue
Block a user