51 use AnimatedContainerLikeTrait;
61 $shulker = $this->position->getWorld()->getTile($this->position);
62 if($shulker instanceof TileShulkerBox){
63 $shulker->setFacing($this->facing);
68 parent::readStateFromWorld();
69 $shulker = $this->position->getWorld()->getTile($this->position);
70 if($shulker instanceof TileShulkerBox){
71 $this->facing = $shulker->getFacing();
82 $this->facing = $face;
84 return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
87 private function addDataFromTile(TileShulkerBox $tile,
Item $item) : void{
88 $shulkerNBT = $tile->getCleanedNBT();
89 if($shulkerNBT !==
null){
93 $item->setCustomName($tile->getName());
98 $drop = $this->asItem();
99 if(($tile = $this->position->getWorld()->getTile($this->position)) instanceof TileShulkerBox){
100 $this->addDataFromTile($tile, $drop);
106 $result = parent::getPickedItem($addUserData);
107 if($addUserData && ($tile = $this->position->getWorld()->getTile($this->position)) instanceof TileShulkerBox){
108 $this->addDataFromTile($tile, $result);
114 return $this->getSide($this->facing)->isSolid();
122 return SupportType::NONE;
125 protected function getOpenSound() :
Sound{
129 protected function getCloseSound() : Sound{
130 return new ShulkerBoxCloseSound();
133 protected function playAnimationVisual(Position $position,
bool $isOpen) : void{
136 $position->getWorld()->broadcastPacketToViewers($position, BlockEventPacket::create(BlockPosition::fromVector3($position), 1, $isOpen ? 1 : 0));
place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, Facing $face, Vector3 $clickVector, ?Player $player=null)