Tidy debug messages

This commit is contained in:
Dylan K. Taylor
2025-08-31 00:26:43 +01:00
parent 6a4240fa02
commit d7f86d3172
2 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ class InventoryManager implements InventoryListener{
private function add(int $id, InventoryWindow $window) : void{
$k = spl_object_id($window->getInventory());
if(isset($this->entries[$k])){
throw new \InvalidArgumentException("Inventory " . get_class($window) . " is already tracked");
throw new \InvalidArgumentException("Inventory " . get_class($window->getInventory()) . " is already tracked (open in two different windows?)");
}
$this->entries[$k] = new InventoryManagerEntry($window);
$window->getInventory()->getListeners()->add($this);

View File

@ -2832,7 +2832,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
if(($inventoryManager = $this->getNetworkSession()->getInvManager()) === null){
throw new \InvalidArgumentException("Player cannot open inventories in this state");
}
$this->logger->debug("Opening inventory " . get_class($window) . "#" . spl_object_id($window));
$this->logger->debug("Opening inventory window " . get_class($window) . "#" . spl_object_id($window));
$inventoryManager->onCurrentWindowChange($window);
$window->onOpen();
$this->currentWindow = $window;
@ -2843,7 +2843,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$this->doCloseInventory();
if($this->currentWindow !== null){
$currentWindow = $this->currentWindow;
$this->logger->debug("Closing inventory " . get_class($this->currentWindow) . "#" . spl_object_id($this->currentWindow));
$this->logger->debug("Closing inventory window " . get_class($this->currentWindow) . "#" . spl_object_id($this->currentWindow));
$this->currentWindow->onClose();
if(($inventoryManager = $this->getNetworkSession()->getInvManager()) !== null){
$inventoryManager->onCurrentWindowRemove();