Players can now cut down jungle bushes while wielding a machete

Added inEquipmentOrInventory function to content API
This commit is contained in:
bushtail
2023-02-18 02:36:12 +00:00
committed by Ryan
parent 4f600b2a59
commit 7a42de63dc
2 changed files with 15 additions and 2 deletions
+11
View File
@@ -330,6 +330,17 @@ fun inEquipment(player: Player, item: Int, amount: Int = 1): Boolean {
return player.equipment.contains(item, amount)
}
/**
* Check if an item exists in a player's equipment or inventory
* @param player the player whose equipment to check
* @param item the ID of the item to check for
* @param amount the amount to check for, defaults to 1
* @return true if the item exists in the given amount in the player's equipment or inventory
*/
fun inEquipmentOrInventory(player: Player, item: Int, amount: Int = 1): Boolean {
return inInventory(player, item, amount) || inEquipment(player, item, amount)
}
/**
* Get number of free slots in a player's inventory
* @param player the player to check