mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +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
|
* @return CompoundTag
|
||||||
*/
|
*/
|
||||||
public function nbtSerialize(int $slot = -1) : CompoundTag{
|
public function nbtSerialize(int $slot = -1, string $tagName = "") : CompoundTag{
|
||||||
$tag = new CompoundTag(null, [
|
$tag = new CompoundTag($tagName, [
|
||||||
"id" => new ShortTag("id", $this->id),
|
"id" => new ShortTag("id", $this->id),
|
||||||
"Count" => new ByteTag("Count", $this->count ?? -1),
|
"Count" => new ByteTag("Count", $this->count ?? -1),
|
||||||
"Damage" => new ShortTag("Damage", $this->meta),
|
"Damage" => new ShortTag("Damage", $this->meta),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user