Skip to content

Commit

Permalink
fix: fill inv
Browse files Browse the repository at this point in the history
  • Loading branch information
InvalidJoker committed Jan 4, 2025
1 parent 5100043 commit fc41fbf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ fun Inventory.setItem(range: IntProgression, item: ItemStack) {
range.forEach { this.setItem(it, item) }
}

fun fillEmptyAndOpenInventory(player: Player, inv: Inventory, identifier: String? = null, vararg identifiers: Map<NamespacedKey, String>? = arrayOf()) {
fillEmptyInventory(inv, PLACEHOLDER_GRAY)
if (identifier != null) inv.identify(identifier, *identifiers)
player.openInventory(inv)
}

fun fillEmptyAndOpenInventory(player: Player, inv: Inventory, spacer: ItemStack = PLACEHOLDER_GRAY, identifier: String? = null, vararg identifiers: Map<NamespacedKey, String>? = arrayOf()) {
fillEmptyInventory(inv, spacer)
if (identifier != null) inv.identify(identifier, *identifiers)
Expand Down

0 comments on commit fc41fbf

Please sign in to comment.