mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
World: ignore entities calling onEntityMoved() who aren't members of the world
this can happen if movement or teleportation occurs during the creation of an entity.
This commit is contained in:
parent
b2bab6c2fb
commit
1f330c0f50
@ -2180,6 +2180,10 @@ class World implements ChunkManager{
|
||||
* @internal
|
||||
*/
|
||||
public function onEntityMoved(Entity $entity, Position $oldPosition) : void{
|
||||
if(!array_key_exists($entity->getId(), $this->entities)){
|
||||
//this can happen if the entity was teleported before addEntity() was called
|
||||
return;
|
||||
}
|
||||
$newPosition = $entity->getPosition();
|
||||
|
||||
$oldChunkX = $oldPosition->getFloorX() >> 4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user