mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
Fixed entities not loading on imported MCPE worlds
This commit is contained in:
parent
b8d1eb20b0
commit
3dbed830ef
@ -207,6 +207,9 @@ final class EntityFactory{
|
||||
*/
|
||||
public static function createFromData(Level $level, CompoundTag $nbt) : ?Entity{
|
||||
$saveId = $nbt->getTag("id");
|
||||
if($saveId === null){
|
||||
$saveId = $nbt->getTag("identifier"); //new MCPE format
|
||||
}
|
||||
$baseClass = null;
|
||||
if($saveId instanceof StringTag){
|
||||
$baseClass = self::$knownEntities[$saveId->getValue()] ?? null;
|
||||
|
@ -586,7 +586,7 @@ class Chunk{
|
||||
try{
|
||||
$entity = EntityFactory::createFromData($level, $nbt);
|
||||
if(!($entity instanceof Entity)){
|
||||
$level->getServer()->getLogger()->warning("Chunk $this->x $this->z: Deleted unknown entity type " . $nbt->getString("id", "<unknown>", true));
|
||||
$level->getServer()->getLogger()->warning("Chunk $this->x $this->z: Deleted unknown entity type " . $nbt->getString("id", $nbt->getString("identifier", "<unknown>", true), true));
|
||||
$changed = true;
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user