forked from SteamWar/SteamWar
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.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user