Entity: fixed motion not being initialized when Motion NBT tag is missing

fixes CA 2355485
This commit is contained in:
Dylan K. Taylor 2019-05-02 14:00:28 +01:00
parent d850a84d0d
commit d7a35a5302

View File

@ -593,6 +593,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
throw new \InvalidStateException("Cannot create entities in unloaded chunks");
}
$this->motion = new Vector3(0, 0, 0);
if($this->namedtag->hasTag("Motion", ListTag::class)){
/** @var float[] $motion */
$motion = $this->namedtag->getListTag("Motion")->getAllValues();