mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Added ability to specify tag name for serializing
This commit is contained in:
parent
3b3abab3ad
commit
aa713c4e4a
@ -778,8 +778,8 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
*
|
||||
* @return CompoundTag
|
||||
*/
|
||||
public function nbtSerialize(int $slot = -1) : CompoundTag{
|
||||
$tag = new CompoundTag(null, [
|
||||
public function nbtSerialize(int $slot = -1, string $tagName = "") : CompoundTag{
|
||||
$tag = new CompoundTag($tagName, [
|
||||
"id" => new ShortTag("id", $this->id),
|
||||
"Count" => new ByteTag("Count", $this->count ?? -1),
|
||||
"Damage" => new ShortTag("Damage", $this->meta),
|
||||
|
Loading…
x
Reference in New Issue
Block a user