diff --git a/BauSystem/BauSystem_Main/src/BauSystem.properties b/BauSystem/BauSystem_Main/src/BauSystem.properties index c5adfb70..3ded0154 100644 --- a/BauSystem/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem/BauSystem_Main/src/BauSystem.properties @@ -52,6 +52,7 @@ FLAG_ITEMS = Items FLAG_NO_GRAVITY = No Gravity FLAG_TESTBLOCK = Testblock FLAG_CHANGED = Changed +FLAG_WINDCHARGE = Windcharge FLAG_WATER_DESTROY = Water Destroy FLAG_WATER_DESTROY_ALLOW = §coff FLAG_WATER_DESTROY_DENY = §aon @@ -92,6 +93,9 @@ FLAG_TESTBLOCK_NORTH = §eNorth FLAG_TESTBLOCK_SOUTH = §eSouth FLAG_CHANGED_NO_CHANGE = §cNo FLAG_CHANGED_HAS_CHANGE = §aYes +FLAG_WINDCHARGE_ALLOW = §aon +FLAG_WINDCHARGE_DENY = §coff +FLAG_WINDCHARGE_NO_INTERACT = §7no §8windcharge interact # Region REGION_TYPE_NORMAL = Normal REGION_TYPE_BUILD = Build area @@ -827,6 +831,8 @@ REGION_TNT_OFF = §cTNT-Damage deactivated REGION_TNT_TB = §aTNT-Damage activated outside the building area REGION_TNT_BUILD_DESTROY = §cAn explosion would have destroyed blocks in the building area REGION_TNT_TB_DESTROY = §cAn explosion would have destroyed blocks in the testblock area +REGION_WINDCHARGE_HELP = §8/§ewindcharge §8[§7Mode§8] §8- §7Set WindCharge behaviour to a given mode + AFK_KICK_MESSAGE = §cNothing happened on this server for 15 minutes. AFK_WARNING_MESSAGE = §cThis server will stop in one minute if you remain inactive SKIN_HELP = §8/§eskin §8[§7Shortform§8] §8[§7Creator§8|§epublic§8] §8[§7Name...§8] §8- §7Creates the skin schematic. Use 'public' as creator to have no creator, then copy the message to YoyoNow by clicking diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProjectieleStopperListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProjectieleStopperListener.java new file mode 100644 index 00000000..91ff9330 --- /dev/null +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProjectieleStopperListener.java @@ -0,0 +1,23 @@ +/* + * 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.features.region; + +public class ProjectieleStopperListener { +} diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java index 3f933683..83581007 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java @@ -28,6 +28,7 @@ import de.steamwar.bausystem.utils.ScoreboardElement; import de.steamwar.linkage.Linked; import org.bukkit.Location; import org.bukkit.block.Block; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -55,6 +56,7 @@ public class ProtectListener implements Listener, ScoreboardElement { @EventHandler public void onExplode(EntityExplodeEvent event) { + if (event.getEntityType() == EntityType.WIND_CHARGE) return; explode(event.blockList(), event.getLocation()); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java new file mode 100644 index 00000000..51b0493a --- /dev/null +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java @@ -0,0 +1,44 @@ +/* + * 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.features.region; + +import de.steamwar.bausystem.region.Region; +import de.steamwar.bausystem.region.flags.Flag; +import de.steamwar.bausystem.region.flags.WindChargeInteractMode; +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import org.bukkit.entity.Player; + +@Linked +public class WindChargeInteractModeCommand extends SWCommand { + public WindChargeInteractModeCommand() { + super("windcharge"); + } + + @Register(description = "REGION_WINDCHARGE_HELP") + public void toggleCommand(@Validator Player p) { + Region region = Region.getRegion(p.getLocation()); + if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).get() == WindChargeInteractMode.DENY) { + region.getRegionData().set(Flag.WIND_CHARGE_INTERACT, WindChargeInteractMode.ALLOW); + } else { + region.getRegionData().set(Flag.WIND_CHARGE_INTERACT, WindChargeInteractMode.DENY); + } + } +} diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java new file mode 100644 index 00000000..0728480d --- /dev/null +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java @@ -0,0 +1,57 @@ +/* + * 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.features.region; + +import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.region.Region; +import de.steamwar.bausystem.region.flags.Flag; +import de.steamwar.bausystem.region.flags.WindChargeInteractMode; +import de.steamwar.bausystem.utils.ScoreboardElement; +import de.steamwar.linkage.Linked; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; + +@Linked +public class WindChargeInteractModeListener implements Listener, ScoreboardElement { + + @EventHandler + public void onExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + Region region = Region.getRegion(event.getLocation()); + if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).getWithDefault() != WindChargeInteractMode.DENY) event.blockList().clear(); + } + + @Override + public ScoreboardGroup getGroup() { + return ScoreboardGroup.REGION; + } + @Override + public int order() { + return 2; + } + @Override + public String get(Region region, Player p) { + //if (region.getRegionData().get(Flag.WIND_CHARGE).is(WindChargeMode.ALLOW)) return null; + return "§e" + BauSystem.MESSAGE.parse(Flag.WIND_CHARGE_INTERACT.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).getWithDefault().getChatValue(), p); + } +} 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 5bd32444..6fc979e0 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 @@ -44,6 +44,7 @@ public final class Flag & Flag.Value> implements EnumDispla public static final Flag TESTBLOCK = new Flag<>("TESTBLOCK", "FLAG_TESTBLOCK", TestblockMode.class, TestblockMode.NO_VALUE); public static final Flag CHANGED = new Flag<>("CHANGED", "FLAG_CHANGED", ChangedMode.class, ChangedMode.NO_CHANGE); public static final Flag WATER_DESTROY = new Flag<>("WATER_DESTROY", "FLAG_WATER_DESTROY", WaterDestroyMode.class, WaterDestroyMode.ALLOW); + public static final Flag WIND_CHARGE_INTERACT = new Flag<>("WINDCHARGE_INTERACT", "FLAG_WINDCHARGE_INTERACT", WindChargeInteractMode.class, WindChargeInteractMode.ALLOW); private String name; private int ordinal; diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java new file mode 100644 index 00000000..bb36391a --- /dev/null +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.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.flags; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum WindChargeInteractMode implements Flag.Value { + + ALLOW("FLAG_WINDCHARGE_ALLOW"), + DENY("FLAG_WINDCHARGE_DENY"); + + private static WindChargeInteractMode[] values; + private final String chatValue; + + @Override + public WindChargeInteractMode[] getValues() { + return WindChargeInteractMode.values(); + } + + @Override + public WindChargeInteractMode getValue() { + return this; + } + + @Override + public WindChargeInteractMode getValueOf(final String name) { + try { + return WindChargeInteractMode.valueOf(name.toUpperCase()); + } catch (IllegalArgumentException e) { + return WindChargeInteractMode.ALLOW; + } + } +} diff --git a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalRegionData.java b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalRegionData.java index 5412adf7..f1b5febc 100644 --- a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalRegionData.java +++ b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedGlobalRegionData.java @@ -21,10 +21,7 @@ package de.steamwar.bausystem.region.fixed; import de.steamwar.bausystem.region.RegionData; import de.steamwar.bausystem.region.RegionFlagPolicy; -import de.steamwar.bausystem.region.flags.ColorMode; -import de.steamwar.bausystem.region.flags.Flag; -import de.steamwar.bausystem.region.flags.ProtectMode; -import de.steamwar.bausystem.region.flags.TNTMode; +import de.steamwar.bausystem.region.flags.*; import de.steamwar.bausystem.worlddata.WorldData; import lombok.NonNull; @@ -39,6 +36,7 @@ public class FixedGlobalRegionData extends RegionData { flagMap.put(Flag.TNT, TNTMode.DENY); flagMap.put(Flag.COLOR, ColorMode.YELLOW); flagMap.put(Flag.PROTECT, ProtectMode.INACTIVE); + flagMap.put(Flag.WIND_CHARGE_INTERACT, WindChargeInteractMode.ALLOW); } @Override diff --git a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedRegionData.java b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedRegionData.java index ffe7c327..8d6d9a53 100644 --- a/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedRegionData.java +++ b/BauSystem/BauSystem_RegionFixed/src/de/steamwar/bausystem/region/fixed/FixedRegionData.java @@ -33,7 +33,7 @@ public class FixedRegionData extends RegionData { @Override public @NonNull & Flag.Value> RegionFlagPolicy has(@NonNull Flag flag) { - if (flag.oneOf(Flag.COLOR, Flag.TNT, Flag.FIRE, Flag.FREEZE, Flag.PROTECT, Flag.NO_GRAVITY, Flag.CHANGED, Flag.WATER_DESTROY)) { + if (flag.oneOf(Flag.COLOR, Flag.TNT, Flag.FIRE, Flag.FREEZE, Flag.PROTECT, Flag.NO_GRAVITY, Flag.CHANGED, Flag.WATER_DESTROY, Flag.WIND_CHARGE_INTERACT)) { return RegionFlagPolicy.WRITABLE; } if (flag.oneOf(Flag.ITEMS)) { diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java index bded9613..71805d75 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java @@ -108,7 +108,7 @@ public class WaterRemover implements Listener { //checks for water and removes it, if present boolean result = true; Material type = b.getType(); - if (type == Material.WATER || type == Material.LAVA) { + if (type == Material.WATER || type == Material.LAVA || type == Material.BUBBLE_COLUMN) { b.setType(Material.AIR); } else { BlockData data = b.getBlockData();