Add null checking for carvers, update carver config directory, update config.yml

This commit is contained in:
dfsek 2020-10-02 00:55:42 -07:00
parent d91f5b03d0
commit 951a09e706
4 changed files with 6 additions and 6 deletions

View File

@ -66,7 +66,7 @@ public class TerraConfig extends YamlConfiguration {
palettes = ConfigLoader.load(main, new File(file, "palettes").toPath(), this, PaletteConfig.class); palettes = ConfigLoader.load(main, new File(file, "palettes").toPath(), this, PaletteConfig.class);
carvers = ConfigLoader.load(main, new File(file, "carvers").toPath(), this, CarverConfig.class); carvers = ConfigLoader.load(main, new File(file, "carving").toPath(), this, CarverConfig.class);
flora = ConfigLoader.load(main, new File(file, "flora").toPath(), this, FloraConfig.class); flora = ConfigLoader.load(main, new File(file, "flora").toPath(), this, FloraConfig.class);

View File

@ -46,12 +46,8 @@ public final class ConfigUtil {
TerraConfig.loadAll(main); TerraConfig.loadAll(main);
TerraWorld.invalidate(); TerraWorld.invalidate();
TerraWorld.invalidate();
} }
public static <E extends Enum<E>> List<E> getElements(List<String> st, Class<E> clazz) {
return st.stream().map((s) -> E.valueOf(clazz, s)).collect(Collectors.toList());
}
public static Set<Material> toBlockData(List<String> list, String phase, String id) throws InvalidConfigurationException { public static Set<Material> toBlockData(List<String> list, String phase, String id) throws InvalidConfigurationException {
Set<Material> bl = new HashSet<>(); Set<Material> bl = new HashSet<>();
for(String s : list) { for(String s : list) {

View File

@ -136,6 +136,7 @@ public class BiomeConfig extends TerraConfigObject {
for(Map.Entry<?, ?> entry : e.entrySet()) { for(Map.Entry<?, ?> entry : e.entrySet()) {
try { try {
CarverConfig c = getConfig().getCarver((String) entry.getKey()); CarverConfig c = getConfig().getCarver((String) entry.getKey());
if(c == null) throw new NotFoundException("Carver", (String) entry.getKey(), getID());
Debug.info("Got carver " + c + ". Adding with weight " + entry.getValue()); Debug.info("Got carver " + c + ". Adding with weight " + entry.getValue());
carvers.put(c, (Integer) entry.getValue()); carvers.put(c, (Integer) entry.getValue());
} catch(ClassCastException ex) { } catch(ClassCastException ex) {

View File

@ -1 +1,4 @@
debug: false debug: false
data-save: PT6M
master-disable:
caves: false