diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/DisplayRegionData.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/DisplayRegionData.java new file mode 100644 index 00000000..7069d0f4 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/DisplayRegionData.java @@ -0,0 +1,54 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.modes; + +import de.steamwar.bausystem.region.RegionData; +import de.steamwar.bausystem.region.RegionDataStore; +import de.steamwar.bausystem.region.RegionFlagPolicy; +import de.steamwar.bausystem.region.flags.Flag; +import de.steamwar.bausystem.region.flags.TNTMode; +import de.steamwar.core.Core; +import lombok.NonNull; + +public class DisplayRegionData extends RegionData { + + public DisplayRegionData(RegionDataStore store) { + super(store); + } + + @Override + protected void initialize() { + flagMap.put(Flag.TNT, TNTMode.DENY); + } + + @Override + public @NonNull & Flag.Value> RegionFlagPolicy has(@NonNull Flag flag) { + if (flag.oneOf(Flag.FIRE, Flag.FREEZE, Flag.NO_GRAVITY, Flag.WATER_DESTROY)) { + return RegionFlagPolicy.WRITABLE; + } + if (flag.oneOf(Flag.ITEMS) && Core.getVersion() >= 20) { + return RegionFlagPolicy.WRITABLE; + } + if (flag.oneOf(Flag.TNT, Flag.PROTECT)) { + return RegionFlagPolicy.READ_ONLY; + } + return RegionFlagPolicy.NOT_APPLICABLE; + } +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/PlotRegionData.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/PlotRegionData.java new file mode 100644 index 00000000..e16a45a1 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/PlotRegionData.java @@ -0,0 +1,53 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.modes; + +import de.steamwar.bausystem.region.RegionData; +import de.steamwar.bausystem.region.RegionDataStore; +import de.steamwar.bausystem.region.RegionFlagPolicy; +import de.steamwar.bausystem.region.flags.Flag; +import de.steamwar.bausystem.region.flags.TNTMode; +import de.steamwar.bausystem.region.flags.TestblockMode; +import de.steamwar.core.Core; +import lombok.NonNull; + +public class PlotRegionData extends RegionData { + + public PlotRegionData(RegionDataStore store) { + super(store); + } + + @Override + protected void initialize() { + flagMap.put(Flag.TNT, TNTMode.ALLOW); + flagMap.put(Flag.TESTBLOCK, TestblockMode.NO_VALUE); + } + + @Override + public @NonNull & Flag.Value> RegionFlagPolicy has(@NonNull Flag flag) { + if (flag.oneOf(Flag.TNT, Flag.PROTECT, Flag.FIRE, Flag.FREEZE, Flag.NO_GRAVITY, Flag.WATER_DESTROY, Flag.TESTBLOCK, Flag.CHANGED)) { + return RegionFlagPolicy.WRITABLE; + } + if (flag.oneOf(Flag.ITEMS) && Core.getVersion() >= 20) { + return RegionFlagPolicy.WRITABLE; + } + return RegionFlagPolicy.NOT_APPLICABLE; + } +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/microwargear_7/display/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/microwargear_7/display/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/microwargear_7/plot/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/microwargear_7/plot/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/miniwargear/display/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/miniwargear/display/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/miniwargear/plot/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/miniwargear/plot/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/wargear_45/display/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/wargear_45/display/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/wargear_45/plot/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/wargear_45/plot/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/warship_175/display/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/warship_175/display/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/warship_175/plot/.gitkeep b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/modes/warship_175/plot/.gitkeep new file mode 100644 index 00000000..e69de29b