Assailents Economic Additions
简介
Assailents Economic Additions 是我为了解决当前难以找到一款无臃肿、可定制的经济插件的问题而提出的方案。在运营/开发服务器(Homieworld 和 Aeros,它们在关闭前以及由原所有者管理期间)并努力寻找合适的经济插件一段时间后,我决定自己制作一个。
要求:
- Vault(尽管它显示最后测试版本是 1.17,但它适用于 1.20.4):
- PlaceholderAPI
指令与权限
正如简介所述,为了保持无冗余功能,仅有少量指令可用。
管理员指令
/economy <bal | give | take | set> <玩家> <金额>
获取玩家的余额、给予玩家金钱、从玩家处扣除金钱或设置玩家的余额。
所需权限:EconomicAdditions.economygui
别名:无
用户命令
-
/bal [player]
返回指定玩家的余额。
所需权限:EconomicAdditions.balance 和 EconomicAdditions.balance.others
别名:/balance
-
/pay <player> <amount>
从你的余额中向指定玩家支付一定金额。
所需权限:EconomicAdditions.pay
别名:无
-
/toggleactionbar
切换玩家快捷栏上方的操作栏(参见自定义功能)
所需权限:EconomicAdditions.toggleactionbar
别名:/actionbar /ab
-
/economygui
打开经济图形界面(支持支付与余额查看,无论权限如何均可查看余额)
所需权限:EconomicAdditions.economygui
别名:/econgui /econ /egui /money
-
/stockdisplay
切换股票显示(参见自定义功能)
所需权限:EconomicAdditions.stockdisplay
别名:/toggledisplay /togglestock /toggletickdisplay /stock /display /tickdisplay
自定义特性
Mini Message 支持
所有消息均支持 AdventureLib 的 mini message 格式!允许使用渐变、自定义颜色等效果...
MiniMessage 格式链接:
动作栏 (Action Bar)
动作栏是一个显示区域,可在 lang.yml 中开启或关闭(参见配置)。默认情况下,它每 2 秒更新一次,并在上方显示玩家的余额及货币名称。
资金变动显示
这本质上是一个标题,当玩家收到或支取一定金额时,会从该金额的 80% 开始动态增长至 100%。可在 lang.yml 中开启或关闭(参见配置)。
经济 GUI
这是一个基本的用户界面,允许玩家通过 UI 进行支付、查看余额以及其他统计信息!
如果在线玩家超过 27 人,它还支持分页功能,并且所有内容均可自定义!
配置
在配置文件中,主要有两种类型的配置你需要了解;
普通配置,
物品。
普通配置
这非常简单直接。例如 starting-money: 1500 表示玩家初始拥有 1500 金币。无需过多思考。这也是几乎插件中所有消息都可以自定义的地方(包括翻译或完全不同的消息。
物品
物品主要在 gui/economy: 部分定义,并具有一些关键特性!
以下是一个示例物品:
TestItem:
Material: "DIAMOND" # 从 https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html 获取材质,除了 "PLAYERHEAD" 之外,关于它的更多信息稍后介绍。
Amount: 1 # ItemStack 中的数量
Title: "Diamond Stick" # 物品的名称
Lore:
- "这是第一行描述文字!"
- "这是第二行!"
- "你可以拥有任意多行的描述文字!"
- "我支持 MiniMessage 和 PlaceholderAPI 格式!"
这个物品不会显示出来,因为插件并未调用它。这就是为什么你绝对不要更改 lang.yml 中变量的名称。
你可以通过在底部添加一行简单的代码来为物品添加自定义模型数据(CustomModelData)。
示例:
TestItem:
Material: "DIAMOND"
Amount: 1
Title: "Diamond Stick"
Lore:
- "一些很酷的描述文字"
- "没错!"
CustomModelData: 1
只有当你清楚自己在做什么时,自定义模型数据才有用!
完整配置文件
Lang.yml
common:
prefix: "<gray>[<gold>Economic Additions<gray>] "
currency-singular: "Sheep"
currency-plural: "Sheeps"
starting-money: 1500
error-color: "<#EB7272>"
success-color: "<#A6F8C6>"
non-valid-number: "金额必须是有效的十进制数。实际值: "
sender-not-a-player: "只有玩家才能使用此命令!"
target-hasnt-player-before: "玩家 %parse% 此前从未在此服务器上玩过!"
no-permission: "你没有权限执行此命令!"
economy:
took-money: "已从 %parse% 的账户中扣除 %currency%。"
gave-money: "已向 %parse% 的账户发放 %currency%。"
set-money: "已将 %parse% 的账户余额设置为 %currency%。"
balance: "%parse% 的余额:%currency%"
paid-player: "你向 %parse% 支付了 %currency%"
recieved-money: "你收到了来自 %parse% 的 %currency%"
not-enough-money: "你的余额不足!"
actionbar:
enabled: true
update: 2
text: "<gray>%vault_eco_balance% Sheeps"
toggle-on-text: "动作栏已开启!"
toggle-off-text: "动作栏已关闭!"
stockdisplay:
enabled: true
min-amount: 2000
negative:
prefix: "<gray>[<red>-<gray>] "
suffix: " <gray>Sheeps"
positive:
prefix: "<gray>[<green>+<gray>] "
suffix: " <gray>Sheeps"
toggle-on-text: "库存显示已开启!"
toggle-off-text: "库存显示已关闭!"
gui:
economy:
messages:
cancel-payment: "取消支付!"
mainMenu:
Title: "Economic Additions"
payItem:
Material: 'DIAMOND'
Amount: 1
Title: "<gold>支付给其他玩家!"
Lore:
- "<gray>点击此处打开支付玩家菜单!"
- "<gray>EconomicAdditions"
balItem:
Material: 'GOLD_INGOT'
Amount: 2
Title: "<gold>查看余额!"
Lore:
- "<gray>点击此处查看其他玩家的余额!"
- "<gray>EconomicAdditions"
statsItem:
Material: "PLAYERHEAD"
Amount: 1
Title: "<gold>统计信息!"
Lore:
- "你 %player_displayname% 拥有:"
- "%vault_eco_balance% Sheeps!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
payMenu:
Title: "ᴘᴀʏ ᴘʟᴀʏᴇʀꜱ"
pay-message: "你想支付多少?"
nextFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>下一页"
nextEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>下一页"
prevFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>上一页"
prevEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>上一页"
playerHead:
Material: "PLAYERHEAD"
Amount: 1
Title: "<#C7FFEA>%player_displayname%"
Lore:
- "<#A2A2A2>左键点击以向该玩家付款!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
balMenu:
Title: "ᴘʟᴀʏᴇʀ ʙᴀʟᴀɴᴄᴇꜱ"
nextFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>下一页"
nextEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>下一页"
prevFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>上一页"
prevEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>上一页"
playerHead:
Material: "PLAYERHEAD"
Amount: 1
Title: "<#C7FFEA>%player_displayname%'s Balance"
Lore:
- "<#A2A2A2>%vault_eco_balance% Sheeps!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
Assailents Economic Additions
Introduction
Assailents Economic Additions is my solution to the current struggle to find a good bloat-free and customizable economy plugin. After a while of running/developing servers (Homieworld and Aeros before they shut down and while they were under original owners) and struggling to find good Economy Plugins I decided to make my own.
Requirements:
- Vault (Even thought it says last test version is 1.17 it works for 1.20.4):
- PlaceholderAPI
Commands & Permissions
As the Introduction says, with the goal to stay bloat free there are only a couple commands.
Admin Commands
- /economy <bal | give | take | set> <player> <amount>
Get the balance of a player, give the player money, take money from the player, or set the player's balance.
Permission Required: EconomicAdditions.economygui
Aliases: N/A
User Commands
-
/bal [player]
This returns the balance of a player.
Permission Required: EconomicAdditions.balance and EconomicAdditions.balance.others
Aliases: /balance
-
/pay <player> <amount>
This pays a player from you're balance.
Permission Required: EconomicAdditions.pay
Aliases: N/A
-
/toggleactionbar
This toggles the action bar above the players hotbar (See Custom Features)
Permission Required: EconomicAdditions.toggleactionbar
Aliases: /actionbar /ab
-
/economygui
Opens the economy gui (Allows for paying and balances, Balances are viewable no matter the permissions)
Permission Required: EconomicAdditions.economygui
Aliases: /econgui /econ /egui /money
-
/stockdisplay
This toggles the Stock display (See Custom Features)
Permission Required: EconomicAdditions.stockdisplay
Aliases: /toggledisplay /togglestock /toggletickdisplay /stock /display /tickdisplay
Custom Features
Mini Message support
Every message supports AdventureLib mini message formatting! Allowing for gradients, custom colours and etc...
Link to MiniMessage Formats:
Action Bar
The action bar is a display that can be toggled in the lang.yml (See Configuration), By default it updates every 2 seconds and displays the balance of the player and the name of the currency above it.
Stock display
This essentially is just a title that appears and ticks up from 80% of an amount of money recieved or taken up to the full %. Can be toggled in the lang.yml (See Configuration)
Economy Gui
Just a basic UI that allows the player to Pay, View Balances, And other stats in the form of a UI!
It also has page support if you have more than 27 players online and everything is customisable!
Configuration
In the configuration files pretty much two types of configuration that you need to know about;
Normal Configuration,
Items.
Normal Configuration
This is pretty straight forward. Things like starting-money: 1500 mean that players start with 1500. And doesn't require much thought. This is also where almost EVERY message in the plugin can be customised (Including translated or completely different messages.
Items
Items are mainly defined within the gui/economy: section; and have a few key features!
Here is an example item
TestItem:
Material: "DIAMOND" # Grab materials from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html besides "PLAYERHEAD" more on that later.
Amount: 1 # How many in the ItemStack
Title: "Diamond Stick" # Name of the item
Lore:
- "This is the first line of lore!"
- "This is the second!"
- "You can have as many lines as you want!"
- "I support MiniMessage and PlaceholderAPI format!"
This item wouldn't show up as the plugin doesnt call for it. This is why you must NOT! Change the names of the variables in the lang.yml.
You can add CustomModelData to the items with just a simple line at the bottom
Example:
TestItem:
Material: "DIAMOND"
Amount: 1
Title: "Diamond Stick"
Lore:
- "Some Cool Lore"
- "Yep!"
CustomModelData: 1
Custom model data is only useful if you know what you're doing!
Full Config Files
Lang.yml
common:
prefix: "<gray>[<gold>Economic Additions<gray>] "
currency-singular: "Sheep"
currency-plural: "Sheeps"
starting-money: 1500
error-color: "<#EB7272>"
success-color: "<#A6F8C6>"
non-valid-number: "The amount must be a valid decimal number. Got: "
sender-not-a-player: "Only players can use this command!"
target-hasnt-player-before: "The player %parse% has never played on this server before!"
no-permission: "You don't have permission for this command!"
economy:
took-money: "Took %currency% from %parse%'s account."
gave-money: "Gave %currency% to %parse%'s account."
set-money: "Set %parse%'s account to %currency%."
balance: "%parse%'s balance: %currency%"
paid-player: "You paid %parse% %currency%"
recieved-money: "You were paid %currency% from %parse%"
not-enough-money: "You don't have enough money for that!"
actionbar:
enabled: true
update: 2
text: "<gray>%vault_eco_balance% Sheeps"
toggle-on-text: "Action bar toggled ON!"
toggle-off-text: "Action bar toggled OFF!"
stockdisplay:
enabled: true
min-amount: 2000
negative:
prefix: "<gray>[<red>-<gray>] "
suffix: " <gray>Sheeps"
positive:
prefix: "<gray>[<green>+<gray>] "
suffix: " <gray>Sheeps"
toggle-on-text: "Stock Display toggled ON!"
toggle-off-text: "Stock Display toggled OFF!"
gui:
economy:
messages:
cancel-payment: "Cancelling Payment!"
mainMenu:
Title: "Economic Additions"
payItem:
Material: 'DIAMOND'
Amount: 1
Title: "<gold>Pay Players!"
Lore:
- "<gray>Click on this to open the pay player menu!"
- "<gray>EconomicAdditions"
balItem:
Material: 'GOLD_INGOT'
Amount: 2
Title: "<gold>Balances!"
Lore:
- "<gray>Click on this to check the balances of other players!"
- "<gray>EconomicAdditions"
statsItem:
Material: "PLAYERHEAD"
Amount: 1
Title: "<gold>Stats!"
Lore:
- "You %player_displayname% have: "
- "%vault_eco_balance% Sheeps!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
payMenu:
Title: "ᴘᴀʏ ᴘʟᴀʏᴇʀꜱ"
pay-message: "How much would you like to pay?"
nextFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>ɴᴇxᴛ ᴘᴀɢᴇ"
nextEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>ɴᴇxᴛ ᴘᴀɢᴇ"
prevFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>ᴘʀᴇᴠɪᴏᴜꜱ ᴘᴀɢᴇ"
prevEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>ᴘʀᴇᴠɪᴏᴜꜱ ᴘᴀɢᴇ"
playerHead:
Material: "PLAYERHEAD"
Amount: 1
Title: "<#C7FFEA>%player_displayname%"
Lore:
- "<#A2A2A2>Left Click to pay this player!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
balMenu:
Title: "ᴘʟᴀʏᴇʀ ʙᴀʟᴀɴᴄᴇꜱ"
nextFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>ɴᴇxᴛ ᴘᴀɢᴇ"
nextEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>ɴᴇxᴛ ᴘᴀɢᴇ"
prevFullItem:
Material: "LIME_DYE"
Amount: 1
Title: "<green>ᴘʀᴇᴠɪᴏᴜꜱ ᴘᴀɢᴇ"
prevEmptyItem:
Material: "GRAY_DYE"
Amount: 1
Title: "<gray>ᴘʀᴇᴠɪᴏᴜꜱ ᴘᴀɢᴇ"
playerHead:
Material: "PLAYERHEAD"
Amount: 1
Title: "<#C7FFEA>%player_displayname%'s Balance"
Lore:
- "<#A2A2A2>%vault_eco_balance% Sheeps!"
emptyItem:
Material: "GRAY_STAINED_GLASS_PANE"
Amount: 1
Title: ""
评论 0
登录后参与评分
还没有评论,来抢沙发吧