Skip to content

Commit 354d779

Browse files
committed
Move InvMenu::getInventory(), InvMenu::setInventory() to a more appropriate place
1 parent 51a1408 commit 354d779

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/muqsit/invmenu/InvMenu.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,21 @@ public function setInventoryCloseListener(?Closure $listener) : self{
115115
return $this;
116116
}
117117

118+
public function getInventory() : Inventory{
119+
return $this->inventory;
120+
}
121+
122+
public function setInventory(?Inventory $custom_inventory) : void{
123+
if($this->synchronizer !== null){
124+
$this->synchronizer->destroy();
125+
$this->synchronizer = null;
126+
}
127+
128+
if($custom_inventory !== null){
129+
$this->synchronizer = new SharedInvMenuSynchronizer($this, $custom_inventory);
130+
}
131+
}
132+
118133
/**
119134
* @param Player $player
120135
* @param string|null $name
@@ -160,21 +175,6 @@ final public function send(Player $player, ?string $name = null, ?Closure $callb
160175
});
161176
}
162177

163-
public function getInventory() : Inventory{
164-
return $this->inventory;
165-
}
166-
167-
public function setInventory(?Inventory $custom_inventory) : void{
168-
if($this->synchronizer !== null){
169-
$this->synchronizer->destroy();
170-
$this->synchronizer = null;
171-
}
172-
173-
if($custom_inventory !== null){
174-
$this->synchronizer = new SharedInvMenuSynchronizer($this, $custom_inventory);
175-
}
176-
}
177-
178178
/**
179179
* @internal use InvMenu::send() instead.
180180
*

0 commit comments

Comments
 (0)