pocketmine\block\TrappedChest::onBreak PHP Method

onBreak() public method

public onBreak ( Item $item )
$item pocketmine\item\Item
    public function onBreak(Item $item)
    {
        $t = $this->getLevel()->getTile($this);
        if ($t instanceof TileChest) {
            $t->unpair();
        }
        $this->getLevel()->setBlock($this, new Air(), true, true);
        return true;
    }