From 6c99f1f9c942c52add500e1fdc75cc472dc5b32d Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Tue, 27 Oct 2026 10:12:07 +0100 Subject: [PATCH] Resend hull chunks to non-viewers after hull initialisation Chunks encoded while the hull was filled as hidden contain obfuscated blocks that become visible after initialize, and no block update is generated for them. Reload the team's extend region for all players that cannot see the hull. --- .../src/de/steamwar/fightsystem/utils/Hull.java | 2 +- .../src/de/steamwar/fightsystem/utils/HullHider.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java index 91fe96c0..0248f46b 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/Hull.java @@ -101,7 +101,7 @@ public class Hull { return !isViewer(player) && region.inRegion(location) && !visibility.get(new IntVector(location).toId(region)); } - private boolean isViewer(Player player) { + public boolean isViewer(Player player) { return player != null && viewers.contains(player.getUniqueId()); } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java index b7d5a54a..fe41631e 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java @@ -31,6 +31,7 @@ import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentTask; import lombok.Getter; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; @@ -70,7 +71,15 @@ public class HullHider implements Listener { public void initialize(FightTeam team) { if (!TechHiderWrapper.ENABLED) return; - hullMap.get(team).initialize(); + Hull hull = hullMap.get(team); + hull.initialize(); + + // Chunks encoded while the hull was filled as hidden contain obfuscated blocks that are visible now, but no block update is generated for them + for (Player player : Bukkit.getOnlinePlayers()) { + if (!hull.isViewer(player)) { + FightSystem.getTechHider().reloadChunks(player, team.getExtendRegion(), Region.EMPTY); + } + } } public void fill(FightTeam team, boolean visible) {