mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 12:11:47 +01:00
Update entity state correctly when marked as persistent. Fixes BUKKIT-3123
When a mob is marked with the persistent flag (animal or anything with setRemoveWhenFarAway(false)) the entire block of code for checking if they should be despawned is skipped. However, one part of this code updates the mob state if a player is close enough to them. It turns out this state is used by the AI system to decide if the mob should move around randomly or not. To stop mobs from being frozen in place we now update this state if the persistent flag is set as well.
This commit is contained in:
parent
846a22304c
commit
9973e7cdec
1 changed files with 4 additions and 0 deletions
|
@ -1413,7 +1413,11 @@ public abstract class EntityLiving extends Entity {
|
|||
this.bA = 0;
|
||||
}
|
||||
}
|
||||
// CraftBukkit start
|
||||
} else {
|
||||
this.bA = 0;
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected void bl() {
|
||||
|
|
Loading…
Reference in a new issue