mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-27 01:41:35 +01:00
Update configurate version
This commit is contained in:
parent
2e1feb228d
commit
4fc9215f4d
@ -149,7 +149,7 @@ public synchronized void save() throws IOException {
|
||||
ConfigurationNode node = loader.createEmptyNode();
|
||||
|
||||
for (MarkerSetImpl set : markerSets.values()) {
|
||||
set.save(node.getNode("markerSets").getAppendedNode());
|
||||
set.save(node.getNode("markerSets").appendListNode());
|
||||
}
|
||||
|
||||
loader.save(node);
|
||||
|
@ -210,7 +210,7 @@ public synchronized void save(ConfigurationNode node) {
|
||||
node.getNode("defaultHide").setValue(this.isDefaultHidden);
|
||||
|
||||
for (MarkerImpl marker : markers.values()) {
|
||||
marker.save(node.getNode("marker").getAppendedNode());
|
||||
marker.save(node.getNode("marker").appendListNode());
|
||||
}
|
||||
|
||||
removedMarkers.clear();
|
||||
|
@ -194,7 +194,7 @@ private static Color readColor(ConfigurationNode node) throws MarkerFileFormatEx
|
||||
|
||||
private static void writeShape(ConfigurationNode node, Shape shape) {
|
||||
for (int i = 0; i < shape.getPointCount(); i++) {
|
||||
ConfigurationNode pointNode = node.getAppendedNode();
|
||||
ConfigurationNode pointNode = node.appendListNode();
|
||||
Vector2d point = shape.getPoint(i);
|
||||
pointNode.getNode("x").setValue(Math.round(point.getX() * 1000d) / 1000d);
|
||||
pointNode.getNode("z").setValue(Math.round(point.getY() * 1000d) / 1000d);
|
||||
|
@ -9,9 +9,9 @@ dependencies {
|
||||
compile 'org.apache.commons:commons-lang3:3.6'
|
||||
compile group: 'commons-io', name: 'commons-io', version: '2.5'
|
||||
compile 'com.flowpowered:flow-math:1.0.3'
|
||||
compile 'ninja.leaping.configurate:configurate-hocon:3.3'
|
||||
compile 'ninja.leaping.configurate:configurate-gson:3.3'
|
||||
compile 'ninja.leaping.configurate:configurate-yaml:3.3'
|
||||
compile 'org.spongepowered:configurate-hocon:3.7.1'
|
||||
compile 'org.spongepowered:configurate-gson:3.7.1'
|
||||
compile 'org.spongepowered:configurate-yaml:3.7.1'
|
||||
compile 'com.github.Querz:NBT:4.0'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
|
@ -222,7 +222,7 @@ public BlockStateResource build(String blockstateFile) throws IOException {
|
||||
private Collection<Weighted<TransformedBlockModelResource>> loadModels(ConfigurationNode node, String blockstateFile, Map<String, String> overrideTextures) {
|
||||
Collection<Weighted<TransformedBlockModelResource>> models = new ArrayList<>();
|
||||
|
||||
if (node.hasListChildren()) {
|
||||
if (node.isList()) {
|
||||
for (ConfigurationNode modelNode : node.getChildrenList()) {
|
||||
try {
|
||||
models.add(loadModel(modelNode, overrideTextures));
|
||||
@ -230,7 +230,7 @@ private Collection<Weighted<TransformedBlockModelResource>> loadModels(Configura
|
||||
Logger.global.logDebug("Failed to load a model trying to parse " + blockstateFile + ": " + ex);
|
||||
}
|
||||
}
|
||||
} else if (node.hasMapChildren()) {
|
||||
} else if (node.isMap()) {
|
||||
try {
|
||||
models.add(loadModel(node, overrideTextures));
|
||||
} catch (ParseResourceException ex) {
|
||||
@ -429,12 +429,12 @@ private BlockStateResource buildForge(ConfigurationNode config, String blockstat
|
||||
}
|
||||
|
||||
private boolean isForgeStraightVariant(ConfigurationNode node) {
|
||||
if (node.hasListChildren())
|
||||
if (node.isList())
|
||||
return true;
|
||||
|
||||
for (Entry<Object, ? extends ConfigurationNode> entry : node.getChildrenMap().entrySet()) {
|
||||
if (entry.getKey().equals(JSON_COMMENT)) continue;
|
||||
if (!entry.getValue().hasMapChildren()) return true;
|
||||
if (!entry.getValue().isMap()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -39,7 +39,7 @@ public class ConfigUtils {
|
||||
private ConfigUtils(){}
|
||||
|
||||
public static Vector2i readVector2i(ConfigurationNode vectorNode){
|
||||
if (vectorNode.hasListChildren()){
|
||||
if (vectorNode.isList()){
|
||||
List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
|
||||
return new Vector2i(
|
||||
list.get(0).getInt(),
|
||||
@ -54,7 +54,7 @@ public static Vector2i readVector2i(ConfigurationNode vectorNode){
|
||||
}
|
||||
|
||||
public static Vector3i readVector3i(ConfigurationNode vectorNode){
|
||||
if (vectorNode.hasListChildren()){
|
||||
if (vectorNode.isList()){
|
||||
List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
|
||||
return new Vector3i(
|
||||
list.get(0).getInt(),
|
||||
@ -71,7 +71,7 @@ public static Vector3i readVector3i(ConfigurationNode vectorNode){
|
||||
}
|
||||
|
||||
public static Vector3f readVector3f(ConfigurationNode vectorNode){
|
||||
if (vectorNode.hasListChildren()){
|
||||
if (vectorNode.isList()){
|
||||
List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
|
||||
return new Vector3f(
|
||||
list.get(0).getFloat(),
|
||||
@ -88,7 +88,7 @@ public static Vector3f readVector3f(ConfigurationNode vectorNode){
|
||||
}
|
||||
|
||||
public static Vector4i readVector4i(ConfigurationNode vectorNode){
|
||||
if (vectorNode.hasListChildren()){
|
||||
if (vectorNode.isList()){
|
||||
List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
|
||||
return new Vector4i(
|
||||
list.get(0).getInt(),
|
||||
@ -107,7 +107,7 @@ public static Vector4i readVector4i(ConfigurationNode vectorNode){
|
||||
}
|
||||
|
||||
public static Vector4f readVector4f(ConfigurationNode vectorNode){
|
||||
if (vectorNode.hasListChildren()){
|
||||
if (vectorNode.isList()){
|
||||
List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
|
||||
return new Vector4f(
|
||||
list.get(0).getFloat(),
|
||||
@ -126,10 +126,10 @@ public static Vector4f readVector4f(ConfigurationNode vectorNode){
|
||||
}
|
||||
|
||||
public static void writeVector4f(ConfigurationNode vectorNode, Vector4f v){
|
||||
vectorNode.getAppendedNode().setValue(v.getX());
|
||||
vectorNode.getAppendedNode().setValue(v.getY());
|
||||
vectorNode.getAppendedNode().setValue(v.getZ());
|
||||
vectorNode.getAppendedNode().setValue(v.getW());
|
||||
vectorNode.appendListNode().setValue(v.getX());
|
||||
vectorNode.appendListNode().setValue(v.getY());
|
||||
vectorNode.appendListNode().setValue(v.getZ());
|
||||
vectorNode.appendListNode().setValue(v.getW());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user