From ecb9571624836fe6893c3df6acf4fb7a4c459cb8 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sat, 2 Aug 2025 08:49:56 +0200 Subject: [PATCH] Add toString() methods --- .../de/steamwar/bausystem/region/RegionSystem.java | 5 +++++ .../src/de/steamwar/bausystem/region/flags/Flag.java | 5 +++++ .../bausystem/region/fixed/FixedFlagStorage.java | 7 +++++++ .../region/fixed/FixedGlobalFlagStorage.java | 7 +++++++ .../de/steamwar/bausystem/region/fixed/Prototype.java | 11 +++-------- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionSystem.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionSystem.java index b476bfd2..bc37f66f 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionSystem.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionSystem.java @@ -92,6 +92,11 @@ public interface RegionSystem { throw new UnsupportedOperationException(); } + @Override + public @NonNull Location getWorldSpawn() { + throw new UnsupportedOperationException(); + } + @Override public Region getGlobalRegion() { throw new UnsupportedOperationException(); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java index 305d046c..19a5082f 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java @@ -106,6 +106,11 @@ public final class Flag & Flag.Value> implements EnumDispla return false; } + @Override + public String toString() { + return name; + } + public interface Value & Value> extends EnumDisplay { String name(); diff --git a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedFlagStorage.java b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedFlagStorage.java index c382f547..5a26c0fa 100644 --- a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedFlagStorage.java +++ b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedFlagStorage.java @@ -94,4 +94,11 @@ public class FixedFlagStorage implements FlagStorage { public Map, Flag.Value> getBackedMap() { return flagMap; } + + @Override + public String toString() { + return "FixedFlagStorage{" + + "flagMap=" + flagMap + + '}'; + } } diff --git a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalFlagStorage.java b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalFlagStorage.java index 910483cb..d699eb08 100644 --- a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalFlagStorage.java +++ b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalFlagStorage.java @@ -98,4 +98,11 @@ public class FixedGlobalFlagStorage implements FlagStorage { public Map, Flag.Value> getBackedMap() { return flagMap; } + + @Override + public String toString() { + return "FixedGlobalFlagStorage{" + + "flagMap=" + flagMap + + '}'; + } } diff --git a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/Prototype.java b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/Prototype.java index 2569b03c..804e25f4 100644 --- a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/Prototype.java +++ b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/Prototype.java @@ -20,7 +20,7 @@ package de.steamwar.bausystem.region.fixed; import de.steamwar.bausystem.region.FlagStorage; -import de.steamwar.bausystem.region.Region; +import de.steamwar.bausystem.region.flags.TestblockMode; import lombok.AllArgsConstructor; import lombok.Getter; import yapion.hierarchy.types.YAPIONObject; @@ -217,13 +217,8 @@ public class Prototype { } else { prototype = PROTOTYPE_MAP.get(regionConfig.getPlainValue("prototype")); } - System.out.println(name + " " + prototype); - // FlagStorage flagStorage; - // if (regionData.containsKey("flagStorage", YAPIONType.OBJECT)) { - // flagStorage = FlagStorage.createStorage(regionData.getObject("flagStorage")); - // } else { - // flagStorage = new FlagStorage(); - // } + FlagStorage flagStorage = new FixedFlagStorage(TestblockMode.NO_VALUE, regionData.getObjectOrSetDefault("flagStorage", new YAPIONObject())); + System.out.println(name + " " + prototype + " " + flagStorage); // return new Region(name, prototype, regionConfig, flagStorage, regionData); } }