mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Some cleanup to how tiles are created
This commit is contained in:
@ -35,6 +35,7 @@ use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\IntTag;
|
||||
use pocketmine\nbt\tag\ListTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\Player;
|
||||
|
||||
class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
|
||||
@ -287,4 +288,12 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
$nbt->CustomName = $this->namedtag->CustomName;
|
||||
}
|
||||
}
|
||||
|
||||
protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{
|
||||
$nbt->Items = new ListTag("Items", [], NBT::TAG_Compound);
|
||||
|
||||
if($item !== null and $item->hasCustomName()){
|
||||
$nbt->CustomName = new StringTag("CustomName", $item->getCustomName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user