From 2b062d34dae0feda5e0e411062e0dde86820fdb6 Mon Sep 17 00:00:00 2001 From: Tz3r0 <36421453+Tz3r0@users.noreply.github.com> Date: Tue, 31 Mar 2020 19:05:48 +0200 Subject: [PATCH] fixed block states on portal hubs Fixed that, when portal hubs were generated A) the properties of the palette in the JSON file were not properly parsed and B) the parsed properties weren't in uppercase leading to a crash, when the Game tried looking up the values in an enum --- .../github/vampirestudios/raa/utils/JsonConverter.java | 2 +- .../raa/utils/WorldStructureManipulation.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/vampirestudios/raa/utils/JsonConverter.java b/src/main/java/io/github/vampirestudios/raa/utils/JsonConverter.java index e5bdd4e6..a6811549 100644 --- a/src/main/java/io/github/vampirestudios/raa/utils/JsonConverter.java +++ b/src/main/java/io/github/vampirestudios/raa/utils/JsonConverter.java @@ -72,11 +72,11 @@ public StructureValues loadStructure(JsonObject structureJson) { if (name.equals("palette")) { JsonArray list = JsonHelper.getArray(valueArray, "list"); list.forEach(jsonElement1 -> { + Map blockPropertyMap = new HashMap<>(); JsonArray paletteProperties = jsonElement1.getAsJsonArray(); paletteProperties.forEach(jsonElement2 -> { JsonObject paletteProperty = jsonElement2.getAsJsonObject(); String propertyName = JsonHelper.getString(paletteProperty, "name"); - Map blockPropertyMap = new HashMap<>(); if (propertyName.equals("Name")) { structure.setBlockProperties(blockPropertyMap); String blockId = JsonHelper.getString(paletteProperty, "value"); diff --git a/src/main/java/io/github/vampirestudios/raa/utils/WorldStructureManipulation.java b/src/main/java/io/github/vampirestudios/raa/utils/WorldStructureManipulation.java index 22172ed1..5c01a30a 100644 --- a/src/main/java/io/github/vampirestudios/raa/utils/WorldStructureManipulation.java +++ b/src/main/java/io/github/vampirestudios/raa/utils/WorldStructureManipulation.java @@ -175,21 +175,21 @@ public static void placeBlock(IWorld world, BlockPos pos, String block, Map