diff --git a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeCarverConfig.java b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeCarverConfig.java index e60925b1d..6445a9de4 100644 --- a/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeCarverConfig.java +++ b/src/main/java/com/dfsek/terra/config/genconfig/biome/BiomeCarverConfig.java @@ -6,38 +6,33 @@ import com.dfsek.terra.config.TerraConfigSection; import com.dfsek.terra.config.exception.ConfigException; import com.dfsek.terra.config.exception.NotFoundException; import com.dfsek.terra.config.genconfig.CarverConfig; -import org.bukkit.Bukkit; -import org.bukkit.block.data.BlockData; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; -import org.polydev.gaea.math.ProbabilityCollection; -import org.polydev.gaea.world.palette.Palette; -import org.polydev.gaea.world.palette.RandomPalette; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.Random; -import java.util.TreeMap; public class BiomeCarverConfig extends TerraConfigSection { private final Map carvers = new HashMap<>(); - @SuppressWarnings("unchecked") public BiomeCarverConfig(TerraConfig parent) throws InvalidConfigurationException { super(parent); - List> cfg = parent.getMapList("carving"); + ConfigurationSection configurationSection = parent.getConfigurationSection("carving"); + + Map cfg; + if(configurationSection != null) { + cfg = configurationSection.getValues(false); + } else return; if(cfg.size() == 0) return; - for(Map e : cfg) { - for(Map.Entry entry : e.entrySet()) { - try { - CarverConfig c = parent.getConfig().getCarver((String) entry.getKey()); - if(c == null) throw new NotFoundException("Carver", (String) entry.getKey(), parent.getID()); - Debug.info("Got carver " + c + ". Adding with weight " + entry.getValue()); - carvers.put(c, (Integer) entry.getValue()); - } catch(ClassCastException ex) { - throw new ConfigException("Unable to parse Carver configuration! Check YAML syntax.", parent.getID()); - } catch(NullPointerException ex) { - throw new NotFoundException("carver", (String) entry.getKey(), parent.getID()); - } + for(Map.Entry entry : cfg.entrySet()) { + try { + CarverConfig c = parent.getConfig().getCarver(entry.getKey()); + if(c == null) throw new NotFoundException("Carver", entry.getKey(), parent.getID()); + Debug.info("Got carver " + c + ". Adding with weight " + entry.getValue()); + carvers.put(c, (Integer) entry.getValue()); + } catch(ClassCastException ex) { + throw new ConfigException("Unable to parse Carver configuration! Check YAML syntax.", parent.getID()); + } catch(NullPointerException ex) { + throw new NotFoundException("carver", entry.getKey(), parent.getID()); } } } diff --git a/src/main/resources/default-config/pack.yml b/src/main/resources/default-config/pack.yml index 05d9fcd46..eff23ffc6 100644 --- a/src/main/resources/default-config/pack.yml +++ b/src/main/resources/default-config/pack.yml @@ -59,8 +59,9 @@ blend: erode: enable: true frequency: 0.005 - threshold: 0.1 + threshold: 0.001 + octaves: 4 grid: "BIOME:RIVER" noise: - octaves: 5 - frequency: 0.0075 \ No newline at end of file + octaves: 4 + frequency: 0.01 \ No newline at end of file