新增neigeitems兼容,增加了右键开关
This commit is contained in:
@@ -9,6 +9,8 @@ import com.github.xbaimiao.shoppro.core.item.KetherCondition
|
|||||||
import com.github.xbaimiao.shoppro.core.item.ShopItem
|
import com.github.xbaimiao.shoppro.core.item.ShopItem
|
||||||
import com.github.xbaimiao.shoppro.util.Util.howManyItems
|
import com.github.xbaimiao.shoppro.util.Util.howManyItems
|
||||||
import com.github.xbaimiao.shoppro.util.Util.replacePapi
|
import com.github.xbaimiao.shoppro.util.Util.replacePapi
|
||||||
|
import io.lumine.xikage.mythicmobs.utils.adventure.text.minimessage.MiniMessage
|
||||||
|
import io.lumine.xikage.mythicmobs.utils.adventure.text.minimessage.MiniMessageImpl
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.configuration.Configuration
|
import org.bukkit.configuration.Configuration
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
@@ -122,17 +124,32 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
|||||||
if (event.clickType != ClickType.CLICK) {
|
if (event.clickType != ClickType.CLICK) {
|
||||||
return@onClick
|
return@onClick
|
||||||
}
|
}
|
||||||
val amount = when (event.clickEvent().click) {
|
val amount : Int
|
||||||
org.bukkit.event.inventory.ClickType.LEFT -> 1
|
if (configuration.getBoolean("items.${item.key}.right_click")){
|
||||||
org.bukkit.event.inventory.ClickType.RIGHT -> 64
|
amount = when (event.clickEvent().click) {
|
||||||
org.bukkit.event.inventory.ClickType.SHIFT_RIGHT -> {
|
org.bukkit.event.inventory.ClickType.LEFT -> 1
|
||||||
player.inventory.howManyItems {
|
org.bukkit.event.inventory.ClickType.RIGHT -> 64
|
||||||
item.equal(it)
|
org.bukkit.event.inventory.ClickType.SHIFT_RIGHT -> {
|
||||||
|
player.inventory.howManyItems {
|
||||||
|
item.equal(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
else -> return@onClick
|
else -> return@onClick
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
amount = when (event.clickEvent().click) {
|
||||||
|
org.bukkit.event.inventory.ClickType.LEFT -> 1
|
||||||
|
org.bukkit.event.inventory.ClickType.SHIFT_RIGHT -> {
|
||||||
|
player.inventory.howManyItems {
|
||||||
|
item.equal(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> return@onClick
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkSellLimit(amount, item, player)
|
checkSellLimit(amount, item, player)
|
||||||
event.currentItem?.let {
|
event.currentItem?.let {
|
||||||
event.clickEvent().inventory.setItem(event.rawSlot, item.update(player))
|
event.clickEvent().inventory.setItem(event.rawSlot, item.update(player))
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ mysql:
|
|||||||
# 出售/购买成功的声音
|
# 出售/购买成功的声音
|
||||||
the_voice_of_success: ''
|
the_voice_of_success: ''
|
||||||
# 出售/购买失败的声音
|
# 出售/购买失败的声音
|
||||||
the_voice_of_failure: ''
|
the_voice_of_failure: ''
|
||||||
|
|||||||
Reference in New Issue
Block a user