mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 23:01:03 +00:00
begin tectonic update process
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ public class BiomeConfigType implements ConfigType<BiomeTemplate, BiomeBuilder>
|
||||
if(c.equals("SELF")) return null;
|
||||
BiomeBuilder obj = registry.get((String) c);
|
||||
if(obj == null)
|
||||
throw new LoadException("No such " + t.getTypeName() + " matching \"" + c + "\" was found in this registry.");
|
||||
throw new LoadException("No such " + t.getType().getTypeName() + " matching \"" + c + "\" was found in this registry.");
|
||||
return obj;
|
||||
});
|
||||
}
|
||||
|
||||
+4
-27
@@ -2,8 +2,8 @@ package com.dfsek.terra.addons.biome;
|
||||
|
||||
import com.dfsek.paralithic.eval.parser.Parser;
|
||||
import com.dfsek.paralithic.eval.parser.Scope;
|
||||
import com.dfsek.tectonic.annotations.Abstractable;
|
||||
import com.dfsek.tectonic.annotations.Default;
|
||||
import com.dfsek.tectonic.annotations.Final;
|
||||
import com.dfsek.tectonic.annotations.Value;
|
||||
import com.dfsek.tectonic.config.ValidatedConfigTemplate;
|
||||
import com.dfsek.tectonic.exception.ValidationException;
|
||||
@@ -32,139 +32,116 @@ public class BiomeTemplate implements AbstractableTemplate, ValidatedConfigTempl
|
||||
private final ConfigPack pack;
|
||||
|
||||
@Value("id")
|
||||
@Final
|
||||
private String id;
|
||||
|
||||
@Value("extends")
|
||||
@Final
|
||||
@Default
|
||||
private List<String> extended = Collections.emptyList();
|
||||
|
||||
@Value("variables")
|
||||
@Abstractable
|
||||
@Default
|
||||
private Map<String, Double> variables = new HashMap<>();
|
||||
|
||||
@Value("beta.carving.equation")
|
||||
@Abstractable
|
||||
@Default
|
||||
private NoiseSeeded carvingEquation = NoiseSeeded.zero(3);
|
||||
|
||||
@Value("palette")
|
||||
@Abstractable
|
||||
private PaletteHolder palette;
|
||||
|
||||
@Value("slant")
|
||||
@Abstractable
|
||||
@Default
|
||||
private SlantHolder slant = null;
|
||||
|
||||
@Value("vanilla")
|
||||
@Abstractable
|
||||
private ProbabilityCollection<Biome> vanilla;
|
||||
|
||||
@Value("biome-noise")
|
||||
@Default
|
||||
@Abstractable
|
||||
private NoiseSeeded biomeNoise = NoiseSeeded.zero(2);
|
||||
|
||||
@Value("blend.distance")
|
||||
@Abstractable
|
||||
@Default
|
||||
private int blendDistance = 3;
|
||||
|
||||
@Value("blend.weight")
|
||||
@Abstractable
|
||||
@Default
|
||||
private double blendWeight = 1;
|
||||
|
||||
@Value("blend.step")
|
||||
@Abstractable
|
||||
@Default
|
||||
private int blendStep = 4;
|
||||
|
||||
@Value("structures")
|
||||
@Abstractable
|
||||
@Default
|
||||
private List<ConfiguredStructure> structures = new ArrayList<>();
|
||||
|
||||
@Value("noise")
|
||||
@Abstractable
|
||||
private NoiseSeeded noiseEquation;
|
||||
|
||||
/*@Value("ores")
|
||||
@Abstractable
|
||||
@Default
|
||||
private OreHolder oreHolder = new OreHolder();*/
|
||||
|
||||
@Value("ocean.level")
|
||||
@Abstractable
|
||||
@Default
|
||||
private int seaLevel = 62;
|
||||
|
||||
@Value("ocean.palette")
|
||||
@Abstractable
|
||||
private Palette oceanPalette;
|
||||
|
||||
@Value("elevation.equation")
|
||||
@Default
|
||||
@Abstractable
|
||||
private NoiseSeeded elevationEquation = NoiseSeeded.zero(2);
|
||||
|
||||
@Value("elevation.weight")
|
||||
@Default
|
||||
@Abstractable
|
||||
private double elevationWeight = 1;
|
||||
|
||||
/*@Value("flora")
|
||||
@Abstractable
|
||||
@Default
|
||||
private List<FloraLayer> flora = new ArrayList<>();
|
||||
|
||||
@Value("trees")
|
||||
@Abstractable
|
||||
@Default
|
||||
private List<TreeLayer> trees = new ArrayList<>();*/
|
||||
|
||||
@Value("slabs.enable")
|
||||
@Abstractable
|
||||
@Default
|
||||
private boolean doSlabs = false;
|
||||
|
||||
@Value("slabs.threshold")
|
||||
@Abstractable
|
||||
@Default
|
||||
private double slabThreshold = 0.0075D;
|
||||
|
||||
@Value("slabs.palettes")
|
||||
@Abstractable
|
||||
@Default
|
||||
private Map<BlockType, Palette> slabPalettes;
|
||||
|
||||
@Value("slabs.stair-palettes")
|
||||
@Abstractable
|
||||
@Default
|
||||
private Map<BlockType, Palette> stairPalettes;
|
||||
|
||||
@Value("interpolate-elevation")
|
||||
@Abstractable
|
||||
@Default
|
||||
private boolean interpolateElevation = true;
|
||||
|
||||
@Value("color")
|
||||
@Final
|
||||
@Default
|
||||
private int color = 0;
|
||||
|
||||
@Value("tags")
|
||||
@Default
|
||||
@Abstractable
|
||||
private Set<String> tags = new HashSet<>();
|
||||
|
||||
/*@Value("carving")
|
||||
@Abstractable
|
||||
@Default
|
||||
private Map<UserDefinedCarver, Integer> carvers = new HashMap<>();*/
|
||||
|
||||
@Value("colors")
|
||||
@Abstractable
|
||||
@Default
|
||||
private Map<String, Integer> colors = new HashMap<>(); // Plain ol' map, so platforms can decide what to do with colors (if anything).
|
||||
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ import com.dfsek.tectonic.loading.ConfigLoader;
|
||||
import com.dfsek.tectonic.loading.TypeLoader;
|
||||
import com.dfsek.terra.api.world.generator.Palette;
|
||||
|
||||
import java.lang.reflect.AnnotatedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -12,12 +13,12 @@ import java.util.Map;
|
||||
public class PaletteHolderLoader implements TypeLoader<PaletteHolder> {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public PaletteHolder load(Type type, Object o, ConfigLoader configLoader) throws LoadException {
|
||||
public PaletteHolder load(AnnotatedType type, Object o, ConfigLoader configLoader) throws LoadException {
|
||||
List<Map<String, Integer>> palette = (List<Map<String, Integer>>) o;
|
||||
PaletteHolderBuilder builder = new PaletteHolderBuilder();
|
||||
for(Map<String, Integer> layer : palette) {
|
||||
for(Map.Entry<String, Integer> entry : layer.entrySet()) {
|
||||
builder.add(entry.getValue(), (Palette) configLoader.loadType(Palette.class, entry.getKey()));
|
||||
builder.add(entry.getValue(), configLoader.loadType(Palette.class, entry.getKey()));
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
|
||||
Reference in New Issue
Block a user