ChiseledBookshelf
Extends Opaque
Implements HorizontalFacing
Methods
describeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetDropsForCompatibleTool()
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : arraygetLastInteractedSlot()
public function getLastInteractedSlot() : ?\pocketmine\block\utils\ChiseledBookshelfSlotReturns the last slot interacted by a player or null if no slot has been interacted with yet.
getSlots()
public function getSlots() : arrayReturns which slots of the bookshelf are displayed as occupied. As above, these values do not necessarily reflect the contents of the bookshelf inventory, although they usually will unless modified by plugins.
hasSlot()
public function hasSlot(\pocketmine\block\utils\ChiseledBookshelfSlot $slot) : boolReturns whether the given slot is displayed as occupied. This doesn't guarantee that there is or isn't a book in the bookshelf's inventory.
isAffectedBySilkTouch()
public function isAffectedBySilkTouch() : boolonInteract()
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolreadStateFromWorld()
public function readStateFromWorld() : \pocketmine\block\BlocksetLastInteractedSlot()
public function setLastInteractedSlot(?\pocketmine\block\utils\ChiseledBookshelfSlot $lastInteractedSlot) : selfSets the last slot interacted by a player.
setSlot()
public function setSlot(\pocketmine\block\utils\ChiseledBookshelfSlot $slot, bool $occupied) : selfSets whether the given slot is displayed as occupied.
This doesn't modify the bookshelf's inventory, so you can use this to make invisible books or display books that aren't actually in the bookshelf.
To modify the contents of the bookshelf inventory, access the tile inventory.
setSlots()
public function setSlots(array $slots) : selfwriteStateToWorld()
public function writeStateToWorld() : void