dont use pack instance where unneeded

This commit is contained in:
dfsek
2021-07-20 15:12:06 -07:00
parent d807abb165
commit 0ff6a9cce1
10 changed files with 11 additions and 29 deletions
@@ -13,13 +13,11 @@ import com.dfsek.terra.api.world.biome.TerraBiome;
import java.util.function.Supplier;
public class BiomeConfigType implements ConfigType<BiomeTemplate, TerraBiome> {
private final ConfigPack pack;
private final BiomeFactory factory;
public static final TypeKey<TerraBiome> BIOME_TYPE_TOKEN = new TypeKey<>() {};
public BiomeConfigType(ConfigPack pack) {
this.pack = pack;
this.factory = new BiomeFactory(pack);
}
@@ -40,7 +38,7 @@ public class BiomeConfigType implements ConfigType<BiomeTemplate, TerraBiome> {
@Override
public Supplier<OpenRegistry<TerraBiome>> registrySupplier(ConfigPack pack) {
return () -> this.pack.getRegistryFactory().create(registry -> (TypeLoader<TerraBiome>) (t, c, loader) -> {
return () -> pack.getRegistryFactory().create(registry -> (TypeLoader<TerraBiome>) (t, c, loader) -> {
if(c.equals("SELF")) return null;
TerraBiome obj = registry.get((String) c);
if(obj == null)