diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index ac06b7123..5ef2da305 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3323,13 +3323,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);