Add toString() methods

This commit is contained in:
2025-08-02 08:49:56 +02:00
parent 9e0e339277
commit ecb9571624
5 changed files with 27 additions and 8 deletions
@@ -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();
@@ -106,6 +106,11 @@ public final class Flag<T extends Enum<T> & Flag.Value<T>> implements EnumDispla
return false;
}
@Override
public String toString() {
return name;
}
public interface Value<T extends Enum<T> & Value<T>> extends EnumDisplay {
String name();
@@ -94,4 +94,11 @@ public class FixedFlagStorage implements FlagStorage {
public Map<Flag<?>, Flag.Value<?>> getBackedMap() {
return flagMap;
}
@Override
public String toString() {
return "FixedFlagStorage{" +
"flagMap=" + flagMap +
'}';
}
}
@@ -98,4 +98,11 @@ public class FixedGlobalFlagStorage implements FlagStorage {
public Map<Flag<?>, Flag.Value<?>> getBackedMap() {
return flagMap;
}
@Override
public String toString() {
return "FixedGlobalFlagStorage{" +
"flagMap=" + flagMap +
'}';
}
}
@@ -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);
}
}