use fancy new tectonic stuff for biome stage loading

This commit is contained in:
dfsek
2021-01-30 15:23:29 -07:00
parent b99fabcf1d
commit 762c3064d9
17 changed files with 222 additions and 112 deletions

View File

@@ -1,6 +1,18 @@
package com.dfsek.terra.registry;
import com.dfsek.tectonic.exception.LoadException;
import com.dfsek.tectonic.loading.ConfigLoader;
import com.dfsek.terra.biome.TerraBiome;
import java.lang.reflect.Type;
public class BiomeRegistry extends TerraRegistry<TerraBiome> {
@Override
public TerraBiome load(Type type, Object o, ConfigLoader configLoader) throws LoadException {
if(o.equals("SELF")) return null;
TerraBiome biome = get((String) o);
if(biome == null)
throw new LoadException("No such " + type.getTypeName() + " matching \"" + o + "\" was found in this registry.");
return biome;
}
}