diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/commands/CommandOpen.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/commands/CommandOpen.kt index b7fa3f8..ce33e13 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/commands/CommandOpen.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/commands/CommandOpen.kt @@ -18,7 +18,7 @@ class CommandOpen(plugin: EcoPlugin) : Subcommand( player as Player val crate = Crates.getByID(args[0]) ?: return - crate.openWithKey(player, OpenMethod.VIRTUAL_KEY) + crate.openWithMethod(player, OpenMethod.VIRTUAL_KEY) } override fun tabComplete(sender: CommandSender, args: List): List { 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 82e19f9..4ce1362 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 @@ -273,7 +273,7 @@ class Crate( if (config.getBool("keygui.left-click-opens")) { val player = event.whoClicked as Player player.closeInventory() - openWithKey(player, OpenMethod.VIRTUAL_KEY) + openWithMethod(player, OpenMethod.VIRTUAL_KEY) } } @@ -309,7 +309,7 @@ class Crate( return (0..amount).map { getRandomReward(player, displayWeight) } } - fun openPhysical(player: Player, location: Location, method: OpenMethod) { + fun openPlaced(player: Player, location: Location, method: OpenMethod) { val nicerLocation = location.clone().add(0.5, 1.5, 0.5) if (!hasKeysAndNotify(player, method)) { @@ -324,10 +324,10 @@ class Crate( return } - openWithKey(player, method, nicerLocation) + openWithMethod(player, method, nicerLocation) } - fun openWithKey(player: Player, method: OpenMethod, location: Location? = null) { + fun openWithMethod(player: Player, method: OpenMethod, location: Location? = null) { if (!hasKeysAndNotify(player, method)) { return } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/util/PlacedCrateListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/util/PlacedCrateListener.kt index 4cc3929..33b5ef0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/util/PlacedCrateListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecocrates/util/PlacedCrateListener.kt @@ -35,7 +35,7 @@ class PlacedCrateListener( when (event.action) { Action.LEFT_CLICK_BLOCK -> crate.previewForPlayer(player) - Action.RIGHT_CLICK_BLOCK -> crate.openPhysical( + Action.RIGHT_CLICK_BLOCK -> crate.openPlaced( player, block.location, if (physicalKey) OpenMethod.PHYSICAL_KEY else OpenMethod.VIRTUAL_KEY