diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/crate/Crate.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/crate/Crate.kt index e5451d4..22a2b21 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/crate/Crate.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/crate/Crate.kt @@ -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) }