From 35ef929bc8c4b4252839d5b642bd243e762b46a2 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sat, 7 Mar 2026 12:52:18 +0100 Subject: [PATCH] Implement rest of Path Connections --- .../region/dynamic/path/PathArea.java | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/path/PathArea.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/path/PathArea.java index 4a6d7537..4c47b303 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/path/PathArea.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/path/PathArea.java @@ -44,26 +44,68 @@ public class PathArea implements Region.Area { private static final File PATH_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/path"); private static final File FALLBACK_SCHEM = new File(PATH_DIR, "Fallback.schem"); - private static final VariantSelector GARDEN = VariantSelector.Get(new File(PATH_DIR, "garden")); private static final VariantSelector CENTER_NORMAL = VariantSelector.Get(new File(PATH_DIR, "center/normal")); + private static final VariantSelector SIDE_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "side/global")); private static final VariantSelector CORNER_INNER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "cinner/global")); private static final VariantSelector CORNER_OUTER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "couter/global")); + private static final VariantSelector SIDE_WATER = VariantSelector.Get(new File(PATH_DIR, "side/water")); + private static final VariantSelector CORNER_INNER_WATER = VariantSelector.Get(new File(PATH_DIR, "cinner/water")); + private static final VariantSelector CORNER_OUTER_WATER = VariantSelector.Get(new File(PATH_DIR, "couter/water")); + + private static final VariantSelector SIDE_CLOSED = VariantSelector.Get(new File(PATH_DIR, "side/closed")); + private static final VariantSelector CORNER_INNER_CLOSED = VariantSelector.Get(new File(PATH_DIR, "cinner/closed")); + private static final VariantSelector CORNER_OUTER_CLOSED = VariantSelector.Get(new File(PATH_DIR, "couter/closed")); + + private static final VariantSelector GARDEN = VariantSelector.Get(new File(PATH_DIR, "garden")); + private static final VariantSelector SIDE_GARDEN = VariantSelector.Get(new File(PATH_DIR, "side/garden")); + private static final VariantSelector SIDE_GARDEN_CONNECTED = VariantSelector.Get(new File(PATH_DIR, "side/garden_connected")); + private static final VariantSelector CORNER_INNER_GARDEN = VariantSelector.Get(new File(PATH_DIR, "cinner/garden")); + private static final VariantSelector CORNER_OUTER_GARDEN = VariantSelector.Get(new File(PATH_DIR, "couter/garden")); + private static final SelectorSide SELECTOR_SIDE = new SelectorSide() .Case(Path, CENTER_NORMAL) - .Case(Global, SIDE_GLOBAL); + .Case(Global, SIDE_GLOBAL) + .Case(Water, SIDE_WATER) + .Case(Closed, SIDE_CLOSED) + .Case(Garden, SIDE_GARDEN_CONNECTED); private static final SelectorCorner SELECTOR_CORNER = new SelectorCorner() - // Path to Global! + // Path to Path + .Case(Path, Path, Path, CENTER_NORMAL, RotationCorrection.UsingOrdinal) + // Path to Global .Case(Path, Global, Global, SIDE_GLOBAL, RotationCorrection.WithCorrection) .Case(Global, Path, Path, SIDE_GLOBAL) .Case(Global, Path, Global, SIDE_GLOBAL) .Case(Path, Global, Path, SIDE_GLOBAL, RotationCorrection.WithCorrection) - .Case(Path, Path, Path, CENTER_NORMAL, RotationCorrection.UsingOrdinal) .Case(Global, Global, Global, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal) .Case(Global, Global, Path, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal) .Case(Path, Path, Global, CORNER_INNER_GLOBAL, RotationCorrection.UsingOrdinal) + // Path to Water + .Case(Path, Water, Water, SIDE_WATER, RotationCorrection.WithCorrection) + .Case(Water, Path, Path, SIDE_WATER) + .Case(Water, Path, Water, SIDE_WATER) + .Case(Path, Water, Path, SIDE_WATER, RotationCorrection.WithCorrection) + .Case(Water, Water, Water, CORNER_OUTER_WATER, RotationCorrection.UsingOrdinal) + .Case(Water, Water, Path, CORNER_OUTER_WATER, RotationCorrection.UsingOrdinal) + .Case(Path, Path, Water, CORNER_INNER_WATER, RotationCorrection.UsingOrdinal) + // Path to Closed + .Case(Path, Closed, Closed, SIDE_CLOSED, RotationCorrection.WithCorrection) + .Case(Closed, Path, Path, SIDE_CLOSED) + .Case(Closed, Path, Closed, SIDE_CLOSED) + .Case(Path, Closed, Path, SIDE_CLOSED, RotationCorrection.WithCorrection) + .Case(Closed, Closed, Closed, CORNER_OUTER_CLOSED, RotationCorrection.UsingOrdinal) + .Case(Closed, Closed, Path, CORNER_OUTER_CLOSED, RotationCorrection.UsingOrdinal) + .Case(Path, Path, Closed, CORNER_INNER_CLOSED, RotationCorrection.UsingOrdinal) + // Path to Garden + .Case(Path, Garden, Garden, SIDE_GARDEN, RotationCorrection.WithCorrection) + .Case(Garden, Path, Path, SIDE_GARDEN) + .Case(Garden, Path, Garden, SIDE_GARDEN) + .Case(Path, Garden, Path, SIDE_GARDEN, RotationCorrection.WithCorrection) + .Case(Garden, Garden, Garden, CORNER_OUTER_GARDEN, RotationCorrection.UsingOrdinal) + .Case(Garden, Garden, Path, CORNER_OUTER_GARDEN, RotationCorrection.UsingOrdinal) + .Case(Path, Path, Garden, CORNER_INNER_GARDEN, RotationCorrection.UsingOrdinal) ; protected enum RotationCorrection {