mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Use covariant types for InventoryHolder and Container implementors
This commit is contained in:
@ -114,20 +114,14 @@ class Chest extends Spawnable implements Container, Nameable{
|
||||
$this->containerTraitBlockDestroyedHook();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ChestInventory|DoubleChestInventory
|
||||
*/
|
||||
public function getInventory(){
|
||||
public function getInventory() : ChestInventory|DoubleChestInventory{
|
||||
if($this->isPaired() && $this->doubleInventory === null){
|
||||
$this->checkPairing();
|
||||
}
|
||||
return $this->doubleInventory instanceof DoubleChestInventory ? $this->doubleInventory : $this->inventory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ChestInventory
|
||||
*/
|
||||
public function getRealInventory(){
|
||||
public function getRealInventory() : ChestInventory{
|
||||
return $this->inventory;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user