Added option to not open crates by clicking in the key gui
This commit is contained in:
@@ -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) }
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user