mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Some cleanup to how tiles are created
This commit is contained in:
@ -23,8 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\tile;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\Player;
|
||||
|
||||
class EnchantTable extends Spawnable implements Nameable{
|
||||
|
||||
@ -51,4 +54,10 @@ class EnchantTable extends Spawnable implements Nameable{
|
||||
$nbt->CustomName = $this->namedtag->CustomName;
|
||||
}
|
||||
}
|
||||
|
||||
protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{
|
||||
if($item !== null and $item->hasCustomName()){
|
||||
$nbt->CustomName = new StringTag("CustomName", $item->getCustomName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user