From 0e1e4056bb8d165aed2c5080be76d0dd6a35a491 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Wed, 9 Jun 2021 13:54:14 +0200 Subject: [PATCH] Workaround for SpongePowered/Configurate#206 When that issue is fixed, this commit can be reverted. --- .../bluemap/common/api/marker/ExtrudeMarkerImpl.java | 4 ++-- .../bluecolored/bluemap/common/api/marker/LineMarkerImpl.java | 2 +- .../bluemap/common/api/marker/ShapeMarkerImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ExtrudeMarkerImpl.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ExtrudeMarkerImpl.java index 78cecf69..61707d30 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ExtrudeMarkerImpl.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ExtrudeMarkerImpl.java @@ -151,7 +151,7 @@ public void load(BlueMapAPI api, ConfigurationNode markerNode, boolean overwrite this.shape = readShape(markerNode.node("shape")); this.shapeMinY = markerNode.node("shapeMinY").getFloat(0); - this.shapeMaxY = markerNode.node("shapeMaxY").getFloat(255); + this.shapeMaxY = (float) markerNode.node("shapeMaxY").getDouble(255); this.depthTest = markerNode.node("depthTest").getBoolean(true); this.lineWidth = markerNode.node("lineWidth").getInt(2); this.lineColor = readColor(markerNode.node("lineColor")); @@ -208,7 +208,7 @@ private static Color readColor(ConfigurationNode node) throws MarkerFileFormatEx if (nr.virtual() || ng.virtual() || nb.virtual()) throw new MarkerFileFormatException("Failed to read color: Node r,g or b is not set!"); - float alpha = na.getFloat(1); + float alpha = (float) na.getDouble(1); if (alpha < 0 || alpha > 1) throw new MarkerFileFormatException("Failed to read color: alpha value out of range (0-1)!"); try { diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/LineMarkerImpl.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/LineMarkerImpl.java index 1cb2228d..528c5d27 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/LineMarkerImpl.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/LineMarkerImpl.java @@ -173,7 +173,7 @@ private static Color readColor(ConfigurationNode node) throws MarkerFileFormatEx if (nr.virtual() || ng.virtual() || nb.virtual()) throw new MarkerFileFormatException("Failed to read color: Node r,g or b is not set!"); - float alpha = na.getFloat(1); + float alpha = (float) na.getDouble(1); if (alpha < 0 || alpha > 1) throw new MarkerFileFormatException("Failed to read color: alpha value out of range (0-1)!"); try { diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ShapeMarkerImpl.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ShapeMarkerImpl.java index 8f32374a..84c64808 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ShapeMarkerImpl.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/marker/ShapeMarkerImpl.java @@ -142,7 +142,7 @@ public void load(BlueMapAPI api, ConfigurationNode markerNode, boolean overwrite this.hasUnsavedChanges = false; this.shape = readShape(markerNode.node("shape")); - this.shapeY = markerNode.node("shapeY").getFloat(markerNode.node("height").getFloat(64)); // fallback to deprecated "height" + this.shapeY = (float) markerNode.node("shapeY").getDouble(markerNode.node("height").getDouble(64)); // fallback to deprecated "height" this.depthTest = markerNode.node("depthTest").getBoolean(true); this.lineWidth = markerNode.node("lineWidth").getInt(2); @@ -202,7 +202,7 @@ private static Color readColor(ConfigurationNode node) throws MarkerFileFormatEx if (nr.virtual() || ng.virtual() || nb.virtual()) throw new MarkerFileFormatException("Failed to read color: Node r,g or b is not set!"); - float alpha = na.getFloat(1); + float alpha = (float) na.getDouble(1); if (alpha < 0 || alpha > 1) throw new MarkerFileFormatException("Failed to read color: alpha value out of range (0-1)!"); try {