Update configurate version

This commit is contained in:
Blue (Lukas Rieger) 2020-08-30 01:25:10 +02:00
parent 2e1feb228d
commit 4fc9215f4d
6 changed files with 19 additions and 19 deletions

View File

@ -149,7 +149,7 @@ public synchronized void save() throws IOException {
ConfigurationNode node = loader.createEmptyNode(); ConfigurationNode node = loader.createEmptyNode();
for (MarkerSetImpl set : markerSets.values()) { for (MarkerSetImpl set : markerSets.values()) {
set.save(node.getNode("markerSets").getAppendedNode()); set.save(node.getNode("markerSets").appendListNode());
} }
loader.save(node); loader.save(node);

View File

@ -210,7 +210,7 @@ public synchronized void save(ConfigurationNode node) {
node.getNode("defaultHide").setValue(this.isDefaultHidden); node.getNode("defaultHide").setValue(this.isDefaultHidden);
for (MarkerImpl marker : markers.values()) { for (MarkerImpl marker : markers.values()) {
marker.save(node.getNode("marker").getAppendedNode()); marker.save(node.getNode("marker").appendListNode());
} }
removedMarkers.clear(); removedMarkers.clear();

View File

@ -194,7 +194,7 @@ private static Color readColor(ConfigurationNode node) throws MarkerFileFormatEx
private static void writeShape(ConfigurationNode node, Shape shape) { private static void writeShape(ConfigurationNode node, Shape shape) {
for (int i = 0; i < shape.getPointCount(); i++) { for (int i = 0; i < shape.getPointCount(); i++) {
ConfigurationNode pointNode = node.getAppendedNode(); ConfigurationNode pointNode = node.appendListNode();
Vector2d point = shape.getPoint(i); Vector2d point = shape.getPoint(i);
pointNode.getNode("x").setValue(Math.round(point.getX() * 1000d) / 1000d); pointNode.getNode("x").setValue(Math.round(point.getX() * 1000d) / 1000d);
pointNode.getNode("z").setValue(Math.round(point.getY() * 1000d) / 1000d); pointNode.getNode("z").setValue(Math.round(point.getY() * 1000d) / 1000d);

View File

@ -9,9 +9,9 @@ dependencies {
compile 'org.apache.commons:commons-lang3:3.6' compile 'org.apache.commons:commons-lang3:3.6'
compile group: 'commons-io', name: 'commons-io', version: '2.5' compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile 'com.flowpowered:flow-math:1.0.3' compile 'com.flowpowered:flow-math:1.0.3'
compile 'ninja.leaping.configurate:configurate-hocon:3.3' compile 'org.spongepowered:configurate-hocon:3.7.1'
compile 'ninja.leaping.configurate:configurate-gson:3.3' compile 'org.spongepowered:configurate-gson:3.7.1'
compile 'ninja.leaping.configurate:configurate-yaml:3.3' compile 'org.spongepowered:configurate-yaml:3.7.1'
compile 'com.github.Querz:NBT:4.0' compile 'com.github.Querz:NBT:4.0'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'

View File

@ -222,7 +222,7 @@ public BlockStateResource build(String blockstateFile) throws IOException {
private Collection<Weighted<TransformedBlockModelResource>> loadModels(ConfigurationNode node, String blockstateFile, Map<String, String> overrideTextures) { private Collection<Weighted<TransformedBlockModelResource>> loadModels(ConfigurationNode node, String blockstateFile, Map<String, String> overrideTextures) {
Collection<Weighted<TransformedBlockModelResource>> models = new ArrayList<>(); Collection<Weighted<TransformedBlockModelResource>> models = new ArrayList<>();
if (node.hasListChildren()) { if (node.isList()) {
for (ConfigurationNode modelNode : node.getChildrenList()) { for (ConfigurationNode modelNode : node.getChildrenList()) {
try { try {
models.add(loadModel(modelNode, overrideTextures)); 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); Logger.global.logDebug("Failed to load a model trying to parse " + blockstateFile + ": " + ex);
} }
} }
} else if (node.hasMapChildren()) { } else if (node.isMap()) {
try { try {
models.add(loadModel(node, overrideTextures)); models.add(loadModel(node, overrideTextures));
} catch (ParseResourceException ex) { } catch (ParseResourceException ex) {
@ -429,12 +429,12 @@ private BlockStateResource buildForge(ConfigurationNode config, String blockstat
} }
private boolean isForgeStraightVariant(ConfigurationNode node) { private boolean isForgeStraightVariant(ConfigurationNode node) {
if (node.hasListChildren()) if (node.isList())
return true; return true;
for (Entry<Object, ? extends ConfigurationNode> entry : node.getChildrenMap().entrySet()) { for (Entry<Object, ? extends ConfigurationNode> entry : node.getChildrenMap().entrySet()) {
if (entry.getKey().equals(JSON_COMMENT)) continue; if (entry.getKey().equals(JSON_COMMENT)) continue;
if (!entry.getValue().hasMapChildren()) return true; if (!entry.getValue().isMap()) return true;
} }
return false; return false;

View File

@ -39,7 +39,7 @@ public class ConfigUtils {
private ConfigUtils(){} private ConfigUtils(){}
public static Vector2i readVector2i(ConfigurationNode vectorNode){ public static Vector2i readVector2i(ConfigurationNode vectorNode){
if (vectorNode.hasListChildren()){ if (vectorNode.isList()){
List<? extends ConfigurationNode> list = vectorNode.getChildrenList(); List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
return new Vector2i( return new Vector2i(
list.get(0).getInt(), list.get(0).getInt(),
@ -54,7 +54,7 @@ public static Vector2i readVector2i(ConfigurationNode vectorNode){
} }
public static Vector3i readVector3i(ConfigurationNode vectorNode){ public static Vector3i readVector3i(ConfigurationNode vectorNode){
if (vectorNode.hasListChildren()){ if (vectorNode.isList()){
List<? extends ConfigurationNode> list = vectorNode.getChildrenList(); List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
return new Vector3i( return new Vector3i(
list.get(0).getInt(), list.get(0).getInt(),
@ -71,7 +71,7 @@ public static Vector3i readVector3i(ConfigurationNode vectorNode){
} }
public static Vector3f readVector3f(ConfigurationNode vectorNode){ public static Vector3f readVector3f(ConfigurationNode vectorNode){
if (vectorNode.hasListChildren()){ if (vectorNode.isList()){
List<? extends ConfigurationNode> list = vectorNode.getChildrenList(); List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
return new Vector3f( return new Vector3f(
list.get(0).getFloat(), list.get(0).getFloat(),
@ -88,7 +88,7 @@ public static Vector3f readVector3f(ConfigurationNode vectorNode){
} }
public static Vector4i readVector4i(ConfigurationNode vectorNode){ public static Vector4i readVector4i(ConfigurationNode vectorNode){
if (vectorNode.hasListChildren()){ if (vectorNode.isList()){
List<? extends ConfigurationNode> list = vectorNode.getChildrenList(); List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
return new Vector4i( return new Vector4i(
list.get(0).getInt(), list.get(0).getInt(),
@ -107,7 +107,7 @@ public static Vector4i readVector4i(ConfigurationNode vectorNode){
} }
public static Vector4f readVector4f(ConfigurationNode vectorNode){ public static Vector4f readVector4f(ConfigurationNode vectorNode){
if (vectorNode.hasListChildren()){ if (vectorNode.isList()){
List<? extends ConfigurationNode> list = vectorNode.getChildrenList(); List<? extends ConfigurationNode> list = vectorNode.getChildrenList();
return new Vector4f( return new Vector4f(
list.get(0).getFloat(), list.get(0).getFloat(),
@ -126,10 +126,10 @@ public static Vector4f readVector4f(ConfigurationNode vectorNode){
} }
public static void writeVector4f(ConfigurationNode vectorNode, Vector4f v){ public static void writeVector4f(ConfigurationNode vectorNode, Vector4f v){
vectorNode.getAppendedNode().setValue(v.getX()); vectorNode.appendListNode().setValue(v.getX());
vectorNode.getAppendedNode().setValue(v.getY()); vectorNode.appendListNode().setValue(v.getY());
vectorNode.getAppendedNode().setValue(v.getZ()); vectorNode.appendListNode().setValue(v.getZ());
vectorNode.getAppendedNode().setValue(v.getW()); vectorNode.appendListNode().setValue(v.getW());
} }
/** /**