mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 05:50:08 +00:00
Merge pull request #215 from PolyhedralDev/dev/multi-inheritance
Implement multi-inheritance in configs
This commit is contained in:
4 files changed
+17
-12
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import com.dfsek.terra.getGitHash
|
import com.dfsek.terra.getGitHash
|
||||||
|
|
||||||
val versionObj = Version("5", "3", "3", true)
|
val versionObj = Version("5", "4", "0", true)
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
version = versionObj
|
version = versionObj
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ dependencies {
|
|||||||
"shadedApi"("commons-io:commons-io:2.4")
|
"shadedApi"("commons-io:commons-io:2.4")
|
||||||
|
|
||||||
"shadedApi"("com.dfsek:Paralithic:0.3.2")
|
"shadedApi"("com.dfsek:Paralithic:0.3.2")
|
||||||
"shadedApi"("com.dfsek:Tectonic:1.3.1")
|
"shadedApi"("com.dfsek:Tectonic:1.4.0")
|
||||||
"shadedApi"("net.jafama:jafama:2.3.2")
|
"shadedApi"("net.jafama:jafama:2.3.2")
|
||||||
"shadedApi"("org.yaml:snakeyaml:1.27")
|
"shadedApi"("org.yaml:snakeyaml:1.27")
|
||||||
"shadedApi"("org.ow2.asm:asm:9.0")
|
"shadedApi"("org.ow2.asm:asm:9.0")
|
||||||
|
|||||||
@@ -29,19 +29,24 @@ public class BiomeInfoCommand implements CommandTemplate {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(CommandSender sender) {
|
public void execute(CommandSender sender) {
|
||||||
|
|
||||||
sender.sendMessage("Biome info for \"" + biome.getID() + "\".");
|
sender.sendMessage("Biome info for \"" + biome.getID() + "\".");
|
||||||
sender.sendMessage("Vanilla biome: " + biome.getVanillaBiomes());
|
sender.sendMessage("Vanilla biome: " + biome.getVanillaBiomes());
|
||||||
|
|
||||||
if(biome instanceof UserDefinedBiome) {
|
if(biome instanceof UserDefinedBiome) {
|
||||||
BiomeTemplate bio = ((UserDefinedBiome) biome).getConfig();
|
BiomeTemplate bio = ((UserDefinedBiome) biome).getConfig();
|
||||||
|
|
||||||
if(bio.getExtend() != null) sender.sendMessage("Extends: " + bio.getExtend());
|
if(bio.getExtended().size() == 0) {
|
||||||
|
sender.sendMessage("No Parent Biomes");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("------Parent Biomes-----");
|
||||||
|
bio.getExtended().forEach(id -> sender.sendMessage(" - " + id));
|
||||||
|
}
|
||||||
|
|
||||||
List<TerraStructure> structureConfigs = bio.getStructures();
|
List<TerraStructure> structureConfigs = bio.getStructures();
|
||||||
|
|
||||||
if(structureConfigs.size() == 0) sender.sendMessage("No Structures");
|
if(structureConfigs.size() == 0) {
|
||||||
else {
|
sender.sendMessage("No Structures");
|
||||||
|
} else {
|
||||||
sender.sendMessage("-------Structures-------");
|
sender.sendMessage("-------Structures-------");
|
||||||
for(TerraStructure c : structureConfigs) {
|
for(TerraStructure c : structureConfigs) {
|
||||||
sender.sendMessage(" - " + c.getTemplate().getID());
|
sender.sendMessage(" - " + c.getTemplate().getID());
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.dfsek.terra.world.population.items.flora.FloraLayer;
|
|||||||
import com.dfsek.terra.world.population.items.ores.OreHolder;
|
import com.dfsek.terra.world.population.items.ores.OreHolder;
|
||||||
import com.dfsek.terra.world.population.items.tree.TreeLayer;
|
import com.dfsek.terra.world.population.items.tree.TreeLayer;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -39,7 +40,6 @@ import java.util.Set;
|
|||||||
|
|
||||||
@SuppressWarnings({"FieldMayBeFinal", "unused"})
|
@SuppressWarnings({"FieldMayBeFinal", "unused"})
|
||||||
public class BiomeTemplate extends AbstractableTemplate implements ValidatedConfigTemplate {
|
public class BiomeTemplate extends AbstractableTemplate implements ValidatedConfigTemplate {
|
||||||
|
|
||||||
private final ConfigPack pack;
|
private final ConfigPack pack;
|
||||||
|
|
||||||
@Value("id")
|
@Value("id")
|
||||||
@@ -47,7 +47,7 @@ public class BiomeTemplate extends AbstractableTemplate implements ValidatedConf
|
|||||||
|
|
||||||
@Value("extends")
|
@Value("extends")
|
||||||
@Default
|
@Default
|
||||||
private String extend = null;
|
private List<String> extended = Collections.emptyList();
|
||||||
|
|
||||||
@Value("variables")
|
@Value("variables")
|
||||||
@Abstractable
|
@Abstractable
|
||||||
@@ -195,6 +195,10 @@ public class BiomeTemplate extends AbstractableTemplate implements ValidatedConf
|
|||||||
@Default
|
@Default
|
||||||
private Map<String, Integer> colors = new HashMap<>(); // Plain ol' map, so platforms can decide what to do with colors (if anything).
|
private Map<String, Integer> colors = new HashMap<>(); // Plain ol' map, so platforms can decide what to do with colors (if anything).
|
||||||
|
|
||||||
|
public List<String> getExtended() {
|
||||||
|
return extended;
|
||||||
|
}
|
||||||
|
|
||||||
public Set<String> getTags() {
|
public Set<String> getTags() {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@@ -227,10 +231,6 @@ public class BiomeTemplate extends AbstractableTemplate implements ValidatedConf
|
|||||||
return interpolateElevation;
|
return interpolateElevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExtend() {
|
|
||||||
return extend;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getSlantThreshold() {
|
public double getSlantThreshold() {
|
||||||
return slantThreshold;
|
return slantThreshold;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user