mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 10:32:30 +00:00
Add null checking for carvers, update carver config directory, update config.yml
This commit is contained in:
parent
d91f5b03d0
commit
951a09e706
@ -66,7 +66,7 @@ public class TerraConfig extends YamlConfiguration {
|
||||
|
||||
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);
|
||||
|
||||
|
@ -46,12 +46,8 @@ public final class ConfigUtil {
|
||||
|
||||
TerraConfig.loadAll(main);
|
||||
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 {
|
||||
Set<Material> bl = new HashSet<>();
|
||||
for(String s : list) {
|
||||
|
@ -136,6 +136,7 @@ public class BiomeConfig extends TerraConfigObject {
|
||||
for(Map.Entry<?, ?> entry : e.entrySet()) {
|
||||
try {
|
||||
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());
|
||||
carvers.put(c, (Integer) entry.getValue());
|
||||
} catch(ClassCastException ex) {
|
||||
|
@ -1 +1,4 @@
|
||||
debug: false
|
||||
data-save: PT6M
|
||||
master-disable:
|
||||
caves: false
|
Loading…
x
Reference in New Issue
Block a user