diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index f0c0ea737..2c6d5c2d6 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3881,13 +3881,13 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ * @param Inventory $inventory * @param bool $force Forces removal of permanent windows such as normal inventory, cursor * - * @throws \BadMethodCallException if trying to remove a fixed inventory window without the `force` parameter as true + * @throws \InvalidArgumentException if trying to remove a fixed inventory window without the `force` parameter as true */ public function removeWindow(Inventory $inventory, bool $force = false){ $id = $this->windows[$hash = spl_object_hash($inventory)] ?? null; if($id !== null and !$force and isset($this->permanentWindows[$id])){ - throw new \BadMethodCallException("Cannot remove fixed window $id (" . get_class($inventory) . ") from " . $this->getName()); + throw new \InvalidArgumentException("Cannot remove fixed window $id (" . get_class($inventory) . ") from " . $this->getName()); } $inventory->close($this);