1package com.runehive.game.world.entity.mob;
3import com.runehive.game.world.entity.mob.npc.Npc;
4import com.runehive.game.world.entity.mob.player.Player;
6import java.util.LinkedList;
8import java.util.concurrent.atomic.AtomicInteger;
60 }
else if (other.
isNpc()) {
80 }
else if (other.
isNpc()) {
94 boolean sameEntity =
player == other;
95 boolean notValid = !other.
isValid();
97 boolean notSameInstance = player.instance != other.
instance;
99 boolean positionChanged = other.positionChange || other.
teleportRegion;
100 boolean regionChanged = other.regionChange && other.
teleporting;
101 return sameEntity || notValid || notVisible || notSameInstance || notInDistance || regionChanged || positionChanged;
boolean isValid()
Validates this npc based on its current region and registered state.
final EnumSet< UpdateFlag > updateFlags
final boolean isNpc()
Check if an entity is an npc.
final boolean isPlayer()
Check if an entity is a player.
boolean add(Mob other)
Adds a Mob to this viewport.
int getNpcViewingDistance()
This is how many tiles out this player can see npcs.
List< Npc > getNpcsInViewport()
The collection of npcs in this viewport.
final List< Player > playersInViewport
The collection of players that are visible in this viewport.
final AtomicInteger playerViewingDistance
The amount of tiles out this mob can see players.
void calculateViewingDistance()
Determines how many tiles out a player can see players or npcs.
static final int VIEW_DISTANCE
The amount of tiles out an entity can see within this viewport.
final Player player
The player that this viewport belongs to.
final AtomicInteger npcViewingDistance
The amount of tiles out this mob can see npcs.
boolean shouldRemove(Mob other)
Determines if a Mob should be removed from this viewport.
final List< Npc > npcsInViewport
The collection of npcs that are visible in this viewport.
static final int ADD_THRESHOLD
The amount of entities that can be added to this viewport in a single tick.
int getPlayerViewingDistance()
How many tiles out this player can see other players.
static final int CAPACITY
The amount of entities that can be visible at all at once 255 players and 255 npcs.
List< Player > getPlayersInViewport()
The collection of players in this viewport.
boolean canAdd(Mob other)
Determines if a Mob can be added to this viewport.
Represents a non-player character in the in-game world.
This class represents a character controlled by a player.
Position copy()
Creates a deep copy of this location.