Skip to content

Commit

Permalink
Merge pull request #33 from mooziii/armorstand-extensions
Browse files Browse the repository at this point in the history
Add ArmorStand extensions
  • Loading branch information
jakobkmar authored Jan 8, 2022
2 parents 5a1cace + 80ddd04 commit 6bacddf
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,22 @@ fun Player.sendToServer(servername: String) {
* @return The items that did not fit into the player's inventory.
*/
fun Player.give(vararg itemStacks: ItemStack) = inventory.addItem(*itemStacks)

/**
* Adds all equipment locks to every equipment slot
*/
fun ArmorStand.fullLock() {
for (slot in EquipmentSlot.values()) {
lock(slot)
}
}

/**
* Adds all equipment locks to the given slot
* @param slot the slot which gets locked
*/
fun ArmorStand.lock(slot: EquipmentSlot) {
for (lock in ArmorStand.LockType.values()) {
addEquipmentLock(slot, lock)
}
}

0 comments on commit 6bacddf

Please sign in to comment.