Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #83 from Tz3r0/dev/1.15
Browse files Browse the repository at this point in the history
Fix for a bug when generating Portal Hubs
  • Loading branch information
oliviathevampire authored Mar 31, 2020
2 parents 9e53b7b + 89eec6c commit d59bb47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public StructureValues loadStructure(JsonObject structureJson) {
if (name.equals("palette")) {
JsonArray list = JsonHelper.getArray(valueArray, "list");
list.forEach(jsonElement1 -> {
Map<String, String> blockPropertyMap = new HashMap<>();
JsonArray paletteProperties = jsonElement1.getAsJsonArray();
paletteProperties.forEach(jsonElement2 -> {
JsonObject paletteProperty = jsonElement2.getAsJsonObject();
String propertyName = JsonHelper.getString(paletteProperty, "name");
Map<String, String> blockPropertyMap = new HashMap<>();
if (propertyName.equals("Name")) {
structure.setBlockProperties(blockPropertyMap);
String blockId = JsonHelper.getString(paletteProperty, "value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ public static void placeBlock(IWorld world, BlockPos pos, String block, Map<Stri
world.setBlockState(pos, world.getBlockState(pos).with(Properties.CHEST_TYPE, ChestType.valueOf(properties.get("type"))), 2);
} else {
//TODO: [Slabs]
world.setBlockState(pos, world.getBlockState(pos).with(Properties.SLAB_TYPE, SlabType.valueOf(properties.get("type"))), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.SLAB_TYPE, SlabType.valueOf(properties.get("type").toUpperCase())), 2);
}
} if (properties.get("half") != null) {
//TODO: [Stairs]
world.setBlockState(pos, world.getBlockState(pos).with(Properties.BLOCK_HALF, BlockHalf.valueOf(properties.get("half"))), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.BLOCK_HALF, BlockHalf.valueOf(properties.get("half").toUpperCase())), 2);
} if (properties.get("shape") != null) {
//TODO: [Stairs]
world.setBlockState(pos, world.getBlockState(pos).with(Properties.STAIR_SHAPE, StairShape.valueOf(properties.get("shape"))), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.STAIR_SHAPE, StairShape.valueOf(properties.get("shape").toUpperCase())), 2);
} if (properties.get("facing") != null) {
if (block.equals("minecraft:barrel")) {
//TODO: Barrel
world.setBlockState(pos, world.getBlockState(pos).with(Properties.FACING, Direction.valueOf(facing)), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.FACING, Direction.valueOf(facing.toUpperCase())), 2);
} else {
//TODO: [Anvils], [Chests], [Stairs], Bell, Blast_Furnace, Furnace, Grindstone, Smoker, Stonecutter,
world.setBlockState(pos, world.getBlockState(pos).with(Properties.HORIZONTAL_FACING, Direction.valueOf(facing)), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.HORIZONTAL_FACING, Direction.valueOf(facing.toUpperCase())), 2);
}
} if (properties.get("north") != null || properties.get("west") != null || properties.get("south") != null || properties.get("east") != null) {
//TODO: [Fences], [Walls], Iron bar
Expand Down Expand Up @@ -223,13 +223,13 @@ public static void placeBlock(IWorld world, BlockPos pos, String block, Map<Stri
world.setBlockState(pos, world.getBlockState(pos).with(Properties.UNSTABLE, properties.get("unstable").equals("TRUE")), 2);
} if (properties.get("face") != null) {
//TODO: Grindstone
world.setBlockState(pos, world.getBlockState(pos).with(Properties.WALL_MOUNT_LOCATION, WallMountLocation.valueOf(properties.get("face"))), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.WALL_MOUNT_LOCATION, WallMountLocation.valueOf(properties.get("face").toUpperCase())), 2);
} if (properties.get("distance") != null) {
//TODO: Scaffolding
world.setBlockState(pos, world.getBlockState(pos).with(Properties.DISTANCE_0_7, Integer.parseInt(properties.get("distance"))), 2);
} if (properties.get("attachment") != null) {
//TODO: Bell
world.setBlockState(pos, world.getBlockState(pos).with(Properties.ATTACHMENT, Attachment.valueOf(properties.get("attachment"))), 2);
world.setBlockState(pos, world.getBlockState(pos).with(Properties.ATTACHMENT, Attachment.valueOf(properties.get("attachment").toUpperCase())), 2);
} if (properties.get("axis") != null) {
//TODO: Bone_Block
world.setBlockState(pos, world.getBlockState(pos).with(Properties.AXIS, Direction.Axis.fromName(axis)), 2);
Expand Down

0 comments on commit d59bb47

Please sign in to comment.