mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 18:42: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);
|
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);
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -1 +1,4 @@
|
|||||||
debug: false
|
debug: false
|
||||||
|
data-save: PT6M
|
||||||
|
master-disable:
|
||||||
|
caves: false
|
Loading…
x
Reference in New Issue
Block a user