130 boolean sameEntity = player == other;
131 boolean notValid = !other.
isValid();
132 boolean notVisible = !other.isVisible();
133 boolean notSameInstance = player.instance != other.instance;
134 boolean notInDistance = !player.getPosition().isWithinDistance(other.
getPosition().
copy(), other.
isPlayer() ? player.viewport.getPlayerViewingDistance() : player.viewport.getNpcViewingDistance());
135 boolean positionChanged = other.positionChange || other.teleportRegion;
136 boolean regionChanged = other.regionChange && other.teleporting;
137 return sameEntity || notValid || notVisible || notSameInstance || notInDistance || regionChanged || positionChanged;
144 if (playersInViewport.size() >= Viewport.CAPACITY) {
145 if (playerViewingDistance.decrementAndGet() < 1) {
146 playerViewingDistance.set(1);
149 if (playerViewingDistance.incrementAndGet() >
VIEW_DISTANCE) {
154 if (npcsInViewport.size() >= Viewport.CAPACITY) {
155 if (npcViewingDistance.decrementAndGet() < 1) {
156 npcViewingDistance.set(1);