134 if($face !== $this->facing){
138 $x = Facing::axis($face) === Axis::X ? $clickVector->z : $clickVector->x;
139 $slot = ChiseledBookshelfSlot::fromBlockFaceCoordinates(
140 Facing::isPositive(Facing::rotateY($face,
true)) ? 1 - $x : $x,
143 $tile = $this->position->getWorld()->getTile($this->position);
144 if(!$tile instanceof TileChiseledBookshelf){
148 $inventory = $tile->getInventory();
149 if(!$inventory->isSlotEmpty($slot->value)){
150 $returnedItems[] = $inventory->getItem($slot->value);
151 $inventory->clear($slot->value);
152 $this->setSlot($slot,
false);
153 $this->lastInteractedSlot = $slot;
154 }elseif($item instanceof WritableBookBase || $item instanceof Book || $item instanceof EnchantedBook){
156 $inventory->setItem($slot->value, $item->pop());
157 $this->setSlot($slot,
true);
158 $this->lastInteractedSlot = $slot;
163 $this->position->getWorld()->setBlock($this->position, $this);