From adbc298909d2511f76ba32b29d4aeb0dc0cf660b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 27 Jun 2017 15:57:37 +0100 Subject: [PATCH] Fixed item CompoundTags keeping the `tag` name after NBT serialize/deserialize, close #1145 --- src/pocketmine/item/Item.php | 4 +++- tests/plugins/PocketMine-TesterPlugin | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 2cad38717..377eb507f 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -1059,7 +1059,9 @@ class Item implements ItemIds, \JsonSerializable{ } if(isset($tag->tag) and $tag->tag instanceof CompoundTag){ - $item->setNamedTag($tag->tag); + $t = clone $tag->tag; + $t->setName(""); + $item->setNamedTag($t); } return $item; diff --git a/tests/plugins/PocketMine-TesterPlugin b/tests/plugins/PocketMine-TesterPlugin index 9c5ea394b..ddac19dbb 160000 --- a/tests/plugins/PocketMine-TesterPlugin +++ b/tests/plugins/PocketMine-TesterPlugin @@ -1 +1 @@ -Subproject commit 9c5ea394b0295549fa2c12cb090aad4519877b3a +Subproject commit ddac19dbbdd9e8b71611ab7fb91069619fcba6f9