geforkt von Mirrors/Paper
Implement API for mob despawn when away from players. Adds BUKKIT-2986
As of 1.4 mobs have a flag to determine if they despawn when away from a player or not. Unfortunately animals still use their own system to prevent despawning instead of making use of this flag. This change modifies them to use the new system (defaults to true) and to add API for plugins to adjust this. By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Ursprung
921c568632
Commit
e506472f08
@ -303,4 +303,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public boolean hasLineOfSight(Entity other) {
|
||||
return getHandle().aA().canSee(((CraftEntity) other).getHandle()); // az should be getEntitySenses
|
||||
}
|
||||
|
||||
public boolean getRemoveWhenFarAway() {
|
||||
return !getHandle().persistent;
|
||||
}
|
||||
|
||||
public void setRemoveWhenFarAway(boolean remove) {
|
||||
getHandle().persistent = !remove;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren