mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Container tiles: remove unnecessary ListTag Items creation
the existence of this tag is checked for anyway.
This commit is contained in:
parent
280f2b7259
commit
556a465c05
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user