From 8411db57a1349100f3542010c2ccd84e76cb5aa8 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 9 Feb 2025 22:00:51 +0100 Subject: [PATCH] Update flag capture radius to use configurable value Replaced the hardcoded 10-block radius with a configurable value from GameConfig.FLAG.CAPTURE_RADIUS. This ensures the capture radius can be easily adjusted without code changes and improves flexibility. --- src/main/java/com/alttd/ctf/flag/Flag.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/alttd/ctf/flag/Flag.java b/src/main/java/com/alttd/ctf/flag/Flag.java index 7dd087b..7e90c6b 100644 --- a/src/main/java/com/alttd/ctf/flag/Flag.java +++ b/src/main/java/com/alttd/ctf/flag/Flag.java @@ -119,7 +119,7 @@ public class Flag implements Runnable { } private void spawnParticlesOnSquareBorder(World world, Location center) { - double size = 10; + double size = GameConfig.FLAG.CAPTURE_RADIUS; double step = 0.2; Location finalCenter = center.clone().add(0, 0.5, 0); Bukkit.getScheduler().runTask(main, () -> { @@ -214,7 +214,7 @@ public class Flag implements Runnable { /** * Updates the score of teams based on the nearby players within a specified range. - * This method identifies nearby players around the current location within a 10-block radius, + * This method identifies nearby players around the current location within a CAPTURE_RADIUS-block radius, * determines their respective teams, and calculates the team with the maximum number of players * in proximity. If there is a tie for the maximum count, the method exits without updating scores. * If a single team has the highest number of nearby players, scores are updated accordingly: