附魔重制
一个自定义的附魔台 GUI,用确定性强制作物的方式取代原版“在三个选项中碰运气”的流程。右键点击附魔台(或运行 /enchanting)以打开一个拥有 54 个槽位的界面,包含两个功能:书之熔炉用于根据配方蓝图铸造附魔书,以及应用站用于将书附魔到物品上并收取固定的等级费用。
功能说明
书之熔炉
将配方的原料物品放入三个熔炉槽位中,并在青金石槽位放入一些青金石。这些原料作为蓝图——它们不会被消耗。当它们匹配配置的配方时,输出槽会显示结果附魔书的预览。使用空鼠标左键点击它即可铸造该书;你需要支付配方的等级和青金石费用,而原料会保留原位以便你再次铸造。
配方可以要求特定材料(CACTUS、DIAMOND)、药水(potion:strength)或整个类别(任意剑、任意护甲、任意镐子……)。随包提供的两个示例配方为:
cactus + any armor + any sword -> 荆棘
any sword + potion of strength + grindstone -> 锋利
(原构思中的“磨刀站”映射到了原版的砂轮。)一套广泛的默认设置涵盖了常见的战斗、工具、护甲和弓类附魔——可在游戏内查看 /enchanting recipes 或 config.yml。
应用
将物品放入目标槽位,并将附魔书放入书籍槽位。输出槽会显示附魔后物品的预览;点击它即可将物品附魔,收取固定的等级费用(默认为 5)。冲突的附魔会被跳过,且已存储的附魔仅在高于当前等级时才会升级物品。
默认情况下,由熔炉铸造的书是可重复使用的——它们在应用时不会被消耗。这是预期的增强效果。来自其他来源(战利品、交易)的书在应用时会像往常一样被消耗。设置 reusable-books: false 可使所有书变为一次性使用。
铸造出的书是真正的原版附魔书,因此砧和砂轮仍然可以与它们配合使用。
打开 GUI
- 右键点击任意原版附魔台(可关闭此功能)。
- 运行
/enchanting(可关闭此功能)。
没有 enchanting.use 权限的玩家会回退到原版附魔台,因此禁用权限绝不会让玩家完全无法进行附魔。
命令
所有命令均位于 /enchanting 下(别名:/erework、/ench)。
| 命令 |
描述 |
/enchanting |
打开 Enchanting Rework GUI。 |
/enchanting recipes |
列出已配置的书之熔炉配方。 |
/enchanting info |
插件信息及当前开关状态。 |
/enchanting reload |
重新加载 config.yml。(管理员) |
权限
| 权限 |
默认值 |
授予 |
enchanting.use |
true |
打开 GUI、铸造书籍、应用附魔、列出配方。 |
enchanting.admin |
op |
reload(包含 enchanting.use)。 |
配置 (config.yml)
| 键 |
默认值 |
含义 |
open-via-command |
true |
允许通过 /enchanting 打开 GUI。 |
intercept-enchanting-table |
true |
右键点击原版附魔台会打开此 GUI。 |
reusable-books |
true |
铸造的书在应用时不被消耗。 |
apply-cost-levels |
5 |
将书应用到物品的固定等级费用。 |
default-level-weaker-than-max |
true |
无明确等级指定的配方使用原版最大值减一。 |
recipes.<id> |
(见文件) |
一个熔炉配方:ingredients、result-enchant、可选的 level、cost-levels、cost-lapis。 |
配方中接受的原料标记:材质名称(CACTUS、minecraft:diamond)、药水(potion、potion:strength)或类别(any_sword、any_axe、any_pickaxe、any_shovel、any_hoe、any_tool、any_armor、any_helmet、any_chestplate、any_leggings、any_boots、any_bow、any_book)。结果附魔接受现代键名(sharpness、minecraft:thorns)或旧版 Bukkit 名称(DAMAGE_ALL)。错误的配方会在日志中记录并在加载时被跳过,绝不会部分应用。
兼容性
Paper / Spigot / Bukkit / Purpur,Minecraft 1.21.1-1.21.11。单个 jar 文件,基于 1.21.1 API 构建(Java 21,class 65),已在 Paper 1.21.11 上进行负载测试;不包含仅 Paper 的类、无 NMS、无依赖项。操作栏反馈使用捆绑的 BungeeCord 聊天组件 API,这是 Spigot API 的一部分。
已知缺失 / 尚未验证
- 未在真实客户端中进行游玩测试。 构建已通过验证(编译、jar 文件、捆绑的
plugin.yml、所有类均为 Java-21 class version 65),但在此环境中无法进行客户端内的 GUI 测试。库存事件逻辑是风险最高的区域,建议在依赖之前先在服务器上冒烟测试(铸造一本书,应用它, SHIFT+点击物品进出,中途关闭 GUI 并确认没有丢失或重复的物品)。
- 关闭时的光标。 输入槽中的物品会在关闭时返还;留在光标上的物品由服务器自身的光标掉落行为处理,这是正常的 Bukkit 路径。
- 药水关键字匹配基于药水类型/效果/显示名称字符串。命名奇怪的异质自定义药水可能无法匹配
potion:<keyword> 标记;纯 potion 标记始终匹配任何药水。
- 每个配方仅限一种附魔是设计使然。由熔炉铸造的书仅包含一种附魔。应用从其他地方获得的含多种附魔的书时,会一次性应用其所有兼容附魔(仍收取固定费用)。
原始概念来自 Reddit (r/Minecraft) 上的 u/Ciryl_Lynyard。由 BeansNToast 开发。
Enchanting Rework
A custom enchanting-table GUI that replaces the vanilla "gamble on three options"
flow with something deterministic and craft-y. Right-click an enchanting table
(or run /enchanting) to open a 54-slot interface with two functions: a Book
Forge that mints enchanted books from ingredient blueprints, and an Apply
station that puts a book onto an item for a flat level cost.
What it does
Book Forge
Place a recipe's ingredient items in the three forge slots and some lapis in the
lapis slot. The ingredients are a blueprint - they are not consumed. When
they match a configured recipe, a preview of the resulting enchanted book appears
in the output. Click it (with an empty cursor) to mint the book; you pay the
recipe's level and lapis cost, and the ingredients stay where they are so you can
forge again.
Recipes can require specific materials (CACTUS, DIAMOND), a potion
(potion:strength), or whole categories (any sword, any armor, any pickaxe...).
The two shipped example recipes are:
cactus + any armor + any sword -> Thorns
any sword + potion of strength + grindstone -> Sharpness
(The original idea's "sharpening station" is mapped to a vanilla grindstone.)
A broad default set covers common combat, tool, armor, and bow enchants - see
/enchanting recipes in game or config.yml.
Apply
Put an item in the target slot and an enchanted book in the book slot. A preview
of the enchanted item appears in the output; click it to enchant the item for a
flat level cost (default 5). Conflicting enchants are skipped, and a stored
enchant only upgrades the item if it is a higher level than what is already there.
By default, books minted by the forge are reusable - they are not consumed
when applied. That is the intended buff. Books from other sources (loot, trades)
are consumed on apply like normal. Set reusable-books: false to make every book
single-use.
Minted books are genuine vanilla enchanted books, so anvils and grindstones still
work with them.
Opening the GUI
- Right-click any vanilla enchanting table (can be turned off).
- Run
/enchanting (can be turned off).
Players without enchanting.use always fall through to the vanilla enchanting
table, so disabling permission never locks anyone out of enchanting entirely.
Commands
All under /enchanting (aliases: /erework, /ench).
| Command |
Description |
/enchanting |
Open the Enchanting Rework GUI. |
/enchanting recipes |
List the configured book-forge recipes. |
/enchanting info |
Plugin info and current toggles. |
/enchanting reload |
Reload config.yml. (admin) |
Permissions
| Permission |
Default |
Grants |
enchanting.use |
true |
Open the GUI, forge books, apply enchants, list recipes. |
enchanting.admin |
op |
reload (includes enchanting.use). |
Configuration (config.yml)
| Key |
Default |
Meaning |
open-via-command |
true |
Allow opening the GUI with /enchanting. |
intercept-enchanting-table |
true |
Right-clicking a vanilla table opens this GUI. |
reusable-books |
true |
Forged books are not consumed on apply. |
apply-cost-levels |
5 |
Flat level cost to apply a book to an item. |
default-level-weaker-than-max |
true |
Recipes with no explicit level use vanilla max minus one. |
recipes.<id> |
(see file) |
A forge recipe: ingredients, result-enchant, optional level, cost-levels, cost-lapis. |
Ingredient tokens accepted in a recipe: a material name (CACTUS,
minecraft:diamond), a potion (potion, potion:strength), or a category
(any_sword, any_axe, any_pickaxe, any_shovel, any_hoe, any_tool,
any_armor, any_helmet, any_chestplate, any_leggings, any_boots,
any_bow, any_book). Result enchants accept a modern key (sharpness,
minecraft:thorns) or a legacy Bukkit name (DAMAGE_ALL). Bad recipes are
logged and skipped on load, never partially applied.
Compatibility
Paper / Spigot / Bukkit / Purpur, Minecraft 1.21.1-1.21.11. One jar, built
against the 1.21.1 API (Java 21, class 65), load-tested on Paper 1.21.11; no
Paper-only classes, no NMS, no dependencies. Action-bar feedback uses the
bundled BungeeCord chat component API, which is part of the Spigot API.
Known gaps / not yet verified
- Not playtested in a live client. The build is verified (compiles, jar,
bundled
plugin.yml, all classes are Java-21 class version 65), but no
in-client GUI test was possible in this environment. The inventory-event logic
is the highest-risk area and should be smoke-tested on a server before relying
on it (forge a book, apply it, shift-click items in and out, close the GUI
mid-edit and confirm nothing is lost or duplicated).
- Cursor-on-close. Items in input slots are returned on close; an item left
on the cursor is handled by the server's own cursor-drop behaviour, which is
the normal Bukkit path.
- Potion keyword matching keys on the potion type / effect / display-name
string. Exotic custom potions named oddly might not match a
potion:<keyword>
token; a plain potion token always matches any potion.
- One enchant per recipe by design. A book minted by the forge holds a single
enchant. Applying a multi-enchant book obtained elsewhere will apply all of its
compatible enchants in one go (still a flat cost).
Original concept by u/Ciryl_Lynyard on Reddit (r/Minecraft). Built by BeansNToast.
评论 0
登录后参与评分
还没有评论,来抢沙发吧