Added ability to specify tag name for serializing

This commit is contained in:
Dylan K. Taylor 2016-11-27 12:17:11 +00:00
parent 3b3abab3ad
commit aa713c4e4a

View File

@ -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),