声音
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
group=com.github.xbaimiao.shoppro
|
||||
version=1.2.1
|
||||
version=1.2.2
|
||||
|
||||
@@ -151,14 +151,24 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
||||
if (item.isLimit()) {
|
||||
if (ShopPro.database.getPlayerAlreadyData(player, item).buy >= item.getLimitPlayer(player)) {
|
||||
player.sendLang("buy-limit-player", item.getLimitPlayer(player))
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (ShopPro.database.getServerAlreadyData(item).buy >= item.limitServer) {
|
||||
player.sendLang("buy-limit-server", item.limitServer)
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (ShopPro.database.getPlayerAlreadyData(player, item).buy + amount > item.getLimitPlayer(player)) {
|
||||
buy((item.getLimitPlayer(player) - ShopPro.database.getPlayerAlreadyData(player, item).buy).toInt(), item, player)
|
||||
buy(
|
||||
(item.getLimitPlayer(player) - ShopPro.database.getPlayerAlreadyData(player, item).buy).toInt(),
|
||||
item,
|
||||
player
|
||||
)
|
||||
return
|
||||
}
|
||||
if (ShopPro.database.getServerAlreadyData(item).buy + amount > item.limitServer) {
|
||||
@@ -180,8 +190,14 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
||||
ShopPro.database.addAmount(item, player, LimitData(amount.toLong(), 0L))
|
||||
item.exeCommands(player, amount)
|
||||
player.sendLang("buy-item", amount, item.name, item.price * amount)
|
||||
ShopPro.config.getString("the_voice_of_success")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
} else {
|
||||
player.sendLang("not-money")
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,10 +205,16 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
||||
if (item.isLimit()) {
|
||||
if (ShopPro.database.getPlayerAlreadyData(player, item).sell >= item.getLimitPlayer(player)) {
|
||||
player.sendLang("sell-limit-player", item.getLimitPlayer(player))
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (ShopPro.database.getServerAlreadyData(item).sell >= item.limitServer) {
|
||||
player.sendLang("sell-limit-server", item.limitServer)
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (ShopPro.database.getPlayerAlreadyData(player, item).sell + amount > item.getLimitPlayer(player)) {
|
||||
@@ -218,7 +240,13 @@ class ShopImpl(private val configuration: Configuration) : Shop() {
|
||||
Bukkit.getPluginManager().callEvent(ShopProSellEvent(item, amount, player))
|
||||
ShopPro.database.addAmount(item, player, LimitData(0L, amount.toLong()))
|
||||
player.sendLang("sell-item", amount, item.name, item.price * amount)
|
||||
ShopPro.config.getString("the_voice_of_success")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
} else {
|
||||
ShopPro.config.getString("the_voice_of_failure")?.let {
|
||||
player.playSound(player.location, it, 100f, 1f)
|
||||
}
|
||||
player.sendLang("not-item")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,8 @@ mysql:
|
||||
port: 3306
|
||||
user: "root"
|
||||
password: "123456"
|
||||
database: "shoppro"
|
||||
database: "shoppro"
|
||||
# 出售/购买成功的声音
|
||||
the_voice_of_success: ''
|
||||
# 出售/购买失败的声音
|
||||
the_voice_of_failure: ''
|
||||
Reference in New Issue
Block a user