GiveTo
给予物品(及套装)并支持权限与经济系统
版本: v0.8
CraftBukkit: 1597 (1337, 1240, 1185, 1060, 1000)
GiveTo 是一种向其他玩家或自己发放物品的简便方法。使用 Permissions 或 EssentialsGroupManager(配合 EssentialsGroupBridge)可以实现精细的管理控制。通过 Register,GiveTo 支持 iConomy 4/5/6、BOSEconomy 7、MultiCurrency 以及 Essentials Economy。
你可以通过 ID 或名称来指定物品。如果没有直接匹配的物品,GiveTo 会尝试搜索匹配项。如果存在多个结果,系统将展示一个匹配列表供你选择。
你还可以指定发放的数量。每个物品可以拥有各自默认和最大数量限制;或者 GiveTo 会使用在配置中设置的全局数量限制。
功能特性
- 支持物品 ID 或名称,具备搜索与结果展示功能
- 支持全局/特定物品的默认数量和最大数量限制
- 支持全局/特定物品的成本设定
- 支持全局/特定物品的冷却时间(延迟)
- 快捷的自我发放命令
- 物品可拥有多个别名,并可作为套装使用
- 自定义提示信息
- 可配置的命令名称(需修改 plugin.yml)
- 权限支持(否则默认为 OP):命令使用、重载、特定物品/套装、豁免延迟/成本等
命令
GiveTo 添加了两个命令:/giveto (/gto /give) 和 /giveme (/gme)。两者均可将 "reload" 作为第一个参数以触发 config.yml 的重载。/gto 支持从控制台执行全部功能。
- /gto <player> <item> [count]
- /gme <item> [count]
玩家参数可以是玩家名称或 "me"。只要只有一个匹配结果,你可以输入玩家名称的一部分。输入 /gto ltg ... 将会向 "ltguide" 发放物品。
物品参数可以是数字 ID,也可以是包含空格或使用 * 作为通配符的文本。例如,假设你有两个物品:cobblestone(圆石)和 cobblestone stairs(圆石台阶)。输入 /gme co st 3 将会显示这两个物品。然而,输入 /gme co sta 3 将会给你 3 个 cobblestone stairs(圆石台阶)。你也可以使用 c a,但实际匹配结果取决于你已添加的其他物品。
你还可以指定“耐久度”,这将覆盖配置文件中设定的值。例如,/gme sapling:1 将会给你一棵云杉树苗。这对于地图非常有用,因为地图数量太多,不便在配置文件中逐一列出。
如果你想更改命令名称,则需要在 .jar 包内的 plugin.yml 中进行修改。(7-zip:打开 jar 文件,右键点击 plugin.yml,选择“编辑”)
配置
count:
max: 512
def: 64
delay: 0
cost: 0
updateinventory: ['someclientmoduser','anothersuchuser']
消息:
参数长度: '&5语法:&f%s'
权限: '&c你没有权限。'
物品:
石头:
别名: rock
ID: '1'
套件:
def: 1
max: 1
permission: beginnerset
delay: 600
cost: 5
id:
- '276'
- '277'
- '278'
- '279'
- '259'
- '288'
这是一个示例配置。完整的 config.yml 将在你启动服务器时自动创建于 plugins/GiveTo 文件夹中。你也可以在下面下载完整的 config.yml。YML 文件需要使用空格而非制表符,且缩进层级非常重要。
数量(Count)
如果在 /gto 或 /gme 命令中未指定数量,则将使用 "def"(默认)值。"max" 值表示每个物品可给予的最大数量。
冷却时间(Delay)
如果物品配置中未指定延迟(冷却时间),则使用全局延迟。特定物品的延迟可以小于全局延迟。
费用(Cost)
如果在配置中指定了费用,Register.jar 将在你启动服务器时创建于 lib/ 文件夹中。你需要重新加载或重启服务器,否则玩家的账户将不会扣除任何金钱。 特定物品的费用可以小于全局费用。
更新物品栏
用于物品栏的客户端模组(TooManyItems)需要调用 updateInventory() 才能进行视觉更新。然而,此 API 方法已被弃用,因此不应使用,因为未来版本可能会将其移除。调用该方法会向玩家重新发送整个物品栏内容,从而消耗更多的服务器带宽。默认情况下,GiveTo 插件不会使用它,但如果大量用户请求,可以通过配置特定用户或使用 '*' 全局启用。
消息
你可以使用 颜色代码 来控制消息中的颜色。你可以通过使用 %2$s 和 %1$s 而不是 %s 来翻转替换的顺序。你不必使用所有的替换项,例如不显示余额。
物品
物品名称 - 可以包含空格,例如 glowstone block
- id - 必填 - ID 作为字符串:'1' 或 ID 作为字符串列表:['276','277'](或以长格式;参见上述配置);对于耐久度值请使用冒号:'35:4'
- alias - 可选 - 另一个常用名称,例如 netherstone 对应 netherrack(也可以是列表,参见上面的 'id')
- def - 可选 - 默认数量
- max - 可选 - 最大数量
- delay - 可选 - 再次给予物品前的延迟秒数(冷却时间)
- cost - 可选 - 金钱金额
- permission - 可选 - 如果指定了权限,用户需要拥有 giveto.item.PERMISSION 才能给予该物品
权限
- giveto.others - /gto
- giveto.self - /gme
- giveto.reload - /g* reload
- giveto.item.PERMISSION - 如果你设置了特定于物品的权限,则此项为必填
- giveto.exempt.delay - 免除延迟期
- giveto.exempt.cost - 免除费用(所有物品免费)
你可以将相同的权限分配给多个物品(例如,permission: builder),然后将用户或组分配 'giveto.item.builder'。给 lava、bedrock 等添加权限可能是一个好主意。
如果没有可用的类似 Permissions 的插件,则将使用 Bukkit Permissions (SuperPerms),默认情况下它将仅授予 OP 所有访问权限。
下载 GiveTo 插件 (静态版本)
下载 GiveTo 插件 (文件名中包含版本号)
查看完整物品列表
源代码
更新日志
版本 0.8
- 添加了新物品
- 更新了 Register 支持(不再需要放在 /lib 中)
- 如果没有类似 Permissions 的插件,则使用 Bukkit Permissions (SuperPerms)
版本 0.7
- 添加了可配置的 updateInventory() 用于修复客户端模组问题
- 更新了 Register 支持(iConomy 6, MultiCurrency, BOSE7)
- 修复了费用消息显示之前余额的问题
版本 0.62
版本 0.61
- 移除了对 utf-8 编码 config.yml 的需求(现在使用 & 表示颜色,而不是 unicode)
- 更新了经济系统支持
- 修复了默认耐久度问题(修复了某些生成物品无法合成问题)
- 修复了指定耐久度时的名称查找问题(yellow wool:5 实际上是 Light Green Wool)
版本 0.6
版本 0.5
- 能够指定物品的自定义耐久度(map:2)
- 经济系统支持(费用)
- 延迟期/冷却时间(delay)
- 费用/延迟豁免的权限
- 每个物品多个别名
版本 0.4
- 在 plugin.yml 中正确使用命令别名
- 从 onCommand 中移除不必要的 if 语句
- 覆盖 /give 命令
- 背包已满的消息
版本 0.3
版本 0.2
- 在启用和重载时显示已加载的物品
- 预发布版本的轻微清理
版本 0.1
GiveTo
Give Items (& Kits) w/ Permissions & Economy Support
Version: v0.8
CraftBukkit: 1597 (1337, 1240, 1185, 1060, 1000)
GiveTo is an easy way to give items to other players or yourself. Using Permissions or EssentialsGroupManager (w/ EssentialsGroupBridge) allows fine administrative control. GiveTo supports iConomy 4/5/6, BOSEconomy 7, MultiCurrency, and Essentials Economy via Register.
You can give an item by ID or NAME. If no item matches directly, GiveTo attempts to search for a matching item. If there is more than one result, you are presented a list of matches.
You can also specify an amount to give. Each item can have its own default and max amounts. Or GiveTo will use the global amounts configured.
Features
- Item ID or Name with searching & results
- Global/Item-specific default and max amounts
- Global/Item-specific costs
- Global/Item-specific delays (cooldown)
- Quick self-give command
- Items can have multiple aliases and also act as a kit
- Customizable messages
- Configurable command names (with plugin.yml change)
- Permissions Support (else OPs): command use, reload, specific items/kits, delay/cost exemptions
Commands
GiveTo adds two commands: /giveto (/gto /give) and /giveme (/gme). Both accept "reload" as the first argument to trigger a reload of the config.yml. /gto has full functionality from the console.
- /gto <player> <item> [count]
- /gme <item> [count]
The player can be a player name or "me." As long as there is only one match, you can enter part of a player name. Entering /gto ltg ... will give items to "ltguide."
The item can be an ID number or text that includes spaces or * as a wildcard. For example, assume you have two items: cobblestone and cobblestone stairs. Entering /gme co st 3 will display the two items. However, /gme co sta 3 will give you 3 cobblestone stairs. You could also use c a, but it actually matching would depend on what other items you have added.
You can also specify a "durability" that will override the one set in config. For example, /gme sapling:1 will give you a Spruce Sapling. This is useful for Maps since there are too many to conveniently list in the config.
If you want to change the commands, then you need to change them in plugin.yml inside the .jar. (7-zip: open jar, right-click plugin.yml, "Edit")
Configuration
count:
max: 512
def: 64
delay: 0
cost: 0
updateinventory: ['someclientmoduser','anothersuchuser']
messages:
arglength: '&5Syntax:&f%s'
permission: '&cYoudonothavepermission.'
items:
stone:
alias: rock
id: '1'
kit:
def: 1
max: 1
permission: beginnerset
delay: 600
cost: 5
id:
- '276'
- '277'
- '278'
- '279'
- '259'
- '288'
That is a sample configuration. The full config.yml will be created in the plugins/GiveTo folder when you start the server. You can also download the full config.yml below. YML files requires spaces instead of tabs and the level of indention matters.
Count
If no amount is specified to /gto or /gme then the "def" value is used. The "max" value is the maximum amount that can be given per item.
Delay
If no delay (cooldown) is specified in the item, then the global delay is used. The delay on a specific item can be less than the global.
Cost
If a cost is specified in the config, then Register.jar will be created in the lib/ folder when you start the server. You will need to reload/restart the server or no money will be deducted from a player's account. The cost on a specific item can be less than the global.
Update Inventory
Client mods for inventory (TooManyItems) require updateInventory() to visually update. However, this API method is deprecated so it shouldn't be used because a future update may remove it. Using this call resends the entire inventory to the player, so it requires more bandwidth from the server. By default the GiveTo plugin will not use it, but it can be enabled for certain users or globally with '*' if a lot of users request it.
Messages
You can use Color Codes to control the colors in messages. You can flip the order of replacements by using %2$s and %1$s instead of %s. You don't have to use every replacement either, i.e. not showing balance.
Items
item name - can contain spaces, i.e. glowstone block
- id - required - ID as string: '1' or ID as string list: ['276','277'] (or in long form; see above config); for durability values use a colon: '35:4'
- alias - optional - another common name, i.e. netherstone for netherrack (can also be a list, see 'id' above)
- def - optional - default amount
- max - optional - maximum amount
- delay - optional - delay seconds before giving item again(cooldown)
- cost - optional - money amount
- permission - optional - if specified, the user needs to have giveto.item.PERMISSION to give
Permissions
- giveto.others - /gto
- giveto.self - /gme
- giveto.reload - /g* reload
- giveto.item.PERMISSION - required if you set an item specific permission
- giveto.exempt.delay - exempt from delay period
- giveto.exempt.cost - exempt from cost (all items FREE)
You can assign the same permission to multiple items (i.e., permission: builder) then assign a user or group 'giveto.item.builder' It's probably a good idea to add a permission to lava, bedrock, etc.
If any Permissions-like plugins are not available then Bukkit Permissions (SuperPerms) is used which, by default, will grant all access to OPs only.
Download GiveTo Plugin (Static)
Download GiveTo Plugin (version in filename)
View Full Items List
Source Code
Changelog
Version 0.8
- added new items
- updated Register support (no longer needed in /lib)
- uses Bukkit Permissions (SuperPerms) if no Permissions-like plugin
Version 0.7
- added configurable updateInventory() for client mod fix
- updated Register support (iConomy 6, MultiCurrency, BOSE7)
- fix cost message showing previous balance
Version 0.62
Version 0.61
- remove need for utf-8 encoded config.yml (now uses & for color instead of unicode)
- updated economy support
- fix default durability (fixes unable to craft with some spawned items)
- fix name lookup with specified durability (yellow wool:5 is really Light Green Wool)
Version 0.6
Version 0.5
- able to specify custom durability on item (map:2)
- economy support (cost)
- delay periods/cooldown (delay)
- permissions for cost/delay exemptions
- multiple aliases per item
Version 0.4
- properly use command aliases in plugin.yml
- remove unnecessary if from onCommand
- override /give
- inventory full message
Version 0.3
- No longer requires target as exact player name, will search
Version 0.2
- Displays loaded items onEnable and reload
- Minor cleanup from pre-release
Version 0.1
评论 0
登录后参与评分
还没有评论,来抢沙发吧