public function isNeChest(Inventory $inv) { if ($inv instanceof DoubleChestInventory) { return false; } if (!$inv instanceof ChestInventory) { return false; } $tile = $inv->getHolder(); if (!$tile instanceof Chest) { return false; } $bl = $tile->getBlock(); if ($bl->getId() != Block::CHEST) { return false; } if ($bl->getSide(Vector3::SIDE_DOWN)->getId() != $this->base_block) { return false; } return true; }
public function deleteChest(Inventory $inv) { $bl = $inv->getHolder()->getBlock(); $x = $bl->getFloorX(); $y = $bl->getFloorY(); $z = $bl->getFloorZ(); unset($this->chests[$x . ":" . $y . ":" . $z]); // $this->getLogger()->info('Chest deleted'); }