mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
Inventory: eliminate remaining $send parameters
This commit is contained in:
parent
36685001bd
commit
7c2741e4f5
@ -98,6 +98,6 @@ trait ContainerTrait{
|
||||
foreach($inv->getContents() as $k => $item){
|
||||
$pos->world->dropItem($pos->add(0.5, 0.5, 0.5), $item);
|
||||
}
|
||||
$inv->clearAll(false);
|
||||
$inv->clearAll();
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ abstract class BaseInventory implements Inventory{
|
||||
/**
|
||||
* @param Item[] $items
|
||||
*/
|
||||
public function setContents(array $items, bool $send = true) : void{
|
||||
public function setContents(array $items) : void{
|
||||
if(count($items) > $this->getSize()){
|
||||
$items = array_slice($items, 0, $this->getSize(), true);
|
||||
}
|
||||
@ -112,10 +112,8 @@ abstract class BaseInventory implements Inventory{
|
||||
$listener->onContentChange($this);
|
||||
}
|
||||
|
||||
if($send){
|
||||
foreach($this->getViewers() as $viewer){
|
||||
$viewer->getNetworkSession()->getInvManager()->syncContents($this);
|
||||
}
|
||||
foreach($this->getViewers() as $viewer){
|
||||
$viewer->getNetworkSession()->getInvManager()->syncContents($this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,8 +315,8 @@ abstract class BaseInventory implements Inventory{
|
||||
$this->setItem($index, ItemFactory::air());
|
||||
}
|
||||
|
||||
public function clearAll(bool $send = true) : void{
|
||||
$this->setContents([], $send);
|
||||
public function clearAll() : void{
|
||||
$this->setContents([]);
|
||||
}
|
||||
|
||||
public function swap(int $slot1, int $slot2) : void{
|
||||
|
@ -80,7 +80,7 @@ interface Inventory{
|
||||
/**
|
||||
* @param Item[] $items
|
||||
*/
|
||||
public function setContents(array $items, bool $send = true) : void;
|
||||
public function setContents(array $items) : void;
|
||||
|
||||
/**
|
||||
* Checks if the inventory contains any Item with the same material data.
|
||||
@ -127,7 +127,7 @@ interface Inventory{
|
||||
/**
|
||||
* Clears all the slots
|
||||
*/
|
||||
public function clearAll(bool $send = true) : void;
|
||||
public function clearAll() : void;
|
||||
|
||||
/**
|
||||
* Swaps the specified slots.
|
||||
|
Loading…
x
Reference in New Issue
Block a user