diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 59b819723..9465fb514 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -359,8 +359,11 @@ abstract class Entity extends Location implements Metadatable{ $this->namedtag->Rotation[1] ); - - $this->setMotion($this->temporalVector->setComponents($this->namedtag["Motion"][0], $this->namedtag["Motion"][1], $this->namedtag["Motion"][2])); + if(isset($this->namedtag->Motion)){ + $this->setMotion($this->temporalVector->setComponents($this->namedtag["Motion"][0], $this->namedtag["Motion"][1], $this->namedtag["Motion"][2])); + }else{ + $this->setMotion($this->temporalVector->setComponents(0, 0, 0)); + } assert(!is_nan($this->x) and !is_infinite($this->x) and !is_nan($this->y) and !is_infinite($this->y) and !is_nan($this->z) and !is_infinite($this->z)); diff --git a/src/pocketmine/level/format/io/leveldb/LevelDB.php b/src/pocketmine/level/format/io/leveldb/LevelDB.php index 82ed0d93f..f050a7ded 100644 --- a/src/pocketmine/level/format/io/leveldb/LevelDB.php +++ b/src/pocketmine/level/format/io/leveldb/LevelDB.php @@ -403,6 +403,12 @@ class LevelDB extends BaseLevelProvider{ } } + foreach($entities as $entityNBT){ + if($entityNBT->id instanceof IntTag){ + $entityNBT["id"] &= 0xff; + } + } + $tiles = []; if(($tileData = $this->db->get($index . self::TAG_BLOCK_ENTITY)) !== false and strlen($tileData) > 0){ $nbt->read($tileData, true);