Added option to not open crates by clicking in the key gui

This commit is contained in:
Auxilor
2022-03-17 10:25:05 +00:00
parent 26edf8f72e
commit 94f46f8ef5
2 changed files with 7 additions and 4 deletions

View File

@@ -165,13 +165,15 @@ class Crate(
ItemStackBuilder(Items.lookup(config.getString("keygui.item"))).build()
) {
onLeftClick { event, _, _ ->
val player = event.whoClicked as Player
openWithKey(player)
if (config.getBool("keygui.left-click-opens")) {
val player = event.whoClicked as Player
openWithKey(player)
}
}
onRightClick { event, _, _ ->
event.whoClicked.closeInventory()
config.getFormattedStrings("keygui.rightClickMessage")
config.getFormattedStrings("keygui.right-click-message")
.forEach { event.whoClicked.sendMessage(it) }
}

View File

@@ -30,8 +30,9 @@ crates:
- "&fYou have %keys% keys"
row: 2
column: 3
rightClickMessage:
right-click-message:
- "Buy a Demo Crate key here! get lured into the trap of gambling addiction"
left-click-opens: true
placed:
particles: