Visibility changes

This commit is contained in:
Auxilor
2022-03-18 08:46:34 +00:00
parent d94ba875da
commit 1fcfac4e6f

View File

@@ -181,6 +181,16 @@ class Crate(
return true
}
private fun usePhysicalKey(player: Player) {
val itemStack = player.inventory.itemInMainHand
if (key.matches(itemStack)) {
itemStack.amount -= 1
if (itemStack.amount == 0) {
itemStack.type = Material.AIR
}
}
}
internal fun addToKeyGUI(builder: MenuBuilder) {
builder.setSlot(
config.getInt("keygui.row"),
@@ -317,16 +327,6 @@ class Crate(
return player.profile.read(keysKey)
}
fun usePhysicalKey(player: Player) {
val itemStack = player.inventory.itemInMainHand
if (key.matches(itemStack)) {
itemStack.amount -= 1
if (itemStack.amount == 0) {
itemStack.type = Material.AIR
}
}
}
fun hasPhysicalKey(player: Player): Boolean {
return key.matches(player.inventory.itemInMainHand)
}