From 7a601235f5775284930650b8ee64bf6a033660c1 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Mon, 6 Jul 2026 17:27:47 +0200 Subject: [PATCH 01/19] Fix Trace isolating the same Tnt shows all Tnts --- .../de/steamwar/bausystem/features/tracer/TraceManager.java | 4 ++++ .../features/tracer/rendering/dynamicflags/IsolateFlag.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index 38409347..133f9c5d 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -374,6 +374,10 @@ public class TraceManager implements Listener { isolateFlag.toggleId(record.getTntId()); } + if (isolateFlag.isEmpty() && playerTraceShowData.hasViewFlagOnly(IsolateFlag.class)) { + playerTraceShowData = new PlayerTraceShowData(BundleFilter.DEFAULT); + } + PlayerTraceShowData finalPlayerTraceShowData = playerTraceShowData; tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> { trace.render(player, finalPlayerTraceShowData); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/dynamicflags/IsolateFlag.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/dynamicflags/IsolateFlag.java index 8c86fcaf..303e4a32 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/dynamicflags/IsolateFlag.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/dynamicflags/IsolateFlag.java @@ -51,6 +51,10 @@ public class IsolateFlag extends ViewFlag { } } + public boolean isEmpty() { + return tntToIsolate.isEmpty(); + } + @Override public Stream filter(Stream records) { if (tntToIsolate.isEmpty()) return records; From 2e795aaf8e806c9eabf84d907262e34414e7ad0d Mon Sep 17 00:00:00 2001 From: Sakziea Date: Mon, 6 Jul 2026 17:49:09 +0200 Subject: [PATCH 02/19] Fix /trace 1 still showes all the tnt of that trace --- .../src/de/steamwar/bausystem/features/tracer/TraceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index 133f9c5d..d4dd8fdc 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -374,7 +374,7 @@ public class TraceManager implements Listener { isolateFlag.toggleId(record.getTntId()); } - if (isolateFlag.isEmpty() && playerTraceShowData.hasViewFlagOnly(IsolateFlag.class)) { + if (isolateFlag.isEmpty() && playerTraceShowData.hasViewFlagOnly(IsolateFlag.class) && records.length != 0) { playerTraceShowData = new PlayerTraceShowData(BundleFilter.DEFAULT); } From b488c4ed7cbe04836f8c2785395d285c1ce1fb4d Mon Sep 17 00:00:00 2001 From: Sakziea Date: Tue, 14 Jul 2026 19:29:12 +0200 Subject: [PATCH 03/19] Fix /trace isolate {id} showing tnt from other traces --- .../bausystem/features/tracer/TraceCommand.java | 6 +++++- .../bausystem/features/tracer/TraceManager.java | 16 ++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index cfe50f55..e63ad554 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -153,7 +153,11 @@ public class TraceCommand extends SWCommand { @Register(value = "isolate", description = "TRACE_COMMAND_HELP_ISOLATE") public void isolate(@Validator Player player, Trace trace, @ErrorMessage("TRACE_RECORD_ID_INVALID") TNTPoint... records) { - TraceManager.instance.isolate(player, records); + if (records.length == 0) { + TraceManager.instance.isolate(player, trace, trace.getRecords().toArray(new TNTPoint[0])); + } else { + TraceManager.instance.isolate(player, trace, records); + } BauSystem.MESSAGE.send("TRACE_MESSAGE_ISOLATE", player); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index d4dd8fdc..ea594b9b 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -347,9 +347,10 @@ public class TraceManager implements Listener { * Toggles the isolated render for the given records and player * * @param player the player the trace is shown to - * @param records the record for which isolation is toggled + * @param ptrace the trace for whitch isolation is toggled + * @param records the records of the trace for which isolation is toggled */ - public void isolate(Player player, TNTPoint... records) { + public void isolate(Player player, Trace ptrace, TNTPoint... records) { unfollow(player); Region region = Region.getRegion(player.getLocation()); @@ -376,14 +377,17 @@ public class TraceManager implements Listener { if (isolateFlag.isEmpty() && playerTraceShowData.hasViewFlagOnly(IsolateFlag.class) && records.length != 0) { playerTraceShowData = new PlayerTraceShowData(BundleFilter.DEFAULT); + showDataPerRegionPerPlayer.get(region).put(player, playerTraceShowData); } PlayerTraceShowData finalPlayerTraceShowData = playerTraceShowData; tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> { - trace.render(player, finalPlayerTraceShowData); - followerMap.getOrDefault(player, Collections.emptySet()).forEach(follower -> { - trace.render(follower, finalPlayerTraceShowData); - }); + if (trace.getUuid() == ptrace.getUuid()) { + trace.render(player, finalPlayerTraceShowData); + followerMap.getOrDefault(player, Collections.emptySet()).forEach(follower -> { + trace.render(follower, finalPlayerTraceShowData); + }); + } }); } From bf3c65c6300dfb90a5ffb12a5e18c030653773e8 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Tue, 14 Jul 2026 19:47:08 +0200 Subject: [PATCH 04/19] Fix when no tnt isolated show normal --- .../steamwar/bausystem/features/tracer/TraceManager.java | 7 ++++--- .../features/tracer/rendering/PlayerTraceShowData.java | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java index ea594b9b..af2e0d37 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceManager.java @@ -376,17 +376,18 @@ public class TraceManager implements Listener { } if (isolateFlag.isEmpty() && playerTraceShowData.hasViewFlagOnly(IsolateFlag.class) && records.length != 0) { - playerTraceShowData = new PlayerTraceShowData(BundleFilter.DEFAULT); - showDataPerRegionPerPlayer.get(region).put(player, playerTraceShowData); + playerTraceShowData.removeViewFlag(IsolateFlag.class); } PlayerTraceShowData finalPlayerTraceShowData = playerTraceShowData; tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> { - if (trace.getUuid() == ptrace.getUuid()) { + if (trace.getUuid() == ptrace.getUuid() || finalPlayerTraceShowData.hasNoViewFlags()) { trace.render(player, finalPlayerTraceShowData); followerMap.getOrDefault(player, Collections.emptySet()).forEach(follower -> { trace.render(follower, finalPlayerTraceShowData); }); + } else { + trace.hide(player); } }); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/PlayerTraceShowData.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/PlayerTraceShowData.java index 40bbb238..ca34da43 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/PlayerTraceShowData.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/PlayerTraceShowData.java @@ -95,4 +95,8 @@ public class PlayerTraceShowData { public void addViewFlag(ViewFlag viewFlag) { viewFlags.put(viewFlag.getClass(), viewFlag); } + + public void removeViewFlag(Class clazz) { + viewFlags.remove(clazz); + } } From dab443b989fd393af75747c84b2c14fbff7478f2 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Thu, 16 Jul 2026 16:23:52 +0200 Subject: [PATCH 05/19] Fix pullRequest comments --- .../src/de/steamwar/bausystem/features/tracer/TraceCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index e63ad554..a40a4a62 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -154,7 +154,7 @@ public class TraceCommand extends SWCommand { @Register(value = "isolate", description = "TRACE_COMMAND_HELP_ISOLATE") public void isolate(@Validator Player player, Trace trace, @ErrorMessage("TRACE_RECORD_ID_INVALID") TNTPoint... records) { if (records.length == 0) { - TraceManager.instance.isolate(player, trace, trace.getRecords().toArray(new TNTPoint[0])); + TraceManager.instance.isolate(player, trace, trace.getRecords().toArray(TNTPoint[]::new)); } else { TraceManager.instance.isolate(player, trace, records); } From 390d388692667823efd88b28b111dd5a4f944ee5 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 16 Jul 2026 16:32:21 +0200 Subject: [PATCH 06/19] Closes: #442 --- .../features/simulator/SimulatorCursor.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java index 72178e23..6f674a71 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.simulator; +import com.destroystokyo.paper.event.server.ServerTickEndEvent; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; @@ -77,8 +78,16 @@ public class SimulatorCursor implements Listener { return isSimulatorItem(player.getInventory().getItemInMainHand()) || isSimulatorItem(player.getInventory().getItemInOffHand()); } + private static Set scheduledUpdates = new HashSet<>(); + private static void scheduleCursorUpdate(Player player) { - BauSystem.runTaskLater(BauSystem.getInstance(), () -> calcCursor(player), 1); + scheduledUpdates.add(player); + } + + @EventHandler + public void onServerTickEnd(ServerTickEndEvent event) { + scheduledUpdates.forEach(SimulatorCursor::calcCursor); + scheduledUpdates.clear(); } @EventHandler @@ -122,6 +131,7 @@ public class SimulatorCursor implements Listener { public void onPlayerQuit(PlayerQuitEvent event) { cursorType.remove(event.getPlayer()); removeCursor(event.getPlayer()); + scheduledUpdates.remove(event.getPlayer()); } private static final Map LAST_SNEAKS = new HashMap<>(); From e6d39da36b6b98c2e1153d4c43fdabd1dc0ac443 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 16 Jul 2026 16:39:27 +0200 Subject: [PATCH 07/19] Add GameModeConfig.KitsConfig.MaxBlastResistance for disabling all Blocks with more than 9.0 blast resistance --- .../SQL/src/de/steamwar/sql/GameModeConfig.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index d22d8978..da2cf442 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -929,6 +929,13 @@ public final class GameModeConfig { */ public final boolean PersonalKits; + /** + * Maximal blast resistance for the blocks + * + * @implSpec {@code 9.0} by default + */ + public final double MaxBlastResistance; + /** * Items (Valid spigot material values) that are not allowed in the personal kit */ @@ -940,7 +947,10 @@ public final class GameModeConfig { MemberDefault = loader.getString("MemberDefault", "default"); LeaderDefault = loader.getString("LeaderDefault", "default"); PersonalKits = loader.getBoolean("PersonalKits", false); - ForbiddenItems = loader.getMaterialList("ForbiddenItems"); + MaxBlastResistance = loader.getDouble("MaxBlastResistance", 9.0); + List forbiddenItems = new ArrayList<>(loader.getMaterialList("ForbiddenItems")); + forbiddenItems.addAll(SQLWrapper.impl.getMaterialWithGreaterBlastResistance(MaxBlastResistance)); + ForbiddenItems = Collections.unmodifiableList(forbiddenItems); } } From 5bc2daf37ae730ba4b907812f1f491b2bdfd1809 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 16 Jul 2026 16:39:56 +0200 Subject: [PATCH 08/19] Add GameModeConfig.KitsConfig.MaxBlastResistance for disabling all Blocks with more than 9.0 blast resistance --- CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index da2cf442..82ab638b 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -930,7 +930,7 @@ public final class GameModeConfig { public final boolean PersonalKits; /** - * Maximal blast resistance for the blocks + * Maximal blast resistance for the blocks in the kit * * @implSpec {@code 9.0} by default */ From a8c68864d88f1077f05e2ce43db5218eee975ea1 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Thu, 16 Jul 2026 17:07:37 +0200 Subject: [PATCH 09/19] Fix AutoChecker only counts filled Dispenser --- .../de/steamwar/schematicsystem/autocheck/AutoChecker.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java index 1d7c0d68..aaf0aa85 100644 --- a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java +++ b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java @@ -73,10 +73,13 @@ public class AutoChecker { continue; } - result.getBlockCounts().merge(material, 1, Integer::sum); - if (AutoCheckerItems.impl.getInventoryMaterials().contains(material)) { checkInventory(result, block, material, new BlockPos(x, y, z), type); + if (result.getDispenserItems().get(new BlockPos(x, y, z)) != null && result.getDispenserItems().get(new BlockPos(x, y, z)) > 0) { + result.getBlockCounts().merge(material, 1, Integer::sum); + } + } else { + result.getBlockCounts().merge(material, 1, Integer::sum); } if (x == min.x() || x == max.x() || y == max.y() || z == min.z() || z == max.z()) { From a59e9b4343dac1cbb44bc810d5c7d4533dab5687 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 17 Jul 2026 10:06:48 +0200 Subject: [PATCH 10/19] Closes: #323 --- .../steamwar/bausystem/features/tracer/TraceRecorder.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java index c976fa14..0c2936ec 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceRecorder.java @@ -135,6 +135,13 @@ public class TraceRecorder implements Listener { Iterator iter = trackedTNT.getOrDefault(region, Collections.emptyList()).iterator(); while (iter.hasNext()) { TNTPrimed tnt = iter.next(); + if (tnt.isDead()) { + iter.remove(); + tntSpawnRegion.remove(tnt); + historyMap.remove(tnt); + tntSpawnRegion.remove(tnt); + continue; + } if (tnt.getFuseTicks() == 80) continue; TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList()); if (record == null) { From e0f26c3e8da30db762b3a8023141a095162ecdaa Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 17 Jul 2026 12:03:15 +0200 Subject: [PATCH 11/19] Delete event relations when fights and groups are removed --- .../SQL/src/de/steamwar/sql/EventFight.kt | 3 ++- .../SQL/src/de/steamwar/sql/EventGroup.kt | 7 +++++-- .../SQL/src/de/steamwar/sql/EventRelation.kt | 21 ++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/EventFight.kt b/CommonCore/SQL/src/de/steamwar/sql/EventFight.kt index bdbce609..285a01f9 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/EventFight.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/EventFight.kt @@ -237,6 +237,7 @@ class EventFight(id: EntityID) : IntEntity(id), Comparable { override fun delete() = useDb { + EventRelation.deleteRelations(this@EventFight) super.delete() } -} \ No newline at end of file +} diff --git a/CommonCore/SQL/src/de/steamwar/sql/EventGroup.kt b/CommonCore/SQL/src/de/steamwar/sql/EventGroup.kt index 7b20e648..cccbc570 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/EventGroup.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/EventGroup.kt @@ -159,10 +159,13 @@ class EventGroup(id: EntityID) : IntEntity(id) { } override fun delete() = - useDb { super.delete() } + useDb { + EventRelation.deleteRelations(this@EventGroup) + super.delete() + } enum class EventGroupType { GROUP_STAGE, ELIMINATION_STAGE } -} \ No newline at end of file +} diff --git a/CommonCore/SQL/src/de/steamwar/sql/EventRelation.kt b/CommonCore/SQL/src/de/steamwar/sql/EventRelation.kt index 91ccb9db..41e1bb8c 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/EventRelation.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/EventRelation.kt @@ -24,8 +24,10 @@ import org.jetbrains.exposed.v1.core.and import org.jetbrains.exposed.v1.core.dao.id.EntityID import org.jetbrains.exposed.v1.core.dao.id.IntIdTable import org.jetbrains.exposed.v1.core.eq +import org.jetbrains.exposed.v1.core.or import org.jetbrains.exposed.v1.dao.IntEntity import org.jetbrains.exposed.v1.dao.IntEntityClass +import org.jetbrains.exposed.v1.jdbc.deleteWhere import org.jetbrains.exposed.v1.jdbc.select object EventRelationTable : IntIdTable("EventRelation") { @@ -59,6 +61,23 @@ class EventRelation(id: EntityID) : IntEntity(id) { fun getGroupRelations(group: EventGroup) = useDb { find { (EventRelationTable.fromId eq group.id.value) and (EventRelationTable.fromType eq FromType.GROUP) }.toList() } + @JvmStatic + fun deleteRelations(fight: EventFight) = + useDb { + EventRelationTable.deleteWhere { + (EventRelationTable.fightId eq fight.id) or + ((EventRelationTable.fromId eq fight.id.value) and (EventRelationTable.fromType eq FromType.FIGHT)) + } + } + + @JvmStatic + fun deleteRelations(group: EventGroup) = + useDb { + EventRelationTable.deleteWhere { + (EventRelationTable.fromId eq group.id.value) and (EventRelationTable.fromType eq FromType.GROUP) + } + } + @JvmStatic fun create(fight: EventFight, fightTeam: FightTeam, fromType: FromType, fromId: Int, fromPlace: Int) = useDb { @@ -159,4 +178,4 @@ class EventRelation(id: EntityID) : IntEntity(id) { enum class FromType { FIGHT, GROUP } -} \ No newline at end of file +} From 582d6a62e36fd59fe5568eedce1a6b63b014f6ab Mon Sep 17 00:00:00 2001 From: Sakziea Date: Fri, 17 Jul 2026 14:22:36 +0200 Subject: [PATCH 12/19] Fix PullRequest comment --- .../de/steamwar/schematicsystem/autocheck/AutoChecker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java index aaf0aa85..19ab4247 100644 --- a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java +++ b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java @@ -73,9 +73,11 @@ public class AutoChecker { continue; } + BlockPos pos = new BlockPos(x, y, z); + if (AutoCheckerItems.impl.getInventoryMaterials().contains(material)) { - checkInventory(result, block, material, new BlockPos(x, y, z), type); - if (result.getDispenserItems().get(new BlockPos(x, y, z)) != null && result.getDispenserItems().get(new BlockPos(x, y, z)) > 0) { + checkInventory(result, block, material, pos, type); + if (result.getDispenserItems().getOrDefault(pos, 0) > 0) { result.getBlockCounts().merge(material, 1, Integer::sum); } } else { From 25ab79abc0290eabba879bf8ae27c9169de11740 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Fri, 17 Jul 2026 14:23:55 +0200 Subject: [PATCH 13/19] Fix PullRequest comment --- .../src/de/steamwar/schematicsystem/autocheck/AutoChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java index 19ab4247..6fa2be03 100644 --- a/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java +++ b/SchematicSystem/src/de/steamwar/schematicsystem/autocheck/AutoChecker.java @@ -85,7 +85,7 @@ public class AutoChecker { } if (x == min.x() || x == max.x() || y == max.y() || z == min.z() || z == max.z()) { - result.getDesignBlocks().computeIfAbsent(material, m -> new ArrayList<>()).add(new BlockPos(x, y, z)); + result.getDesignBlocks().computeIfAbsent(material, m -> new ArrayList<>()).add(pos); } } } From 95119fc93fb78a2845314cd02bfbe69ba0dd8132 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 17 Jul 2026 16:40:38 +0200 Subject: [PATCH 14/19] Fix FightServer.kt and VelocityServer.kt @get:Optional annotations complaining about primitive types of field --- buildSrc/src/main/kotlin/FightServer.kt | 8 ++++---- buildSrc/src/main/kotlin/VelocityServer.kt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/FightServer.kt b/buildSrc/src/main/kotlin/FightServer.kt index 0788da17..a3b9411a 100644 --- a/buildSrc/src/main/kotlin/FightServer.kt +++ b/buildSrc/src/main/kotlin/FightServer.kt @@ -25,15 +25,15 @@ open class FightServer : DevServer() { @get:Input @get:Optional - var checkSchemID: Int = 0 + var checkSchemID: Int? = 0 @get:Input @get:Optional - var prepareSchemID: Int = 0 + var prepareSchemID: Int? = 0 @get:Input @get:Optional - var replay: Int = 0 + var replay: Int? = 0 @get:Input @get:Optional @@ -42,7 +42,7 @@ open class FightServer : DevServer() { // Property: fightID @get:Input @get:Optional - var eventKampfID: Int = 0 + var eventKampfID: Int? = 0 @get:Input @get:Optional diff --git a/buildSrc/src/main/kotlin/VelocityServer.kt b/buildSrc/src/main/kotlin/VelocityServer.kt index b314981e..b3ca4952 100644 --- a/buildSrc/src/main/kotlin/VelocityServer.kt +++ b/buildSrc/src/main/kotlin/VelocityServer.kt @@ -24,11 +24,11 @@ open class VelocityServer : DevServer() { @get:Input @get:Optional - var packetDecodeLogging: Boolean = false + var packetDecodeLogging: Boolean? = false init { doFirst { - if (packetDecodeLogging) dParams.put("velocity.packet-decode-logging", "true") + if (packetDecodeLogging == true) dParams.put("velocity.packet-decode-logging", "true") } } } From e5cc874834cbc12f5b6e993d1689e5117cf46bb1 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 11:08:51 +0200 Subject: [PATCH 15/19] Fix Windcharge remove Water --- .../src/de/steamwar/fightsystem/listener/WaterRemover.java | 1 + 1 file changed, 1 insertion(+) 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 c85da5ce..4ff136b1 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java @@ -72,6 +72,7 @@ public class WaterRemover implements Listener { @EventHandler public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.TNT) return; event.setYield(0); //No drops (additionally to world config) FightTeam spawn = tnt.remove(event.getEntity().getEntityId()); From 801678ddd3997ded7a5baf3efe821f34a2f64235 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:43:23 +0200 Subject: [PATCH 16/19] Fix Wind charges cross middle and interact with Blocks --- .../fightsystem/listener/Windcharge.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java new file mode 100644 index 00000000..9c1f86a3 --- /dev/null +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java @@ -0,0 +1,88 @@ +/* + * 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.fightsystem.listener; + +import de.steamwar.fightsystem.Config; +import de.steamwar.fightsystem.FightSystem; +import de.steamwar.fightsystem.fight.FightWorld; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentListener; +import de.steamwar.fightsystem.states.StateDependentTask; +import de.steamwar.linkage.Linked; +import io.papermc.paper.event.entity.EntityMoveEvent; +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntitySpawnEvent; + +import java.util.HashSet; +import java.util.Set; + +@Linked +public class Windcharge implements Listener { + + private static final int middleLine = Config.SpecSpawn.getBlockZ(); + + private final Set windcharges = new HashSet<>(); + + public Windcharge() { + new StateDependentListener(true, FightState.Running, this); + new StateDependentTask(true, FightState.Running, this::run, 1, 1); + } + + @EventHandler + public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + if (!Config.WindchargesInteractWithBlocks) { + event.blockList().clear(); + } + if (!Config.WindchargesCanCrossMiddle) { + windcharges.remove(event.getEntity()); + } + } + + @EventHandler + public void handleEntitySpawnEvent(EntitySpawnEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + if (!Config.WindchargesCanCrossMiddle) { + windcharges.add(event.getEntity()); + } + } + + public void run() { + if (!Config.WindchargesCanCrossMiddle) { + windcharges.forEach(entity -> { + Location nextlocation = entity.getLocation().add(entity.getVelocity()); + Location location = entity.getLocation(); + + boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || + nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; + + if (passedMiddle) { + windcharges.remove(entity); + entity.remove(); + } + }); + } + } +} From 8b6ea12a08031398563afdae29919bd3c28aa5f2 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:43:46 +0200 Subject: [PATCH 17/19] Add Wind charge config --- FightSystem/FightSystem_Core/src/config.yml | 2 ++ .../FightSystem_Core/src/de/steamwar/fightsystem/Config.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/FightSystem/FightSystem_Core/src/config.yml b/FightSystem/FightSystem_Core/src/config.yml index 81620820..a080d253 100644 --- a/FightSystem/FightSystem_Core/src/config.yml +++ b/FightSystem/FightSystem_Core/src/config.yml @@ -64,6 +64,8 @@ Arena: AllowMissiles: false # defaults to true if EnterStages are present otherwise 'false' # Denotes that there is no floor for this GameMode NoFloor: false # defaults to false if missing + windchargesCanCrossMiddle: false # defaults to false if missing + windchargesInteractWithBlocks: false # defaults to false if missing Schematic: # The size of the schematics diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index c8a5883c..3ad22480 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -64,6 +64,9 @@ public class Config { private static final int BlueToRedY; public static final int BlueToRedZ; + public static final boolean WindchargesCanCrossMiddle; + public static final boolean WindchargesInteractWithBlocks; + //schematic parameter public static final boolean OnlyPublicSchematics; @@ -102,6 +105,8 @@ public class Config { CheckSchemID = Integer.parseInt(System.getProperty("checkSchemID", "0")); PrepareSchemID = Integer.parseInt(System.getProperty("prepareSchemID", "0")); ReplayID = Integer.parseInt(System.getProperty("replay", "0")); + WindchargesCanCrossMiddle = Boolean.getBoolean(System.getProperty("windchargesCanCrossMiddle", "false")); + WindchargesInteractWithBlocks = Boolean.getBoolean(System.getProperty("windchargesInteractWithBlocks", "false")); String configFile = System.getProperty("config", "config.yml"); if (!new File(FightSystem.getPlugin().getDataFolder(), configFile).exists()) { From b48c75ef7439cabe48a42233975d2b17f46f23af Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 12:49:23 +0200 Subject: [PATCH 18/19] Remove unused imports --- .../src/de/steamwar/fightsystem/listener/Windcharge.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java index 9c1f86a3..f2a90869 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java @@ -20,13 +20,10 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.Config; -import de.steamwar.fightsystem.FightSystem; -import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentTask; import de.steamwar.linkage.Linked; -import io.papermc.paper.event.entity.EntityMoveEvent; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; From 1d2ac4f705facce622fee074e5fbbdfe8322f5a5 Mon Sep 17 00:00:00 2001 From: Sakziea Date: Sat, 18 Jul 2026 14:58:24 +0200 Subject: [PATCH 19/19] Fix pull Request comment --- .../src/de/steamwar/sql/GameModeConfig.java | 24 ++++++ FightSystem/FightSystem_Core/src/config.yml | 6 +- .../src/de/steamwar/fightsystem/Config.java | 5 -- .../fightsystem/listener/WaterRemover.java | 4 +- .../fightsystem/listener/Windcharge.java | 85 ------------------- .../WindchargeInteractionDisabler.java | 44 ++++++++++ .../listener/WindchargeStopper.java | 12 +-- 7 files changed, 81 insertions(+), 99 deletions(-) delete mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java create mode 100644 FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index 82ab638b..87c6bdb1 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -488,6 +488,27 @@ public final class GameModeConfig { */ public final boolean NoFloor; + /** + * Allows Wind Charges to cross the Middle. + * + * @implSpec {@code false} by default + */ + public final boolean WindchargesCanCrossMiddle; + + /** + * Allows Wind Charge interaction with Blocks. + * + * @implSpec {@code true} by default + */ + public final boolean WindchargesInteractWithBlocks; + + /** + * Allows Wind Charge to destroy Water. + * + * @implSpec {@code false} by default + */ + public final boolean WindchargesDestroyWater; + private ArenaConfig(YMLWrapper loader, SchematicConfig.SizeConfig Size, List EnterStages) { loaded = loader.canLoad(); WaterDepth = loader.getInt("WaterDepth", 0); @@ -505,6 +526,9 @@ public final class GameModeConfig { Leaveable = loader.getBoolean("Leaveable", false); AllowMissiles = loader.getBoolean("AllowMissiles", !EnterStages.isEmpty()); NoFloor = loader.getBoolean("NoFloor", false); + WindchargesCanCrossMiddle = loader.getBoolean("WindchargesCanCrossMiddle", false); + WindchargesInteractWithBlocks = loader.getBoolean("WindchargesInteractWithBlocks", true); + WindchargesDestroyWater = loader.getBoolean("WindchargesDestroyWater", false); } @ToString diff --git a/FightSystem/FightSystem_Core/src/config.yml b/FightSystem/FightSystem_Core/src/config.yml index a080d253..185704d5 100644 --- a/FightSystem/FightSystem_Core/src/config.yml +++ b/FightSystem/FightSystem_Core/src/config.yml @@ -64,8 +64,10 @@ Arena: AllowMissiles: false # defaults to true if EnterStages are present otherwise 'false' # Denotes that there is no floor for this GameMode NoFloor: false # defaults to false if missing - windchargesCanCrossMiddle: false # defaults to false if missing - windchargesInteractWithBlocks: false # defaults to false if missing + # Allows Wind Charges to cross the Middle. + WindchargesCanCrossMiddle: false # defaults to false if missing + # Allows Wind Charge interaction with Blocks. + WindchargesInteractWithBlocks: false # defaults to false if missing Schematic: # The size of the schematics diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java index 3ad22480..c8a5883c 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/Config.java @@ -64,9 +64,6 @@ public class Config { private static final int BlueToRedY; public static final int BlueToRedZ; - public static final boolean WindchargesCanCrossMiddle; - public static final boolean WindchargesInteractWithBlocks; - //schematic parameter public static final boolean OnlyPublicSchematics; @@ -105,8 +102,6 @@ public class Config { CheckSchemID = Integer.parseInt(System.getProperty("checkSchemID", "0")); PrepareSchemID = Integer.parseInt(System.getProperty("prepareSchemID", "0")); ReplayID = Integer.parseInt(System.getProperty("replay", "0")); - WindchargesCanCrossMiddle = Boolean.getBoolean(System.getProperty("windchargesCanCrossMiddle", "false")); - WindchargesInteractWithBlocks = Boolean.getBoolean(System.getProperty("windchargesInteractWithBlocks", "false")); String configFile = System.getProperty("config", "config.yml"); if (!new File(FightSystem.getPlugin().getDataFolder(), configFile).exists()) { 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 4ff136b1..bded9613 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WaterRemover.java @@ -72,7 +72,9 @@ public class WaterRemover implements Listener { @EventHandler public void handleEntityExplode(EntityExplodeEvent event) { - if (event.getEntityType() != EntityType.TNT) return; + if (event.getEntityType() == EntityType.WIND_CHARGE && !Config.GameModeConfig.Arena.WindchargesDestroyWater) { + return; + } event.setYield(0); //No drops (additionally to world config) FightTeam spawn = tnt.remove(event.getEntity().getEntityId()); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java deleted file mode 100644 index f2a90869..00000000 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Windcharge.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.fightsystem.listener; - -import de.steamwar.fightsystem.Config; -import de.steamwar.fightsystem.states.FightState; -import de.steamwar.fightsystem.states.StateDependentListener; -import de.steamwar.fightsystem.states.StateDependentTask; -import de.steamwar.linkage.Linked; -import org.bukkit.Location; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntitySpawnEvent; - -import java.util.HashSet; -import java.util.Set; - -@Linked -public class Windcharge implements Listener { - - private static final int middleLine = Config.SpecSpawn.getBlockZ(); - - private final Set windcharges = new HashSet<>(); - - public Windcharge() { - new StateDependentListener(true, FightState.Running, this); - new StateDependentTask(true, FightState.Running, this::run, 1, 1); - } - - @EventHandler - public void handleEntityExplode(EntityExplodeEvent event) { - if (event.getEntityType() != EntityType.WIND_CHARGE) return; - if (!Config.WindchargesInteractWithBlocks) { - event.blockList().clear(); - } - if (!Config.WindchargesCanCrossMiddle) { - windcharges.remove(event.getEntity()); - } - } - - @EventHandler - public void handleEntitySpawnEvent(EntitySpawnEvent event) { - if (event.getEntityType() != EntityType.WIND_CHARGE) return; - if (!Config.WindchargesCanCrossMiddle) { - windcharges.add(event.getEntity()); - } - } - - public void run() { - if (!Config.WindchargesCanCrossMiddle) { - windcharges.forEach(entity -> { - Location nextlocation = entity.getLocation().add(entity.getVelocity()); - Location location = entity.getLocation(); - - boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || - nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; - - if (passedMiddle) { - windcharges.remove(entity); - entity.remove(); - } - }); - } - } -} diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.java new file mode 100644 index 00000000..7c518b2a --- /dev/null +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeInteractionDisabler.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.fightsystem.listener; + +import de.steamwar.fightsystem.Config; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentListener; +import de.steamwar.linkage.Linked; +import org.bukkit.entity.EntityType; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; + +@Linked +public class WindchargeInteractionDisabler implements Listener { + + public WindchargeInteractionDisabler() { + new StateDependentListener(!Config.GameModeConfig.Arena.WindchargesInteractWithBlocks, FightState.Running, this); + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void handleEntityExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.WIND_CHARGE) return; + event.blockList().clear(); + } +} diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java index 9abfc92d..a750a1b9 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/WindchargeStopper.java @@ -23,14 +23,14 @@ import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentTask; import de.steamwar.linkage.Linked; +import net.minecraft.world.entity.projectile.windcharge.WindCharge; import org.bukkit.Location; -import org.bukkit.entity.WindCharge; @Linked public class WindchargeStopper { public WindchargeStopper() { - new StateDependentTask(true, FightState.Running, this::run, 1, 1); + new StateDependentTask(!Config.GameModeConfig.Arena.WindchargesCanCrossMiddle, FightState.Running, this::run, 1, 1); } private static final int middleLine = Config.SpecSpawn.getBlockZ(); @@ -39,13 +39,13 @@ public class WindchargeStopper { private void run() { Recording.iterateOverEntities(windChargeClass::isInstance, entity -> { + Location nextlocation = entity.getLocation().add(entity.getVelocity()); Location location = entity.getLocation(); - Location prevLocation = location.clone().subtract(entity.getVelocity()); - boolean passedMiddle = location.getBlockZ() > middleLine && prevLocation.getBlockZ() > middleLine || - location.getBlockZ() < middleLine && prevLocation.getBlockZ() < middleLine; + boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine || + nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine; - if (!passedMiddle) { + if (passedMiddle) { entity.remove(); } });