Cleanups and load order
This commit is contained in:
@@ -43,12 +43,6 @@ class ShopItem(
|
|||||||
|
|
||||||
val commands = config.getStrings("command") + config.getStrings("commands")
|
val commands = config.getStrings("command") + config.getStrings("commands")
|
||||||
|
|
||||||
val sellCommand = config.getStringsOrNull("sell.sell-commands")
|
|
||||||
|
|
||||||
val sellItemMessage = config.getStringsOrNull("sell.sell-message")
|
|
||||||
|
|
||||||
val buyItemMessage = config.getStringsOrNull("buy.buy-message")
|
|
||||||
|
|
||||||
val item = if (config.has("item")) Items.lookup(config.getString("item")) else null
|
val item = if (config.has("item")) Items.lookup(config.getString("item")) else null
|
||||||
|
|
||||||
val buyAmount = config.getIntOrNull("buy.amount") ?: 1
|
val buyAmount = config.getIntOrNull("buy.amount") ?: 1
|
||||||
@@ -111,6 +105,12 @@ class ShopItem(
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private val sellCommands: List<String>? = config.getStringsOrNull("sell.sell-commands")
|
||||||
|
|
||||||
|
private val sellItemMessage: List<String>? = config.getStringsOrNull("sell.sell-message")
|
||||||
|
|
||||||
|
private val buyItemMessage: List<String>? = config.getStringsOrNull("buy.buy-message")
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (this.item != null && this.item.item.amount != 1) {
|
if (this.item != null && this.item.item.amount != 1) {
|
||||||
throw InvalidShopItemException(
|
throw InvalidShopItemException(
|
||||||
@@ -367,8 +367,8 @@ class ShopItem(
|
|||||||
|
|
||||||
shop?.sellSound?.playTo(player)
|
shop?.sellSound?.playTo(player)
|
||||||
|
|
||||||
if (sellCommand != null) {
|
if (sellCommands != null) {
|
||||||
for (command in sellCommand) {
|
for (command in sellCommands) {
|
||||||
Bukkit.dispatchCommand(
|
Bukkit.dispatchCommand(
|
||||||
Bukkit.getConsoleSender(),
|
Bukkit.getConsoleSender(),
|
||||||
command.replace("%player%", player.name)
|
command.replace("%player%", player.name)
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ authors: [ Auxilor ]
|
|||||||
website: willfp.com
|
website: willfp.com
|
||||||
depend:
|
depend:
|
||||||
- eco
|
- eco
|
||||||
|
softdepend:
|
||||||
|
- EcoEnchants
|
||||||
|
- EcoBosses
|
||||||
|
- Talismans
|
||||||
|
- StatTrackers
|
||||||
|
- EcoItems
|
||||||
|
- Reforges
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
ecoshop:
|
ecoshop:
|
||||||
|
|||||||
Reference in New Issue
Block a user