Fix some issues with entities in leveldb worlds

This commit is contained in:
Dylan K. Taylor 2017-07-02 13:37:30 +01:00
parent 2a67507997
commit b4a149cce8
2 changed files with 11 additions and 2 deletions

View File

@ -359,8 +359,11 @@ abstract class Entity extends Location implements Metadatable{
$this->namedtag->Rotation[1]
);
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));

View File

@ -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);