版本 2.16(适用于 1.9.4)
概述
允许玩家手动或在工具即将损坏前自动修复其工具。当使用工具击打方块且该工具即将损坏时,将触发自动修复。此修复功能可以消耗一定数量的一种或多种材料、在使用经济系统时消耗固定金额的经验值(从玩家总经验值中扣除),或者免费进行。该功能集包含多种可配置选项。
功能
- 修复你的工具、武器和盔甲
- 修复可以是免费的,也可以消耗物品、通过经济系统扣费、消耗经验值,或上述方式的任意组合;具体取决于配置设置,不同物品可能有不同的设定。
- 修复可以手动触发或自动触发
- 自动修复在物品即将损坏前触发
- 同样适用于附魔物品,可通过配置选项禁用此功能;支持为附魔和非附魔物品设置不同的价格!
- 通过 PermissionsBukkit 支持权限控制(可能兼容其他权限系统,但未进行测试)
- 通过 Vault 支持经济系统
- 可根据物品的损坏程度设置不同的修复费用
- 可以建造修复铁砧,强制在特定位置进行修复。
- 添加了可配置的绑定到特定权限节点的项目集合,允许管理员选择哪些用户组能够修复特定物品或物品集合。
- [新增] 现在支持通过命令为每个玩家单独禁用该功能。
更新日志
版本 2.16
- 正式支持从配方列表中移除物品。config.yml 将在插件首次启动时自动生成,并包含所有支持的物品。如果移除了某个物品,则该物品的修复功能实际上将被禁用。
- 添加了 'enable' 和 'disable' 命令,允许玩家自行禁用自动修复(如果他们拥有相应权限)。
- 锄头现在可以正确地进行自动修复。
版本 2.12
版本 2.10
- 添加了新的命令别名:'/ar'
- 添加了在配方部分指定物品 ID 的能力,例如 DIAMOND_SWORD 也可以表示为 '276'。这应该允许与武器模组兼容(然而,此功能未经测试!正在寻找测试志愿者)。
版本 2.00
- 关于版本 2.00 的大多数新信息可以在“设置”部分找到;该部分已为此新版本完全重写。
- 添加了新的费用类型:XP(经验值)
- 添加了区分附魔与非附魔物品价格的能力
- 全新、更友好的配置格式;如果存在旧配置文件,它会自动将其内容转换为新格式
- 插件运行时会自动安装配置文件,不再需要手动安装
版本 1.84
- 添加了在铁砧处建造和修复的功能(铁砧旁边放置一个写有 "anvil" 的告示牌)
- 在配置中添加了修复后附魔物品失去附魔的能力
- 添加了 ''repcommands'' 权限节点,以限制仅能访问手动修复命令
设置
自版本 2.00 起,AutoRepair 只有一个配置文件:即 plugins/AutoRepair 文件夹中的 config.yml。该文件包含两个部分,一部分专门用于修复“配方”,另一部分用于常规配置。
如果你使用的是旧版 1.84 或更早版本的配置文件,v2.00 会读取这些设置,并从中构建一个新的 config.yml,然后开始使用该文件。从 1.84 过渡到 2.00 的过程中,设置不应丢失。
如需查看示例 config.yml 文件,请点击此处。
'recipes' 部分
配方部分列出了每种可修复物品的具体费用。每个物品下的字段都是可选的;如果没有字段,则默认为该物品无修复费用且修复免费。以下是单个物品的最大可能格式:
LEATHER_HELMET:
permission-group: 1
normal:
LEATHER: 5
item-cost-min: 1
econ-cost: 5.5
econ-cost-min: 1.0
xp-cost: 6
xp-cost-min: 1
enchanted:
LEATHER: 5
GOLD_INGOT: 1
item-cost-min: 1
econ-cost: 7.5
econ-cost-min: 2.0
xp-cost: 20
xp-cost-min: 5
'276':
normal:
DIAMOND: 2
STICK: 1
- ITEM_NAME(大写):描述此特定配方的用途。有效物品名称列表见此处。或者,也可以使用 '<item-data-id>' 指定;这应该允许与武器模组兼容(未经测试!!)。
- permission-group:范围是 1-9。允许将特定物品归入 9 个组之一,然后需要设置特定的权限才能允许修复该组物品。权限名为 'autorepair.itemgroup#',其中 # 替换为所需的组号。如果未指定,物品默认为 0,等同于“无组”。
- normal 与 enchanted:可以为普通物品和附魔物品分别指定不同的费用。
- ITEM_NAME(小写):修复此特定物品的物品消耗。有效物品名称列表见此处。每个物品可以有多个物品消耗,如“enchanted”下的示例所示。
- XXX-cost:修复该物品的具体消耗。如果相应的配置选项已关闭,此项将被忽略。如果缺少此消耗,则默认消耗为 0。
- XXX-cost-min:如果在配置中将具体消耗设置为“调整”,则这是进行修复时的最低可能消耗。这可以防止用户在物品使用 3 次后进行修复,导致每次物品消耗都为 0,从而免费获得修复。
'config' 部分
配置部分的布局现在与其他 Bukkit 插件更一致;这是一系列允许自定义插件的 true/false 变量。请注意,版本 2.00 中并没有新增任何内容,只是以略有不同的格式呈现。所有字段均为 true/false,除了 anvilUse.anvilBlockType。
- repairOfEnchantedItems.allow:允许修复附魔物品。
- repairOfEnchantedItems.lose-enchantment:如果允许修复附魔物品,它们在修复后将失去附魔
- usePermissions:如果安装了权限系统,这将强制对所有操作进行权限检查。'''仅在'''安装了权限系统时使用。
- automaticRepair.allow:如果满足消耗要求,允许在工具损坏之前自动进行修复。
- automaticRepair.no-warnings:这会关闭工具接近损坏点时通常会出现的警告;无论自动修复是开启还是关闭都会生效。
- automaticRepair.no-notifications:禁用工具自动修复时出现的修复通知。
- anvilUse.allow:允许制作和使用铁砧
- anvilUse.anvilBlockType:指定制作铁砧所需的特定方块类型。格式与配方部分中的物品相同。默认为 IRON_BLOCK。
- econCost.use:如果链接了经济系统,并且在配方部分为特定物品指定了 econ 消耗,则使用经济消耗
- econCost.adjust-for-damage:如果启用了 econCost,这将根据物品损坏百分比调整修复的经济成本。
- xpCost.use: 如果配方部分为特定物品指定了 xp 消耗,则使用经验值消耗
- xpCost.adjust-for-damage:如果启用了 xpCost,这将根据物品损坏百分比调整修复的经验值消耗。
- itemCost.use:如果配方部分为特定物品指定了物品消耗,则使用物品消耗
- itemCost.adjust-for-damage:如果启用了 itemCost,这将根据物品损坏百分比调整修复的物品消耗。
经济系统
通过 Vault 使用经济插件是可选的。您可以配置此插件使用经济插件的货币来收取修复费用。但是,如果您希望使用经济插件,则必须同时运行 Vault。
如果未检测到经济插件和/或 Vault,并且您在配置中启用了 econCosts,则在安装有效的经济系统之前,这些功能将被禁用。
铁砧
现在可以制作铁砧,以迫使玩家在特定位置进行修复操作。
铁砧的制作方法是放置一个铁块,然后在相邻的任何空间放置一个写着“anvil”的告示牌。右键点击铁块即可启动修复,前提是设置了正确的配置和权限选项。
在管理员希望将修复限制为仅在铁砧处进行的情况下,权限和配置设置如下:(未提及的字段被视为不相关或由管理员决定)
- anvilUse.allow: true
- automaticRepair.allow: false
- automaticRepair.no-warnings: true
- usePermissions: true ''(你需要有一个权限插件)''
- 启用权限节点 AutoRepair.access、AutoRepair.repair 和 AutoRepair.warn
- 明确禁用权限节点 AutoRepair.repcommand
权限
版本 2.00 中唯一的新权限是“itemgroup”权限。必须指定用户应属于的每一个权限;如果他们应属于所有 9 个可能的 itemgroup,则必须分别指定这 9 个权限。
Bukkit 权限是可选的,如果未安装权限插件或为此插件禁用了权限,则所有功能将对所有用户可用。如果将 default config.properties 文件中的 permissions=false 行更改为 true,则权限将开启。
可用的权限节点(区分大小写)包括:
- AutoRepair.access - 允许使用此插件,没有此权限用户无法执行任何操作
- AutoRepair.info - 允许使用 ? 和 dmg 命令
- AutoRepair.warn - 允许在工具即将损坏时发出警告
- AutoRepair.repair - 允许修复用户背包中的物品,无论是自动还是手动
- AutoRepair.repcommands - 允许使用手动命令来修复物品
- AutoRepair.repair.enchanted - 允许修复附魔物品,如果 autorepair 配置相应设置
- AutoRepair.auto - 启用用户背包中工具的自动修复
- AutoRepair.auto.disable
允许玩家通过 '/rep disable' 命令禁用自动修复。
- AutoRepair.reload - 允许用户重新加载插件
- AutoRepair.itemgroup1 - 允许用户修复配置中已设置为物品组 1 的物品
- AutoRepair.itemgroup2 - 允许用户修复配置中已设置为物品组 2 的物品
- AutoRepair.itemgroup[3-9] - 遵循与 itemgroup1 和 2 相同的格式,但适用于第 3 至第 9 组。
命令用法
有三个命令别名:'/repair'、'/rep' 和 '/ar'。为方便起见,我们将使用 /rep 来描述这些命令。
- '/rep [快捷栏槽位 1-9]' 修复该槽位中的工具/护甲,并从背包中扣除费用
- '/rep [快捷栏槽位 1-9] ?' 告知你需要何种物品以及需要多少数量来修复此物品
- '/rep [快捷栏槽位 1-9] dmg' 告知你此工具在损坏前还剩多少次使用机会
- '/rep'、'/rep ?'、'/rep dmg' 用于手中持有的物品
- '/rep all' 修复背包中所有可修复的物品,包括穿戴的护甲
- '/rep arm' 修复你当前装备的所有护甲
- '/rep arm ?' 告知你需要什么来修复你已装备的护甲
- '/rep reload' 重新加载配置文件
- '/rep disable' 禁用你自己的自动修复功能
- '/rep enable' 重新启用你自己的自动修复功能(在禁用之后)
Bugs - Create a ticket if you find one, please
Pull Requests
我欢迎对本项目的拉取请求,请访问我的 GitHub 仓库。
version 2.16 (For 1.9.4)
Overview
Allows a player to repair their tools, either manually, or automatically just before they break. Automatic repairing will trigger on hitting a block with a tool when the tool is about to break. This repairing can be done at the cost of a given amount of one or more materials, a set amount of money if an economy system is in use, a set amount of experience points deducted from the player's total, or for free. There is a variety of configurability included within this feature set.
Features
- Repairs your tools, weapons and armour
- Repairs can either be free, cost items, cost via economy, cost xp, or any combination thereof; these can vary on a per-item basis, depending on configuration settings.
- Repairs can be triggered manually or automatically
- Automatic repairs are triggered just before an item breaks
- Works on enchanted items too, this can be disabled via config options; has ability to have different prices for enchanted and non-enchanted items!
- Permissions support through PermissionsBukkit (may work, but not tested with, other Permissions systems)
- Economy support through Vault
- Repairs can be set to have varying cost depending on how damaged the item is
- Repair anvils can be constructed to force repairs to occur at a certain location.
- Added configurable sets of items that are attached to specific permission nodes, allowing admins to select which groups of users should be able to repair specific items or sets of items.
- [NEW] Per-player disabling via command is now supported.
New
Version 2.16
- Removing items from the recipes list is now officially supported. The config.yml will automatically generate the first time the plugin is started, and contain all supported items. If an item is removed, repair of that item is effectively disabled.
- Added 'enable' and 'disable' commands that allow players to disable autorepair on themselves, if they like (and if they're given permissions to do so).
- Hoes now properly autorepair.
Version 2.12
- Fishing poles actually autorepair now.
Version 2.10
- Added new command alias: '/ar'
- Added ability for items to be repaired in the recipe section to be specified as their item id, i.e. DIAMOND_SWORD could also be '276'. This should allow compatibility with weapon mods (however, this is untested! Looking for testing volunteers).
Version 2.00
- Most of the new information about version 2.00 can be found under the "setup" section; that section has been completely rewritten for this new version.
- Added new cost type: XP
- Added ability to differentiate prices between enchanted and non-enchanted items
- New, more user-friendly config format; if old config files are present, it will convert their contents to the new format
- Config will now install itself when the plugin is run, instead of requiring manual installation
Version 1.84
- Added ability to construct and repair at Anvils (1 iron block next to a sign that says "anvil")
- Added ability in configuration to have enchanted items lose their enchantment upon being repaired
- Added in ''repcommands'' permission node to restrict access only to the manual repair commands
Setup
As of version 2.00, there is only one config file for AutoRepair: it's the config.yml in your plugins/AutoRepair folder. This file has two sections, one dedicated to the repair "recipes", and the other dedicated to the configuration.
If you have the old 1.84 or before config files, then v2.00 will take those settings, and construct a new config.yml from them, and then begin using that file. Settings should not be lost in the transition from 1.84 to 2.00.
For an example config.yml file, go here.
'recipes' section
The recipe section enumerates the specific cost for each item that it is possible to repair. Each of the fields under each item is optional; if no fields are present, it is assumed that there is no repair cost for the item and that repairs are free. The following is the largest possible format for one specific item:
LEATHER_HELMET:
permission-group: 1
normal:
LEATHER: 5
item-cost-min: 1
econ-cost: 5.5
econ-cost-min: 1.0
xp-cost: 6
xp-cost-min: 1
enchanted:
LEATHER: 5
GOLD_INGOT: 1
item-cost-min: 1
econ-cost: 7.5
econ-cost-min: 2.0
xp-cost: 20
xp-cost-min: 5
'276':
normal:
DIAMOND: 2
STICK: 1
- ITEM_NAME (upper): Describes what this particular recipe is for. List of valid item names here. Alternatively, this can be specified as '<item-data-id>'; this should allow for compatibility with weapon mods (untested!!).
- permission-group: Range is 1-9. Allows a specific item to be sorted into one of 9 groups that then require a specific permission to be set in order to allow repair on that group of items. Permission is 'autorepair.itemgroup#', where # is replaced by the desired group number. If not specified, items default to 0, which is the same as "no group".
- normal vs enchanted: it is possible to specify seperate costs for normal and enchanted items.
- ITEM_NAME (lower): the item cost of repairing this specific item. List of valid item names here. There can be multiple item costs for each item, as seen in the example under 'enchanted'.
- XXX-cost: the specific cost of repairing the item. If the corresponding config option is turned off, this will be ignored. If this cost is missing, it is assumed that the cost is 0.
- XXX-cost-min: if the specific cost is set to be "adjusted" in the config, then this is the minimum cost possible when conducting a repair. This prevents users from repairing after 3 uses of an item, causing the item cost to be 0 every time and thus getting away with free repairs.
'config' section
The config section now has a layout more consistant with other Bukkit plugins; a series of true/false variables that allow customization of the plugin. Please note, that nothing here is new to version 2.00, it's just presented in a slightly different format. All fields are true/false, except for anvilUse.anvilBlockType.
- repairOfEnchantedItems.allow: allow repair of enchanted items.
- repairOfEnchantedItems.lose-enchantment: if repairs of enchanted items are allowed, they will lose their enchantment upon being repaired
- usePermissions: if a permissions system is installed, this will force permission checks on all operations. '''ONLY USE IF''' a permissions system is installed.
- automaticRepair.allow: allow repairs to be done automatically before tools break, if cost requirements are met.
- automaticRepair.no-warnings: This turns off warnings that would otherwise occur when tools are near breaking points; this is true whether automatic repairs are on or off.
- automaticRepair.no-notifications: Disables repair notifications that occur when tools are repaired automatically.
- anvilUse.allow: allow construction and use of anvils
- anvilUse.anvilBlockType: specifies the specific block type that is required to make an anvil. Same format as items in the recipe section. Default is IRON_BLOCK.
- econCost.use: use economy cost for an item, if economy linked, and econ cost specified for specific item in recipe section
- econCost.adjust-for-damage: if econCost is enabled, this will adjust the economy cost of repairing based on the % of damage to the item.
- xpCost.use: use experience point cost for an item, if xp cost specified for specific item in recipe section
- xpCost.adjust-for-damage: if xpCost is enabled, this will adjust the xp cost of repairing based on the % of damage to the item.
- itemCost.use: use item cost for an item, if item cost specified for specific item in recipe section
- itemCost.adjust-for-damage: if itemCost is enabled, this will adjust the item cost of repairing based on the % of damage to the item.
Economy
Usage of an economy plugin via Vault is optional. You can configure this plugin to use an economy plugin's cash to charge for a repair. However, if you wish to use an economy plugin you MUST also run Vault.
If an economy plugin and/or Vault is not detected, and you have econCosts enabled in your configuration, these will be disabled until a valid economy is installed.
Anvils
Anvils can now be constructed to force players to conduct their repair operation in one specific location.
An anvil is construct by placing an iron block, and then placing a sign that says "anvil" in any neighboring space. Right-clicking the iron block will then initiate the repair, given that the proper configuration and permission options have been set.
Permission and configuration setup for a situation where an admin wishes to limit repairs to only at anvils are as follows: (unmentioned fields are assumed to be non-relevant or up to the admin)
- anvilUse.allow: true
- automaticRepair.allow: false
- automaticRepair.no-warnings: true
- usePermissions: true ''(you need to have a permissions plugin)''
- permission nodes AutoRepair.access, AutoRepair.repair, and AutoRepair.warn are enabled
- permission node AutoRepair.repcommand is explicitly disabled
Permissions
The only new permissions in version 2.00 are the "itemgroup" permissions. It is necessary to specify each one of these that a user should belong to; if they should belong to all 9 possible itemgroups, then you will have to specify out each of those 9 permissions.
Bukkit permissions is optional and if permissions is either not installed or is disabled for this plugin, all features will be available for all users. Will be turned on if the line permissions=false in the default config.properties file is changed to true.
Available permission nodes are (case sensitive):
- AutoRepair.access - allows the use of this plugin, without this a user cannot do anything
- AutoRepair.info - allows the use of the ? and dmg commands
- AutoRepair.warn - allows warning when a tool is about to break
- AutoRepair.repair - allows items in a user's inventory to be repaired, whether automatic or manually
- AutoRepair.repcommands - allows manual commands to be used to repair items
- AutoRepair.repair.enchanted - allows enchanted items to be repaired, if autorepair config is set accordingly
- AutoRepair.auto - enables AutoRepair of tools in a user's inventory
- AutoRepair.auto.disable
allows a player to disable autorepair via the '/rep disable' command.
- AutoRepair.reload - allows a user to reload the plugin
- AutoRepair.itemgroup1 - allows a user to repair items that have been set into item group 1 by the configuration
- AutoRepair.itemgroup2 - allows a user to repair items that have been set into item group 2 by the configuration
- AutoRepair.itemgroup[3-9] - follows the same format as itemgroup1 and 2, but for groups 3 through 9.
Commands Usage
There are three command aliases: '/repair', '/rep', and '/ar'. For convenience, we will use /rep to describe the commands.
- '/rep [quickbar slot 1-9]' repairs the tool/armour in this slot and deducts cost from inventory
- '/rep [quickbar slot 1-9] ?' tells you what item and how much of it is needed to repair this item
- '/rep [quickbar slot 1-9] dmg' tells you how many uses are left before this tool breaks
- '/rep', '/rep ?', '/rep dmg' for the item in your hand
- '/rep all' to repair ALL repairable items in your inventory including worn armor
- '/rep arm' repairs all of your currently equipped armor
- '/rep arm ?' tells you what you need to repair your equipped armor
- '/rep reload' reloads the config files
- '/rep disable' Disable autorepair for yourself
- '/rep enable' Re-enable autorepair for yourself (after disabling)
Bugs - Create a ticket if you find one, please
Pull Requests
I'm open to pull requests for this project at my github repo.
评论 0
登录后参与评分
还没有评论,来抢沙发吧