mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 07:21:17 +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{
|
public static function createFromData(Level $level, CompoundTag $nbt) : ?Entity{
|
||||||
$saveId = $nbt->getTag("id");
|
$saveId = $nbt->getTag("id");
|
||||||
|
if($saveId === null){
|
||||||
|
$saveId = $nbt->getTag("identifier"); //new MCPE format
|
||||||
|
}
|
||||||
$baseClass = null;
|
$baseClass = null;
|
||||||
if($saveId instanceof StringTag){
|
if($saveId instanceof StringTag){
|
||||||
$baseClass = self::$knownEntities[$saveId->getValue()] ?? null;
|
$baseClass = self::$knownEntities[$saveId->getValue()] ?? null;
|
||||||
|
@ -586,7 +586,7 @@ class Chunk{
|
|||||||
try{
|
try{
|
||||||
$entity = EntityFactory::createFromData($level, $nbt);
|
$entity = EntityFactory::createFromData($level, $nbt);
|
||||||
if(!($entity instanceof Entity)){
|
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;
|
$changed = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user