From 3e0dea0d1b5d542ef47c44b65dd9d34949535ff2 Mon Sep 17 00:00:00 2001 From: gregf36665 Date: Fri, 27 Dec 2024 13:25:45 +0000 Subject: [PATCH] Update doc string for hasSpaceFor and set amount to 1 by default --- Server/src/main/core/api/ContentAPI.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Server/src/main/core/api/ContentAPI.kt b/Server/src/main/core/api/ContentAPI.kt index d09093879..31f7fb02c 100644 --- a/Server/src/main/core/api/ContentAPI.kt +++ b/Server/src/main/core/api/ContentAPI.kt @@ -687,10 +687,11 @@ fun hasSpaceFor(player: Player, item: Item): Boolean { /** * Checks if a player has space for an item * @param player the player whose inventory to check - * @param item the Item to check against + * @param item the item ID to check against + * @param amount the amount of the item (default 1) to check for * @return true if the player's inventory has space for the item */ -fun hasSpaceFor(player: Player, item: Int, amount: Int): Boolean { +fun hasSpaceFor(player: Player, item: Int, amount: Int = 1): Boolean { return hasSpaceFor(player, Item(item, amount)) }