fix bugs
This commit is contained in:
@@ -4,7 +4,6 @@ import com.github.xbaimiao.shoppro.core.shop.Shop
|
|||||||
import org.bukkit.Material
|
import org.bukkit.Material
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import taboolib.library.xseries.XMaterial
|
import taboolib.library.xseries.XMaterial
|
||||||
import taboolib.module.nms.getItemTag
|
|
||||||
|
|
||||||
class ItemsAdderShopItem(
|
class ItemsAdderShopItem(
|
||||||
override val key: Char,
|
override val key: Char,
|
||||||
@@ -23,13 +22,11 @@ class ItemsAdderShopItem(
|
|||||||
|
|
||||||
val custom: Int
|
val custom: Int
|
||||||
|
|
||||||
private var customPotionColor: Int? = null
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
iaMaterial.split(":").let { strings ->
|
iaMaterial.split(":").let { strings ->
|
||||||
material = XMaterial.matchXMaterial(strings[1]).get().parseMaterial()!!
|
material = XMaterial.matchXMaterial(strings[1]).get().parseMaterial()!!
|
||||||
custom = strings[2].toInt()
|
custom = strings[2].toInt()
|
||||||
strings.getOrNull(3)?.let { customPotionColor = it.toInt() }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,13 +45,6 @@ class ItemsAdderShopItem(
|
|||||||
this.name = this@ItemsAdderShopItem.name
|
this.name = this@ItemsAdderShopItem.name
|
||||||
this.lore.addAll(this@ItemsAdderShopItem.lore)
|
this.lore.addAll(this@ItemsAdderShopItem.lore)
|
||||||
this.customModelData = custom
|
this.customModelData = custom
|
||||||
}.also { item ->
|
|
||||||
customPotionColor?.let {
|
|
||||||
val tag = item.getItemTag()
|
|
||||||
tag.putDeep("meta.CustomPotionColor.data", it)
|
|
||||||
tag.putDeep("meta.CustomPotionColor.type", "INT")
|
|
||||||
tag.saveTo(item)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ object VaultImpl : Vault {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getMoney(player: Player): Double {
|
override fun getMoney(player: Player): Double {
|
||||||
return VaultService.economy!!.getBalance(player)
|
return VaultService.economy!!.getBalance(player).format()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user