mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
use ??
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user