修复自定义货币bug
This commit is contained in:
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("io.izzel.taboolib") version "1.42"
|
id("io.izzel.taboolib") version "1.54"
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.5.10"
|
id("org.jetbrains.kotlin.jvm") version "1.8.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
taboolib {
|
taboolib {
|
||||||
@@ -24,9 +24,9 @@ taboolib {
|
|||||||
install("platform-bukkit")
|
install("platform-bukkit")
|
||||||
install("expansion-command-helper")
|
install("expansion-command-helper")
|
||||||
classifier = null
|
classifier = null
|
||||||
version = "6.0.9-84"
|
version = "6.0.10-59"
|
||||||
options("skit-kotlin")
|
options("skit-kotlin")
|
||||||
relocate("kotlin","libs.kotlin1510")
|
relocate("kotlin","libs.kotlin180")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
group=com.github.xbaimiao.shoppro
|
group=com.github.xbaimiao.shoppro
|
||||||
version=1.1.0
|
version=1.1.2
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import taboolib.platform.util.giveItem
|
|||||||
import taboolib.platform.util.hasItem
|
import taboolib.platform.util.hasItem
|
||||||
import taboolib.platform.util.sendLang
|
import taboolib.platform.util.sendLang
|
||||||
import taboolib.platform.util.takeItem
|
import taboolib.platform.util.takeItem
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList
|
||||||
|
|
||||||
class ShopImpl(private val configuration: Configuration) : Shop() {
|
class ShopImpl(private val configuration: Configuration) : Shop() {
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
|||||||
override fun open(player: Player) {
|
override fun open(player: Player) {
|
||||||
player.openMenu<Basic>(getTitle(player)) {
|
player.openMenu<Basic>(getTitle(player)) {
|
||||||
rows(slots.size)
|
rows(slots.size)
|
||||||
slots = ArrayList<List<Char>>().also { it.addAll(this@ShopImpl.slots) }
|
slots = CopyOnWriteArrayList<List<Char>>().also { it.addAll(this@ShopImpl.slots) }
|
||||||
onClick {
|
onClick {
|
||||||
it.isCancelled = true
|
it.isCancelled = true
|
||||||
}
|
}
|
||||||
@@ -185,7 +186,11 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (ShopPro.database.getPlayerAlreadyData(player, item).sell + amount > item.limitPlayer) {
|
if (ShopPro.database.getPlayerAlreadyData(player, item).sell + amount > item.limitPlayer) {
|
||||||
sell((item.limitPlayer - ShopPro.database.getPlayerAlreadyData(player, item).sell).toInt(), item, player)
|
sell(
|
||||||
|
(item.limitPlayer - ShopPro.database.getPlayerAlreadyData(player, item).sell).toInt(),
|
||||||
|
item,
|
||||||
|
player
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (ShopPro.database.getServerAlreadyData(item).sell + amount > item.limitServer) {
|
if (ShopPro.database.getServerAlreadyData(item).sell + amount > item.limitServer) {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class DiyCurrency(configuration: Configuration) : Currency {
|
|||||||
}
|
}
|
||||||
val cmd = replace(takeCommand, player, double.format())
|
val cmd = replace(takeCommand, player, double.format())
|
||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd)
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd)
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getMoney(player: Player): Double {
|
override fun getMoney(player: Player): Double {
|
||||||
|
|||||||
Reference in New Issue
Block a user