mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
backport f84a1729c
: Inventory: added swap() function
This commit is contained in:
@@ -378,6 +378,13 @@ abstract class BaseInventory implements Inventory{
|
||||
}
|
||||
}
|
||||
|
||||
public function swap(int $slot1, int $slot2) : void{
|
||||
$i1 = $this->getItem($slot1);
|
||||
$i2 = $this->getItem($slot2);
|
||||
$this->setItem($slot1, $i2);
|
||||
$this->setItem($slot2, $i1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user