mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 07:54:19 +00:00
ItemSerializer: fixed item NBT being discarded
I'm still not sure on the wisdom of allowing NBT usage in here ...
This commit is contained in:
parent
82f9a25d88
commit
1c689b10b9
@ -141,6 +141,15 @@ final class ItemSerializer{
|
||||
$data = $serializer($item);
|
||||
}
|
||||
|
||||
if($item->hasNamedTag()){
|
||||
$resultTag = $item->getNamedTag();
|
||||
$extraTag = $data->getTag();
|
||||
if($extraTag !== null){
|
||||
$resultTag = $resultTag->merge($extraTag);
|
||||
}
|
||||
$data = new Data($data->getName(), $data->getMeta(), $data->getBlock(), $resultTag);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user