Remove Hull primary direction

This commit is contained in:
2026-10-31 12:49:28 +01:00
parent 6c99f1f9c9
commit fc090c2b48
@@ -78,10 +78,8 @@ public class Hull {
this.occluding = new BitSet(region.volume());
this.visibility = new BitSet(region.volume());
IntVector primaryDirection = new IntVector(0, 0, team.isBlue() == (Config.BlueToRedZ > 0) ? -1 : 1);
directions = IntStream.range(0, 27)
.mapToObj(v -> new IntVector(v % 3 - 1, (v / 3) % 3 - 1, v / 9 - 1))
.filter(v -> v.sqLength() == 1 || v.x * primaryDirection.x + v.y * primaryDirection.y + v.z * primaryDirection.z == 1) // Not pointing away from primary direction
.toArray(IntVector[]::new);
for (IntVector direction : directions) {
@@ -89,18 +87,10 @@ public class Hull {
}
}
public boolean blockPrecise(Player player, int chunkX, int chunkY, int chunkZ) {
return !isViewer(player) && !region.chunkSectionOutside(chunkX, chunkY, chunkZ);
}
public boolean isBlockHidden(Player player, int x, int y, int z) {
return region.inRegion(x, y, z) && !isViewer(player) && !visibility.get(((y - region.getMinY()) * region.getSizeZ() + (z - region.getMinZ())) * region.getSizeX() + (x - region.getMinX()));
}
public boolean isLocationHidden(Player player, Location location) {
return !isViewer(player) && region.inRegion(location) && !visibility.get(new IntVector(location).toId(region));
}
public boolean isViewer(Player player) {
return player != null && viewers.contains(player.getUniqueId());
}