fix/suppress warnings

This commit is contained in:
dfsek 2021-07-17 21:59:48 -07:00
parent bc96006c4b
commit a2dac6dfca
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ public class FeatureGenerationStage implements TerraGenerationStage {
} }
@Override @Override
@SuppressWarnings("try")
public void populate(World world, Chunk chunk) { public void populate(World world, Chunk chunk) {
TerraWorld terraWorld = main.getWorld(world); TerraWorld terraWorld = main.getWorld(world);
try(ProfileFrame ignore = main.getProfiler().profile("feature")) { try(ProfileFrame ignore = main.getProfiler().profile("feature")) {

View File

@ -189,11 +189,11 @@ public class ConfigPackImpl implements ConfigPack {
toWorldConfig(new TerraWorldImpl(new DummyWorld(), this, main)); // Build now to catch any errors immediately. toWorldConfig(new TerraWorldImpl(new DummyWorld(), this, main)); // Build now to catch any errors immediately.
} }
@SuppressWarnings("unchecked")
private ConfigTypeRegistry createRegistry() { private ConfigTypeRegistry createRegistry() {
return new ConfigTypeRegistry(main, (id, configType) -> { return new ConfigTypeRegistry(main, (id, configType) -> {
OpenRegistry<?> openRegistry = configType.registrySupplier().get(); OpenRegistry<?> openRegistry = configType.registrySupplier().get();
if(registryMap.containsKey(configType.getTypeClass())) { // Someone already registered something; we need to copy things to the new registry. if(registryMap.containsKey(configType.getTypeClass())) { // Someone already registered something; we need to copy things to the new registry.
//noinspection unchecked
registryMap.get(configType.getTypeClass()).getLeft().forEach(((OpenRegistry<Object>) openRegistry)::register); registryMap.get(configType.getTypeClass()).getLeft().forEach(((OpenRegistry<Object>) openRegistry)::register);
} }
selfLoader.registerLoader(configType.getTypeClass(), openRegistry); selfLoader.registerLoader(configType.getTypeClass(), openRegistry);