mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +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\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\nbt\NBT;
|
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
use pocketmine\nbt\tag\CompoundTag;
|
||||||
use pocketmine\nbt\tag\ListTag;
|
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
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{
|
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()){
|
if($item !== null and $item->hasCustomName()){
|
||||||
$nbt->setString("CustomName", $item->getCustomName());
|
$nbt->setString("CustomName", $item->getCustomName());
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,7 @@ use pocketmine\item\Item;
|
|||||||
use pocketmine\item\ItemFactory;
|
use pocketmine\item\ItemFactory;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\nbt\NBT;
|
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
use pocketmine\nbt\tag\CompoundTag;
|
||||||
use pocketmine\nbt\tag\ListTag;
|
|
||||||
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
|
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
|
||||||
use pocketmine\Player;
|
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{
|
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()){
|
if($item !== null and $item->hasCustomName()){
|
||||||
$nbt->setString("CustomName", $item->getCustomName());
|
$nbt->setString("CustomName", $item->getCustomName());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user