From a0d5f46737a151c61369bddf380049ce7de97691 Mon Sep 17 00:00:00 2001 From: SD Date: Fri, 14 Jan 2022 14:24:26 +0530 Subject: [PATCH] it builds? --- .../dimdoors/pockets/TemplateUtils.java | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/dimdev/dimdoors/pockets/TemplateUtils.java b/src/main/java/org/dimdev/dimdoors/pockets/TemplateUtils.java index be641dae..a4ef1162 100644 --- a/src/main/java/org/dimdev/dimdoors/pockets/TemplateUtils.java +++ b/src/main/java/org/dimdev/dimdoors/pockets/TemplateUtils.java @@ -132,35 +132,34 @@ public class TemplateUtils { NbtCompound newTag = new NbtCompound(); EntranceRiftBlockEntity rift = new EntranceRiftBlockEntity(pos, Schematic.getBlockSample(schematic).getBlockState(pos)); - switch (blockEntityTag.getString("placeholder")) { - case "deeper_depth_door": - rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); - rift.setDestination(DefaultDungeonDestinations.getDeeperDungeonDestination()); - newTag = rift.writeNbt(newTag); - break; - case "less_deep_depth_door": - rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); - rift.setDestination(DefaultDungeonDestinations.getShallowerDungeonDestination()); - newTag = rift.writeNbt(newTag); - break; - case "overworld_door": - rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); - rift.setDestination(DefaultDungeonDestinations.getOverworldDestination()); - newTag = rift.writeNbt(newTag); - break; - case "entrance_door": - rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); - rift.setDestination(DefaultDungeonDestinations.getTwoWayPocketEntrance()); - newTag = rift.writeNbt(newTag); - break; - case "gateway_portal": - rift.setProperties(DefaultDungeonDestinations.OVERWORLD_LINK_PROPERTIES); - rift.setDestination(DefaultDungeonDestinations.getGateway()); - newTag = rift.writeNbt(newTag); - break; - default: - throw new RuntimeException("Unknown block entity placeholder: " + blockEntityTag.getString("placeholder")); - } + switch (blockEntityTag.getString("placeholder")) { + case "deeper_depth_door" -> { + rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); + rift.setDestination(DefaultDungeonDestinations.getDeeperDungeonDestination()); + rift.writeNbt(newTag); + } + case "less_deep_depth_door" -> { + rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); + rift.setDestination(DefaultDungeonDestinations.getShallowerDungeonDestination()); + rift.writeNbt(newTag); + } + case "overworld_door" -> { + rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); + rift.setDestination(DefaultDungeonDestinations.getOverworldDestination()); + rift.writeNbt(newTag); + } + case "entrance_door" -> { + rift.setProperties(DefaultDungeonDestinations.POCKET_LINK_PROPERTIES); + rift.setDestination(DefaultDungeonDestinations.getTwoWayPocketEntrance()); + rift.writeNbt(newTag); + } + case "gateway_portal" -> { + rift.setProperties(DefaultDungeonDestinations.OVERWORLD_LINK_PROPERTIES); + rift.setDestination(DefaultDungeonDestinations.getGateway()); + rift.writeNbt(newTag); + } + default -> throw new RuntimeException("Unknown block entity placeholder: " + blockEntityTag.getString("placeholder")); + } rift.setWorld(world.toServerWorld()); blockEntities.add(newTag); } else {