想让附魔更难获取吗?是否觉得太多玩家拥有高等级和/或多重附魔的超强力物品?Enchantment Limiter 可以帮你实现这一目标。它通过限制铁砧中书籍的组合,并将附魔台的结果限制为仅产生一种效果来实现这一点。在附魔台上进行附魔时,如果移除附魔,它会返还相应数量的经验等级。自 0.8 版本起,如果能将附魔等级降低到允许的范围,则会直接降级而不是完全移除。
你还可以指定不允许的附魔组合,例如防止任何钻石剑获得锋利附魔。详见下方配置。它会从生成或掉落的物品(包括来自怪物或钓鱼)中移除不允许的附魔。或者可配置为禁止拾取该物品,使其留给有权限的玩家保留。[1.5.4 新增] 如果玩家通过其他方式意外获得了非法物品,还可以限制其使用。将 Fix held items 设置为 false。
强制执行通过铁砧提升附魔的不同方式,包括物品+物品以及物品与允许的书籍组合。还添加了一个安全机制,以应对 Bukkit 有时允许非法铁砧附魔的漏洞。
在处理拒绝附魔时的铁砧修复过程中,我添加了一个新功能,你可以启用它 使铁砧永远不会耗尽耐久
Enchantment Limiter 的灵感来源于 inspired by Everyonc,并基于我的相关插件 Unbreakable Items 的代码。
配置
如果不存在默认配置文件,则写入 plugins/EnchLimiter/config.yml。
Message on cancel。决定是否在玩家将第二本书放入铁砧且本插件将其退回时向玩家发送消息。默认为 true。
Message on limit。决定是否在玩家的附魔台尝试中移除了第二个附魔时向其发送消息。告知他们返还的经验值数量。默认为 true。
Message on disallowed。决定是否在玩家的附魔台尝试中移除了不允许的附魔时向其发送消息。告知他们返还的经验值数量。默认为 true。
Message on cancel hold。决定是否在拒绝玩家持有非法附魔物品时向其发送消息。默认为 true。[1.5.4 新增]
限制重复附魔:启用后,禁止在附魔台或铁砧上对物品施加超过一种类型的附魔。不允许通过合并附魔书来添加附魔。默认为 true。[2.7]
最大允许附魔数:当 限制重复附魔 为 true 时,允许你将单个物品上的最大附魔数量从默认的 1 进行修改。
阻止拾取:默认为 false。启用后,当玩家拾取物品时不会移除其附魔,而是直接禁止拾取。如果你还想检查在 1.4 版本中添加的针对铁砧和附魔台的特定禁用列表,请参阅下方的 全局检查应用。
恢复等级:在附魔取消时恢复经验值,此功能于 0.9 版本添加。默认设置与 0.9 版本不同,默认为 true,因此插件通常表现得“友好”。若希望获得与 0.9 版本相同的行为(以起到惩罚效果),请设置为 false。详细说明请参阅版本历史
停止修复:配置文件项,允许在铁砧中修复被禁止的物品。默认值为 true。「修复」定义为每个槽位中的物品相同,最右侧的物品没有附魔,或者最右侧的物品是左侧物品的原材料 [1.6.1]。其他情况可能被视为试图增强附魔。这也意味着某些修复方式将无法使用,例如除了磨损度之外完全相同的两个已附魔物品。通过这种方式进行修复成本较高;建议逐个修复每个工具。
停止所有修复:默认值为 false。若设为 true,则执行此操作:除非拥有新的 allrepairs 权限,否则无法在铁砧中进行任何修复。
降级修复: 已在 1.5.4 版本中移除,由下方选项替代。
铁砧降级:若为 true,则会降级铁砧附魔的结果,而非禁止该操作。默认值为 false。若在放置物品时触发尝试,系统将向玩家发送聊天消息。[1.5.4 新增]
修复刷出的物品:如果设置为 true,则允许非法附魔的禁止刷出物品在生成时进行修复。此类修复无视任何玩家权限或分组。如果你想同时检查 1.4 版本中添加的砧和铁砧特定禁用列表,请参阅下方的 Apply_on_global_check。默认值为 false。此行为影响任何类似“掉落”的物品,例如生物掉落、玩家掉落或钓鱼掉落。在 Stop pickup 为 true 时曾存在此行为;现在你可以单独控制。
无限铁砧:配置项,若为 true,则每次使用铁砧时都会自动修复它,使其永远不会磨损。默认值:false [1.3.2]
修复手持物品:配置项,若为 true,则会“修复”(移除不允许的附魔)玩家手中或 [自 1.5.4 起] 放入盔甲槽的物品。默认值:在 1.5.4 中更改为 true,以避免 Bukkit 有时会遗漏“手持”事件的问题,尤其是在玩家频繁点击按钮时。这是一种捕获未被拾取的物品(例如从战利品箱中取出)的方法,同时仍尊重特定玩家的权限。由于每次玩家更换手持物品时都会执行此操作,因此会增加一定的服务器负载。[1.5.4 新增] 如果设置为 false,玩家将无法将非法物品放入手中(但请参阅关于默认值的担忧)。在装备盔甲时也会进行检查。如果您还想检查 1.4 中添加的针对铁砧和工作台的特定禁止列表,请参见下面的 Apply_on_global_check。
Apply_on_global_check:新增配置节点 [1.5.4 添加],允许在物品生成、玩家拾取或玩家手持事件中引用被禁止的铁砧和/或工作台列表,分别由 Fix spawned items、Stop pickup、Fix held items 控制
- Apply_on_global_check.anvil:如果为 true,则在这些事件期间还将检查 Disallowed anvil enchants。默认为 false
- Apply_on_global_check.table:如果为 true,则在这些事件期间还将检查 Disallowed table enchants。默认为 false
- Apply_on_global_check.restrictive:如果为 true,当 Disalllowed enhants 与其他列表发生冲突时,将使用最高等级。如果为 false,则将使用最低等级。默认为 true。
Lore immutable string:可配置的字符串,如果在物品的描述文本中找到该字符串,则该物品在附魔方面变为不可变。不能再添加 [3.1 版本]
禁止的附魔
支持可选的配置操作来列出禁止的附魔组合。它们的格式如下:
Disallowed enchants:
<Item_Name>:
<Enchantment_Name>: <Level>
....
物品名称和附魔名称 必须全部大写。两者均支持特殊的“ALL”,可匹配所有类型。物品名称支持特殊的“ALL_”子类型,详见此处,同时也支持标准的 Bukkit 名称。附魔名称必须对应标准的 Bukkit/Spigot 名称在此处列出。请注意,Bukkit 的附魔名称与游戏内的名称不同。支持来自其他插件的新附魔的特殊附魔名称,只要你知道其 ID 编号即可,格式为“UNKNOWN_ENCHANT_#”,其中最后一个数字替换为你的 ID 编号。我已在我的Unbreakable Items 插件中对其进行了测试,因此我知道它是有效的,但存在一些注意事项:[1.7 版本新增]
- 该插件必须通过继承 org.bukkit.enchantments.Enchantment 并调用 registerEnchantment 来添加附魔。
- 该插件必须在此插件之前加载,以便能够通过 ID 获取新的附魔。如果无法找到附魔,启动或重新加载时会看到警告。
等级为 1 或更高。拦截等级 n 会拦截 n 及更高等级的附魔,因此指定等级 1 将拦截所有此类附魔。请勿对同一附魔列出多个等级;最后列出的生效,因此如果你将等级 4 放在最后,你仅禁止了等级 4,而非 1-3。[在 1.3.2 中] BOOK 与 ENCHANTED_BOOK 等效且相互适用。
[1.4 新增] 支持针对铁砧或附魔台使用的并行配置项,分别为 Disallowed anvil enchants(铁砧禁用附魔)和 Disallowed table enchants(附魔台禁用附魔)。如果某物品/附魔组合同时出现在上述任一选项以及全局 Disallowed enchants(全局禁用附魔)中,则铁砧/附魔台专用设置将覆盖全局设置;若使用特殊名称 "ALL",则很容易实现这一点。
[1.4 新增] 此外,还支持在上述任意配置项下以关键字 "Group_" 开头的子分支,用于收集使用该组名的一组禁用附魔。Group_ 分支下的语法与上文完全相同。
- 每个组都关联一个动态权限 enchlimiter.Group_<name>,如果玩家拥有该权限,则该组的限制不生效。否则,该组的限制将覆盖全局设置(例如:全局设置为限制等级 3,但组内设置为限制等级 1)。
- 可以在 禁止附魔、禁止铁砧附魔 和 禁止工作台附魔 中为每个部分使用相同的组名
- 这允许你创建特殊的玩家组/类别,只有这些组的成员才能执行其受限的附魔
以下是一个示例:
禁止附魔:
DIAMOND_SWORD:
SILK_TOUCH: 1
DAMAGE_ALL: 3
WOOD_AXE:
FIRE_ASPECT: 1
ALL:
DURABILITY: 2
BOW:
ALL: 2
ALL_SWORDS:
DAMAGE_ALL:2
UNKNOWN_ENCHANT_256: 1
ALL_ARMOR:
THORNS:2
禁止的铁砧附魔:
Group_smithy:
ALL:
ALL: 2
禁止的工作台附魔:
ALL_SWORDS:
ALL: 3
ALL_AXES:
ALL: 3
Group_weaponsmith:
ALL_SWORDS:
ALL: 2
ALL_AXES:
ALL: 2
权限
每项限制都有对应的权限。使用权限是可选的:所有默认设置仅允许 OPerators(拥有者/管理员)使用。
- enchlimiter.books:赋予合并附魔书的权限
- enchlimiter.multiple:赋予在附魔台上从一次附魔中获得多个附魔的权限。
- enchlimiter.disallowed:赋予覆盖 禁止的附魔 配置的权限。
- enchlimiter.repairs:即使 停止修复 为真,也允许修复。
- enchlimiter.allrepairs,即使 停止所有修复 为真,也允许修复。
- enchlimiter.useillegal 当 修复手持物品 为 false 时,允许装备/持有非法物品。[1.5.4]
- enchlimiter.el 允许使用 管理员命令。默认为 Op。
- enchlimiter.elfix 允许使用 elfix 命令。默认为 true。[1.4 新增]
命令
详见 命令页面。
多语言支持
支持多种语言。详见 语言与翻译页面。
未来构想
- 修改设置的命令 [进行中],
保存并重新加载。
- 为每种物品/附魔组合添加新的权限。
- 添加新的 禁止的交易附魔 以允许针对交易的特定阻止。
- 世界特定的配置。
可配置的最大附魔数量(例如 2 但不包括 3) [2.7]
允许重命名被禁止的物品。 [2.7]
护甲快捷方式,如 ALL_ARMOR_DIAMOND 或 ALL_ARMOR_CHAINMAIL [2.5]
ALL_BARDING 不工作。相反,应列出每个 DIAMOND_BARDING、GOLD_BARDING、IRON_BARDING
可以阻止 所有 修复的新配置。
阻止受限制物品的装备(例如,如果 config.yml 最近更改且拥有的物品现在变为受限制),或者在开启 修复手持物品 时进行修复。事实证明这很困难,因为装备护甲的方式太多了。[1.5.4]
允许但在铁砧中降级/移除非法附魔。[1.5.4]
允许 修复手持物品、修复生成物品、停止拾取 检查除全局 禁止的附魔 列表之外的更多项目。[1.5.4]
允许不同的禁止和允许附魔组[v.1.4]
Need to make enchantments harder to get? Too many people with really high level and/or multiply-enchanted, overpowered items? Enchantment Limiter can do that for you. It does so by limiting the combination of books in anvil, and limits enchantment tables to yield only one power. When enchanting on a table, it returns a proportional number of XP levels when it removes an enchantment. Since 0.8, if it can reduce the enchantment level to one that is allowed, does that rather than removing it completely.
You can also specify enchantment combinations that are not allowed, like preventing any diamond swords from having sharpness. See configs below. Removes disallowed enchantments from spawned/dropped items, including from mobs or fishing. Or configurably disallow pickup of the item, leaving them alone for players with permissions. [New in 1.5.4] You can also restrict usage of illegal items, if player somehow gets them by other means. Set Fix held items to false.
Enforces the different ways to boost enchants with an anvil, including item+item and item with a permitted book. Also added a fail-safe to account for the Bukkit bug that sometimes permits illegal anvil enchants.
While I was at it repairing the anvil on rejected enchants, I added a new feature you can enable so anvils can never run out
Enchantment Limiter was inspired by inspired by Everyonc, and was based on code from my related plugin, Unbreakable Items.
Configuration
Default config is written to plugins/EnchLimiter/config.yml if it doesn't exist.
Message on cancel. Decides whether or not to message a player when he places a second book in an anvil and this plugin returns it to him. Default is true.
Message on limit. Decides whether or not to message a player when a second enchantment is removed from his enchantment table attempt. Informs them of returned amount of XP. Default is true.
Message on disallowed. Decides whether or not to message a player a disallowed enchantment is removed from his enchantment table attempt. Informs them of returned amount of XP. Default is true.
Message on cancel hold. Decides whether or not to message a player when denying his holding an illegally enchanted item. Default is true. [Added in 1.5.4]
Limit Multiples: If set, stops any enchantments at tables or anvils from having more than one enchantment type. Combining books not allowed. Defaults to true. [2.7]
Max Enchants Allowed: If Limit Multiples is true, allows you to change max # enchants on a single item from the default of 1.
Stop pickup: defaults false. If set, rather than removing enchants as items are picked up, players cannot pick them up. If you want to also check either anvil- and table-specific disallowed listings added in 1.4, see Apply_on_global_check below.
Restore levels: that restores XP on cancelled enchant, a feature added in 0.9. The default is different than 0.9 and is true, so the plugin normally behaves "nicely". if you want same behavior as 0.9 (to punish?) set to false. For explanation, see version history
Stop repairs: config item that allows repairing disallowed items in an anvil. Default = true 'Repairs' are defined as same items in each slot, rightmost item has no enchants, or rightmost item is raw material for left item [1.6.1]. Anything else might be an attempt to boost enchants. This does mean that some repairs won't work, such as two identically enchanted items except for wear. It's costly to repair this way; suggest repairing each tool individually.
Stop all repairs: defaults to false and if set does just that: you cannot repair anything in an anvil unless you have the new allrepairs permission.
Downgrade repairs:. Removed in 1.5.4 in favor of item below.
Downgrade in anvil: if true, downgrades result of anvil enchants rather than disallowing the action. Default is false. If attempt is caught when placing an item, chat messages are sent to the player. [new in 1.5.4]
Fix spawned items: if set to true will allow disallowed spawned items from having illegal enchants, fixing them at time of spawn. Fixing of necessity ignores any player permissions or groups. If you want to also check either anvil- and table-specific disallowed listings added in 1.4, see Apply_on_global_check below. Default false. Impacts any item "dropped" like mob drops, player drops, or fishing. This behavior used to be the case when Stop pickup was true; now you have individual control.
Infinite anvils: config item that, if true, repairs anvil whenever it is used, such that it never wears out. Default: false [In 1.3.2]
Fix held items: config item that, if true, "fixes" (removes disallowed enchants) from items placed in player's hand or [since 1.5.4] into armor slots. Default: changed to true in 1.5.4 in order to avoid Bukkit bug that sometimes misses "hold" event especially if player spams the button. This is a way of catching items that are not picked up (ex. taken from a loot chest), while still respecting player-specific permissions. It is a bit more server load since it is done every time a player changes held item. [New in 1.5.4] If false, player cannot put the illegal item in their hand (but see concern here on the default value). Also checks when equipping armor.If you want to also check either anvil- and table-specific disallowed listings added in 1.4, see Apply_on_global_check below.
Apply_on_global_check: new config node [added in 1.5.4] that allows referring to Disallowed anvil and/or table lists during item spawn, player pickup, or player hold events, respectively controlled by Fix spawned items, Stop pickup, Fix held items
- Apply_on_global_check.anvil: if true, then Disallowed anvil enchants will also be checked during those events. Default is false
- Apply_on_global_check.table: if true, then Disallowed table enchants will also be checked during those events. Default is false
- both of above can be true, if desired.
- Apply_on_global_check.restrictive: if true, the highest possible level will be used in case of conflict between Disalllowed enhants and the others. If false, the lowest enchant level will be used. Default is true.
Lore immutable string: configurable string that, if found in the lore of an item, ,causes the item to become immutable, as far as enchantments go. No more can be added [In 3.1]
Disallowed enchantments
Supports an optional configuration action to list disallowed enchantment combinations. They are of the form:
Disallowed enchants:
<Item_Name>:
<Enchantment_Name>: <Level>
....
Item names and enchantment names must be in ALL CAPS. Both support special "ALL" that matches every type. Item names support special "ALL_" subtypes as listed here plus standard Bukkit names. Enchantments must correspond to the standard Bukkit/Spigot names listed HERE. Note that the Bukkit enchantment names are different than the in-game names. Support a special enchantment name for new enchantments from other plugins, as long as you know the ID number, "UNKNOWN_ENCHANT_#", where the last is replaced by your ID number. I tested it against my Unbreakable Items plugin, so I know it works, but there are some caveats: [Added in 1.7]
- The plugin must add enchantments by extending org.bukkit.enchantments.Enchantment by calling registerEnchantment.
- The plugin must load before this one, so that retrieving the new enchant by ID works. You will see a warning on startup or on el reload if can't find the enchantment.
Levels are 1 or more. Blocking level n blocks n and higher, so specifying level 1 blocks all such enchants. DO NOT list all levels for the same enchant; the last one wins, so if you put level 4 last, you are only disallowing 4, not 1-3. [In 1.3.2] BOOK or ENCHANTED_BOOK are equivalent and apply to one another.
[New in 1.4] Support parallel configuration items specific to anvil or enchantment table usage, Disallowed anvil enchants and Disallowed table enchants, respectively. If an item/enchantment combination is found both in one of these and the global Disallowed enchants, the anvil/table specific settings overrides the global; this is easy to do if you use the "ALL" special names.
[New in 1.4] Furthermore support branches underneath any of the above, starting with keyword "Group_", which collect a set of disallowed enchants using that group name. Syntax under the Group_ branch is exactly as above.
- each group has an associated dynamic permission enchlimiter.Group_<name> which, if player has it, the group limits do not apply. Otherwise, the limits override the global settings (ex. so you restrict level 3 in global, but restrict to level 1 in group).
- can use same group name within each of Disallowed enchants, Disallowed anvil enchants, Disallowed table enchants
- this allows you to create special groups/classes of players that are the only ones who can perform their restricted enchants
Here is an example:
Disallowed enchants:
DIAMOND_SWORD:
SILK_TOUCH: 1
DAMAGE_ALL: 3
WOOD_AXE:
FIRE_ASPECT: 1
ALL:
DURABILITY: 2
BOW:
ALL: 2
ALL_SWORDS:
DAMAGE_ALL:2
UNKNOWN_ENCHANT_256: 1
ALL_ARMOR:
THORNS:2
Disallowed anvil enchants:
Group_smithy:
ALL:
ALL: 2
Disallowed table enchants:
ALL_SWORDS:
ALL: 3
ALL_AXES:
ALL: 3
Group_weaponsmith:
ALL_SWORDS:
ALL: 2
ALL_AXES:
ALL: 2
Permissions
Has a corresponding permission for each limitation. Use is optional: all defaults are OPerators only.
- enchlimiter.books: gives power to combine books
- enchlimiter.multiple: gives power to get multiple enchantments from one enchant in an enchantment table.
- enchlimiter.disallowed: gives power to override Disallowed enchants config.
- enchlimiter.repairs, allows repairs even if Stop repairs is true.
- enchlimiter.allrepairs, allows repairs even if Stop all repairs is true.
- enchlimiter.useillegal permits equipping/holding illegal items when Fix held items is false. [1.5.4]
- enchlimiter.el permits use of admin command. Default is Op.
- enchlimiter.elfix permits use of elfix command. Default is true. [New in 1.4]
Commands
See Command page for details.
Multiple Language Support
Supports multiple languages. See Languages and Translation page for details.
Future Ideas
- commands to modify settings [in progress],
save, and reload.
- New permissions for each item/enchant combination.
- Add new Disallowed trading enchants to permit trading-specific blocking.
- World-specific configs.
Configurable # of max enchants (ex. 2 but not 3) [2.7]
Allow renaming of disallowed items. [2.7]
armor shortcuts like ALL_ARMOR_DIAMOND or ALL_ARMOR_CHAINMAIL [2.5]
ALL_BARDING doesn't work. Instead, list each of DIAMOND_BARDING, GOLD_BARDING, IRON_BARDING
New configuration that can block all repairs.
Block equipage of restricted items (ex. if config.yml recently changed and owned item now is restricted), or fix if Fix held items turned on.Turns out this is difficult because of so many ways to equip armor.[1.5.4]
Permit but downgrade/remove illegal enchants in an anvil.[1.5.4]
Allow Fix held items, Fix spawned items, Stop pickup to check more than only global Disallowed enchants listing.[1.5.4]
allow for different groups of disallowed and permitted enchants[v.1.4]
评论 0
登录后参与评分
还没有评论,来抢沙发吧