diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java b/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java index aac277b8..b89f3df5 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/FlagStorage.java @@ -54,10 +54,18 @@ public class FlagStorage { public static YAPIONObject toYAPION(FlagStorage flagStorage) { YAPIONObject yapionObject = new YAPIONObject(); for (final Flag flag : Flag.getFlags()) { - yapionObject.add(flag.name(), flagStorage.get(flag).getValue().name()); + if (flag.getDefaultValue() == flagStorage.flags.getOrDefault(flag, flag.getDefaultValue())) { + yapionObject.remove(flag.name()); + } else { + yapionObject.add(flag.name(), flagStorage.get(flag).getValue().name()); + } } - for (Tag tag : flagStorage.tagSet) { - yapionObject.add(tag.name(), ""); + for (Tag tag : Tag.values()) { + if (flagStorage.tagSet.contains(tag)) { + yapionObject.add(tag.name(), ""); + } else { + yapionObject.remove(tag.name()); + } } return yapionObject; }