Container tiles: remove unnecessary ListTag Items creation

the existence of this tag is checked for anyway.
This commit is contained in:
Dylan K. Taylor 2018-04-13 11:27:11 +01:00
parent 280f2b7259
commit 556a465c05
2 changed files with 0 additions and 8 deletions

View File

@ -29,9 +29,7 @@ use pocketmine\inventory\InventoryHolder;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\Vector3;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\Player;
class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
@ -192,8 +190,6 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
}
protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{
$nbt->setTag(new ListTag("Items", [], NBT::TAG_Compound));
if($item !== null and $item->hasCustomName()){
$nbt->setString("CustomName", $item->getCustomName());
}

View File

@ -34,9 +34,7 @@ use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\level\Level;
use pocketmine\math\Vector3;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
use pocketmine\Player;
@ -238,8 +236,6 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
}
protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{
$nbt->setTag(new ListTag("Items", [], NBT::TAG_Compound));
if($item !== null and $item->hasCustomName()){
$nbt->setString("CustomName", $item->getCustomName());
}