This commit is contained in:
Dylan K. Taylor
2019-03-22 13:42:06 +00:00
parent d03f0aab37
commit 9b11e39efc

View File

@ -206,10 +206,7 @@ final class EntityFactory{
* @throws \RuntimeException * @throws \RuntimeException
*/ */
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") ?? $nbt->getTag("identifier");
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;