mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
All BlockInventory descendents now have a Position as holder
this allows multiple problems to be solved: 1) Cycle between tile and inventory is now removed. 2) BlockInventory now provides a consistent API for plugins to get the block holding an inventory.
This commit is contained in:
@ -28,19 +28,8 @@ use pocketmine\world\Position;
|
||||
|
||||
class EnchantInventory extends BlockInventory{
|
||||
|
||||
/** @var Position */
|
||||
protected $holder;
|
||||
|
||||
public function __construct(Position $pos){
|
||||
parent::__construct($pos->asPosition(), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* This override is here for documentation and code completion purposes only.
|
||||
* @return Position
|
||||
*/
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
public function __construct(Position $holder){
|
||||
parent::__construct($holder, 2);
|
||||
}
|
||||
|
||||
public function onClose(Player $who) : void{
|
||||
|
Reference in New Issue
Block a user