这是一个支持主流经济插件(iConomy、BOSEconomy、Essentials 和 MultiCurrency)的商店插件。该插件从零开始编写,旨在恢复那些似乎正从服务器中消失的商店命令。此插件还要求你在 plugins 文件夹中包含 这个 Register Jar。
命令
所有商店命令都位于 "/shop" 下。
第一个参数是 "buy"(购买)、"sell"(出售)或 "check"(查看)。"buy" 会让玩家以配置文件中定义的价格获得物品。"sell" 会让玩家出售物品并获得金钱。"check" 允许玩家查看物品的价格。
第二个参数是物品名称。这可以是 Bukkit 提供的名称(例如 "diamond_pick_axe"),如果你安装了 Essentials,也可以是 Essentials 的名称(例如 "diamondpickaxe"),或者是配置文件中定义的任何名称。你可以添加一个冒号 (:) 并在其后放置一个数字(中间不要有空格)来指定特定的材质数据。你也可以根据物品类型本身使用名称(例如 "blue" 或 "birch")。
第三个参数是可选的,表示要购买或出售的数量。如果未定义,则默认为 1。输入一个数字即可购买或出售相应数量。在出售时,你可以使用 "all",这将出售你背包中该类型的所有物品。指定材质数据将强制仅出售该特定类型的物品。
配置
首次运行带有此插件的服务端时,它会在 "plugins/eShop/" 文件夹中生成三个文件。
item.price.txt
此文件包含所有命令的成本。每行按以下格式填写数字:
<Item ID> [Data] <Buy Amount> <Sell Amount>
你可以在行中添加数据值,但这将导致价格仅适用于该数据值。物品 ID 和数据值均为正整数,而购买和出售金额为双精度浮点数。某些经济插件会对价格值进行四舍五入。如果发生这种情况,它会在插件加载前报告警告(请注意观察)。如果将任何价格设置为 0,它将阻止该特定操作(例如:将购买价格设为 0 将防止购买该物品,但仍允许出售)。
item.local.txt
此文件允许你设置用于查找物品的名称。文件读取方式如下:
你可以为名称定义数据值。物品 ID 和数据值均为正整数。名称可以是任何字符串,除非它包含空格或冒号 (:)(尽管请遵循常识,不要使用标准键盘上找不到的字符)。
plugin.local.txt
这是插件的本地化文件。几乎所有玩家消息都存储在此处,你可以编辑它们以更改我糟糕的消息提示,甚至使用其他语言。转义字符为 '&',因此 &[0-F] 将显示为对应颜色,&g 将返回变量(例如价格或物品类型),而 && 将返回 '&' 字符。
此外,此文件中有一行被注释掉的代码:"Permissions = true"。如果你使用的权限插件不使用 Bukkit 内置系统,取消注释此行即可使其正常工作。这样做将激活 Permissions 钩子,因此 Permissions 2.7、3.x 和 GroupManagerBridge 都应该可以工作。
权限
此插件有三个权限节点和一个涵盖所有这三个节点的父节点。具体如下:
eShop.buy = allows player to use /shop buy
eShop.sell = allows player to use /shop sell
eShop.check = allows player to check prices (implied if they have .buy or .sell)
eShop = all of the above
This is a Shop plugin supporting the major economy plugins (iConomy, BOSEconomy, Essentials', and MultiCurrency). This was coded from the ground up with the intent to return the shop commands that seem to be disappearing from servers. The plugin requires you have This Register Jar in your plugins folder too.
Commands
All the shop commands can be found under "/shop".
The first argument is "buy", "sell", or "check". "buy" gives the player the item for the amount of money defined in the configuration files. "sell" gives the player the money for the items. "check" allows the player to see how much the items go for.
The second argument is the item. This is either a name as given by bukkit (ex. "diamond_pick_axe"), Essentials if you have it installed (ex. "diamondpickaxe"), or any names defined in the configuration. you can add a colon (:) and put a number after it (no spaces) for a specific material data. You can also use a name for the type (ex. "blue" or "birch") based on the item type itself.
The third argument is optional, and it's the amount to buy or sell. If you don't define it, it implies 1. Define a number to purchase or sell that amount. If you're selling, you can use "all" and it will sell all the items of that type in your inventory. Defining a material data will force only that type to be sold.
Configuration
The first time you run the server with the plugin, it will make three files in the folder "plugins/eShop/".
item.price.txt
This holds all the costs for the command. Format each line with the numbers as follows:
<Item ID> [Data] <Buy Amount> <Sell Amount>
You can add the data value to the line, however that will force the price to only apply to that data value alone. The Item ID and the Data are both positive integers, while the buy and sell amounts are doubles. Some economy plugins round the values of the prices. If that happens, it will report a warning just before the plugin loads (look out for it). If you set any of the prices to 0, it will prevent that specific action (example: setting buy as 0 will prevent the purchase of the item, but still allow it to be sold).
item.local.txt
This allows you to set names used to find items. The file reads as so:
You can define a data value for the name. The Item ID and Data are both positive integers. Name can be any string unless it contains a space or a colon (:) (although use common sense and don't use something not on standard keyboards).
plugin.local.txt
This is the localization for the plugin. Almost all the player messages are stored here and can be edited to either change my horrible messages or to even use a different language. The escape character for this is '&', so &[0-F] will be that color, &g will return the variable (ex. the price or the item type), and && will return a '&' character.
Also, there is a commented out line in this file, "Permissions = true". If you use a permissions plugin that doesn't use bukkit's built in system, uncommenting this line should get it to work. Doing so will activate the Permissions hook, so Permissions 2.7, 3.x, and GroupManagerBridge should all work.
Permissions
This plugin has three permissions nodes and one parent node that covers all three. They are as follows:
eShop.buy = allows player to use /shop buy
eShop.sell = allows player to use /shop sell
eShop.check = allows player to check prices (implied if they have .buy or .sell)
eShop = all of the above
评论 0
登录后参与评分
还没有评论,来抢沙发吧