Remove useless else branch and and return unhandled for unmatched window IDs

This commit is contained in:
Dylan K. Taylor 2017-08-09 19:05:00 +01:00
parent d3d1e32309
commit 72d40860f3

View File

@ -2798,11 +2798,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
if(isset($this->windowIndex[$packet->windowId])){ if(isset($this->windowIndex[$packet->windowId])){
$this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowId], $this)); $this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowId], $this));
$this->removeWindow($this->windowIndex[$packet->windowId]); $this->removeWindow($this->windowIndex[$packet->windowId]);
}else{ return true;
unset($this->windowIndex[$packet->windowId]);
} }
return true; return false;
} }
public function handlePlayerHotbar(PlayerHotbarPacket $packet){ public function handlePlayerHotbar(PlayerHotbarPacket $packet){