RPG Enchanting
引入了对传统附魔系统的替代/替换/补充方案。该模组深受游戏《Hammerwatch 2: Heroes》(锤击守望 2:英雄)的启发。
附魔限制
每个物品最多只能附魔 2 个附魔,分别是一个“前缀”附魔和一个“后缀”附魔。
每个附魔要么是前缀附魔,要么是后缀附魔。
工具提示变更
附魔不再以列表形式显示在物品名称下方。相反,物品名称本身会发生变化。
例如,一个附魔了效率(Efficiency)和 fortune(fortune)的铁镐会被称为“Fortune Efficient Iron Pickaxe”(幸运的高效铁镐)。
(物品仍然可以重命名,这些更改仅影响默认名称)
RPG Enchanting 工作台会在其附魔的物品上添加一行“由 player_name 附魔”。这纯粹是装饰性的,可以在配置文件中禁用(客户端配置和服务端配置均可)。
RPG Enchanting 工作台
这个新方块允许玩家以更可控的方式附魔物品。该工作台将替换相同组别(前缀或后缀)的现有附魔。
只有已解锁的附魔可供玩家选择。
RPG Enchanting 工作台可以使用与原版附魔台相同的配方制作(用于替换原版附魔台)。它与世界交互时具有相同的属性(发出光芒、用镐开采速度更快等)。
解锁附魔
附魔可以通过三种不同的方法解锁。
- 进度(Advancements)
服务端配置允许将特定进度与特定附魔配对。
当玩家在操作 RPG Enchanting 工作台时拥有该进度,指定等级的相应附魔将被解锁。
- 周围方块
服务端配置允许将特定方块与特定附魔配对。
当玩家与 RPG Enchanting 工作台交互时,工作台会在可配置的半径内搜索这些方块。
当找到列表中的方块时,指定等级的相应附魔将被解锁。
- 雕纹书架中的附魔书
如果在服务端配置中启用,RPG Enchanting 工作台会寻找雕纹书架,类似于第二种选项。
当发现存储了附魔书的雕纹书架时,其中的每种附魔都将被解锁。
设置
多项设置定义了 RPG Enchanting 工作台的具体工作方式。这些设置可以为每个单独的 RPG Enchanting 工作台定义(通过方块实体数据),并在服务端配置中定义默认值。
- 方块探测半径(Block Reach Radius):定义了 RPG Enchanting 工作台周围检查方块以解锁附魔的区域。
- 附魔书消耗模式(Enchanted Book Consumption Mode):定义了当其附魔被应用到物品时,周围书架中的附魔书会发生什么。包括:
- KEEP(无变化)
- CONSUME(当其中一个附魔被使用时,附魔书会被替换为可配置的道具)
- PARTIAL_CONSUME(与 consume 相同,但具有多个附魔的书不会被替换,只移除相关的附魔)
- 附魔解锁模式(Enchantment Unlock Mode):定义了附魔如何确切地被解锁(也见上文)
- ADDITION(所有三种方法都像正常情况一样工作)
- BLOCK_REQUIRED_FOR_ADVANCEMENT(通过进度解锁的附魔仅在它们也通过方块解锁时才被添加,书籍附魔像往常一样添加)
附魔成本
附魔需要经验值和物品。
这些物品在服务端配置中定义。
当替换现有附魔时,物品和经验值的成本都会更高。
自定义附魔兼容性
RPG Enchanting 使用现有的附魔技术,但期望附魔以特定方式进行配置。
具体来说,附魔必须存在于以下附魔标签之一中:"rpgenchanting:prefix_enchantments" 或 "rpgenchanting:suffix_enchantments"。
RPG Enchanting 使用这两个附魔标签进行所有逻辑处理。
注意:同时将附魔放入两个标签中可能导致意外行为。
物品名称的附加部分由以下格式的本地化键控制:
"rpgenchanting.<namespace>.<id>.<level>.prefix"
"rpgenchanting.<namespace>.<id>.<level>.suffix"
例如,如果 "minecraft:efficiency" 附魔位于 "prefix" 标签中,本地化键将如下所示:
- "rpgenchanting.minecraft.efficiency.1.prefix"
- "rpgenchanting.minecraft.efficiency.2.prefix"
- "rpgenchanting.minecraft.efficiency.3.prefix"
- "rpgenchanting.minecraft.efficiency.4.prefix"
- "rpgenchanting.minecraft.efficiency.5.prefix"
显示顺序
前缀和后缀附魔名称会“包裹”在物品名称周围,后缀先进行处理。
这意味着什么?
最终的物品名称是两种附魔的“物品名称附加部分”与原始物品名称的组合。
例如:“Fortune Efficient Iron Pickaxe”(幸运的高效铁镐)
然而,顺序不再是简单的“prefix_name + item_name + suffix_name”,而是更加可定制。
“物品名称附加部分”的翻译必须包含 "%s"。这标记了“包裹”字符串的位置。
如前所述,后缀先进行处理。这意味着被包裹的对象是:
- 对于后缀字符串:物品名称
- 对于前缀字符串:物品名称(可能被后缀字符串包裹)
此功能在使用具有不同句子结构的语言游玩时非常有用。
示例
“Fortune”(幸运)附魔的翻译可以从 "%s of Fortune" 更改为 "Fortunate %s of Fortune"。
一把附魔了 Fortune 的铁镐现在将被命名为:“Fortunate Iron Pickaxe of Fortune”。
示例 2
采用修改后的 Fortune 翻译,但添加了一个 Efficiency(效率)附魔(使用默认翻译)。
这把铁镐的名称现在是:“Efficient Fortunate Iron Pickaxe of Fortune”。
物品名称覆盖
物品名称覆盖可以为特定的物品和附魔组合提供唯一的本地化文本。
要为特定的组合启用此功能,请在资源包的 lang 文件中添加一个本地化键(localization key)。该键需遵循以下格式之一:
"前缀附魔翻译键.前缀附魔等级.物品翻译键.后缀附魔翻译键.后缀附魔等级"
"前缀附魔翻译键.前缀附魔等级.物品翻译键"
"物品翻译键.后缀附魔翻译键.后缀附魔等级"
对于缺少附魔的组合,请将翻译键替换为空字符串,并将等级设为 0。
仅定义单个附魔的重写项使用针对额外附魔的标准格式。请注意,对于特定的物品堆栈,只能有一个重写生效。后缀重写优先于前缀重写。
示例
"minecraft.efficiency.5.item.minecraft.diamond_pickaxe.minecraft.fortune.3": "超级幸运极速镐"
内置数据包和资源包
RPG Enchanting 附带了几个数据包/资源包,用于提供对 Minecraft 原版及多个模组的支持。
- "Dungeons and Taverns" by NovaWostra
- "Extra RPG Attributes" by Forg
- Daedelus 制作的 RPG Series 系列模组
- Fichte 制作的 The More RPG Series 系列模组
模组 Defaulted 是实现完整功能所必需的。
这些数据包包含以下内容:
- 将所有附魔添加到以下附魔标签之一中:
- "#rpgenchanting:prefix_enchantments" 或 "#rpgenchanting:suffix_enchantments"
资源包提供了物品名称附加部分的本地化支持。
自定义
RPG Enchanting 的以下功能也可以进行自定义:
- RPG Enchanting Table(RPG 附魔台)会生成粒子效果,与原版附魔台完全相同。触发此行为的方块由 "rpgenchanting:enchanting_particle_targets" 方块标签定义。
- 物品消耗槽的背景精灵图可以选择在两张纹理之间循环切换。这可以在客户端配置中启用。默认情况下这两张纹理是相同的,但可以通过资源包进行修改。
- 附魔提示框可以选择显示附魔的描述信息。这可以在客户端配置中启用。建议安装模组 Enchantment Descriptions。
- 附魔的物品和经验消耗可以进行修改。计算公式如下:
item_cost = old_enchantment.anvil_cost * old_enchantment.level * serverConfig.old_enchantment_item_cost_multiplier + new_enchantment.anvil_cost * new_enchantment.level * serverConfig.new_enchantment_item_cost_multiplier
experience_cost = old_enchantment.min_cost(取决于 old_enchantment.level) * serverConfig.old_enchantment_experience_cost_multiplier + new_enchantment.max_cost(取决于 new_enchantment.level) * serverConfig.new_enchantment_experience_cost_multiplier
技术细节
数据组件
"rpgenchanting:show_enchantment_name_additions"
当此组件存在于物品堆栈上时,物品名称会根据附魔的前缀/后缀进行修改。
RPG Enchanting Table 会自动为其附魔的物品添加此组件。
"rpgenchanting:player_enchanted"
此组件保存玩家配置文件,并在物品提示框中显示玩家名称。
RPG Enchanting Table 会自动为其附魔的物品添加此组件。可以在服务器配置中为每个玩家禁用此功能。
也可以在客户端配置中禁用提示框中的此项添加。这将仅影响当前客户端。
其他修改
RPG Enchanting Table 使用原版的“数据组件”来存储物品上的附魔。但是,它会将 "show_in_tooltip" 标志设置为 false。这样可以避免冗余的信息显示。
由战利品表生成的附魔物品也会以类似的方式进行修改。这可以在服务器配置中禁用。
RPG Enchanting
Introduces an alternative/replacement/addition to the traditional enchanting system. It is heavily inspired by the game "Heroes of Hammerwatch 2".
Enchantment limit
Each item can be enchanted with a maximum of 2 enchantments, one "prefix" and one "suffix" enchantment.
Every enchantment is either a prefix or a suffix enchantment.
Tooltip changes
Enchantments are no longer displayed in a list below the item name. Instead, the item name is modified.
E.g. an Iron Pickaxe enchanted with Efficiency and Fortune is called "Efficient Iron Pickaxe of Fortune".
(Items can still be renamed, these changes only affect the default name)
The RPG Enchanting Table adds a "Enchanted by player_name" line to items it enchants. This is purely cosmetic and it can be disabled in the config (both in the client config and in the server config).
RPG Enchanting Table
This new block allows the player to enchant items in a more controlled way. The table will replace existing enchantments of the same group (prefix or suffix).
Only unlocked enchantments are available for the player to choose from.
The RPG Enchanting Table can be crafted with the same recipe as the vanilla Enchanting Table (replacing it). It has the same properties when interacting with the world (emits light, mineable faster with a pickaxe, etc)
Unlocking enchantments
Enchantments can be unlocked by three different methods.
- Advancements
The server config allows pairing advancements to specific enchantments.
When the player has the advancement when interacting with the RPG Enchanting Table, the corresponding enchantments of the specified level are unlocked.
- Surrounding blocks
The server config allows pairing blocks to specific enchantments.
When a player interacts with the RPG Enchanting Table, the table searches for these in a configurable radius.
When a block from the list is found, the corresponding enchantments of the specified level are unlocked.
- Enchanted books in Chiseled Bookshelves
When enabled in the server config, the RPG Enchanting Table looks for Chiseled Bookshelves, similar to the second option.
When a Chiseled Bookshelf that stores Enchanted Books is found, each of those enchantments is unlocked.
Settings
Several settings define how exactly the RPG Enchanting Table works. These settings can be defined for each individual RPG Enchanting Table (via block entity data), with a default defined in the server config.
- Block Reach Radius, defines the area around the RPG Enchanting Table where blocks are checked to unlock enchantments.
- Enchanted Book Consumption Mode, defines what happens with enchanted books in surrounding bookshelves, when their enchantment is applied to an item. These include:
- KEEP (nothing happens)
- CONSUME (enchanted books are replaced with a configurable item when one of their enchantments is used)
- PARTIAL_CONSUME (same as consume, but books with multiple enchants are not replaced, only the relevant enchantment is removed)
- Enchantment Unlock Mode, defines how exactly enchantments are unlocked (also see above)
- ADDITION (all three methods are working like normal)
- BLOCK_REQUIRED_FOR_ADVANCEMENT (enchantments unlocked by advancements are only added, when they are also unlocked by blocks, book enchantments are added like normal)
Enchanting cost
Enchanting costs experience and items.
These items are defined in the server config.
Both item and experience cost are higher when an existing enchantment is replaced.
Compatibility with custom enchantments
RPG Enchanting uses the existing enchantment technology, but expects enchantments to be configured a certain way.
Namely, enchantments must be present in one of these enchantment tags: "rpgenchanting:prefix_enchantments" or "rpgenchanting:suffix_enchantments".
RPG Enchanting uses these two enchantment tags for all its logic.
Note that putting an enchantment into both tags at the same time can lead to unexpected behaviour.
The item name additions are controlled by localization keys of these formats:
"rpgenchanting.<namespace>.<id>.<level>.prefix"
"rpgenchanting.<namespace>.<id>.<level>.suffix"
E.g. if the "minecraft:efficiency" enchantment is in the "prefix" tag, the localization keys would look like this:
- "rpgenchanting.minecraft.efficiency.1.prefix"
- "rpgenchanting.minecraft.efficiency.2.prefix"
- "rpgenchanting.minecraft.efficiency.3.prefix"
- "rpgenchanting.minecraft.efficiency.4.prefix"
- "rpgenchanting.minecraft.efficiency.5.prefix"
Display Order
The pre- and suffix enchantment names are "wrapped" around the item name, the suffix is processed first.
What does this mean?
The final item name is a combination of the "item name additions" of both enchantment and the original item name.
E.g. "Efficient Iron Pickaxe of Fortune"
However, instead of "prefix_name + item_name + suffix_name", the order is much more customizable.
The translations for the "item name additions" have to contain "%s". This marks the position of the "wrapped" string.
As mentioned earlier, the suffix is processed first. This means that the wrapped object is:
- the item name for suffix strings
- the item name (possibly wrapped by the suffix string) for prefix strings
This feature is useful when playing in languages with alternative sentence structures.
Example
The translation for the "Fortune" enchantment could be changed from "%s of Fortune" to "Fortunate %s of Fortune".
A with Fortune enchanted iron pickaxe would now be named: "Fortunate Iron Pickaxe of Fortune".
Example 2
Taking the modified Fortune translation, but adding an Efficiency enchantment (with the default translation).
The name for the iron pickaxe is now: "Efficient Fortunate Iron Pickaxe of Fortune".
Item Name Overwrites
Item name overwrites can give specific combinations of items and enchantments a unique localization.
To enable this feature for a given combination, add a localization key to a lang file in a resource pack. The key has to follow one of these formats:
"prefix_enchantment_translation_key.prefix_enchantment_level.item_translation_key.suffix_enchantment_translation_key.suffix_enchantment_level"
"prefix_enchantment_translation_key.prefix_enchantment_level.item_translation_key"
"item_translation_key.suffix_enchantment_translation_key.suffix_enchantment_level"
For combinations with a missing enchantment, replace the translation key with an empty string and the level with 0.
Overwrites that only define one enchantment use the regular format for additional enchantments. Note that only one overwrite can be active for a specific item stack. A suffix overwrite has priority over a prefix overwrite.
Example
"minecraft.efficiency.5.item.minecraft.diamond_pickaxe.minecraft.fortune.3": "Super Mega Lucky And Fast Pickaxe"
Built-in data and resource packs
RPG Enchanting comes with several data/resource packs that bring compatibility for vanilla Minecraft and several mods.
- "Dungeons and Taverns" by NovaWostra
- "Extra RPG Attributes" by Forg
- The RPG Series mods by Daedelus
- The More RPG Series mods by Fichte
The mod Defaulted is required for full functionality.
These packs include the following:
- adding all enchantments to one of these enchantment tags:
- "#rpgenchanting:prefix_enchantments" or "#rpgenchanting:suffix_enchantments"
The resource packs provide the localization for the item name additions.
Customization
These features of RPG Enchanting can also be customized:
- The RPG Enchanting Table spawns particles, exactly like the vanilla Enchanting Table. The blocks that trigger this behaviour are defined in the "rpgenchanting:enchanting_particle_targets" block tag.
- The background sprite of the item cost slot can optionally cycle between two textures. This can be enabled in the client config. The textures are identical by default, but they can be changed with a resource pack.
- The enchantment tooltips can optionally display a description of the enchantment. This can be enabled in the client config. Installing the mod Enchantment Descriptions is recommended.
- The item and experience cost for enchanting can be modified. The equations are as follows:
item_cost = old_enchantment.anvil_cost * old_enchantment.level * serverConfig.old_enchantment_item_cost_multiplier + new_enchantment.anvil_cost * new_enchantment.level * serverConfig.new_enchantment_item_cost_multiplier
experience_cost = old_enchantment.min_cost(depends on old_enchantment.level) * serverConfig.old_enchantment_experience_cost_multiplier + new_enchantment.max_cost(depends on new_enchantment.level) * serverConfig.new_enchantment_experience_cost_multiplier
Technical details
Data components
"rpgenchanting:show_enchantment_name_additions"
When this component is present on an itemStack, the item name is modified with enchantment pre/suffixes.
The RPG Enchanting Table automatically adds this component to items that it enchants.
"rpgenchanting:player_enchanted"
This component saves a player profile and displays the player name in the item tooltip.
The RPG Enchanting Table automatically adds this component to items that it enchants. This can be disabled for every player in the server config.
The tooltip addition can also be disabled in the client config. This will only affect that client.
Additional modifications
The RPG Enchanting Table uses the vanilla data component to store enchantments on an item. However, it sets the "show_in_tooltip" flag to false. This avoids redundant display of information.
Enchanted items generated by loot tables will be modified in a similar way. This can be disabled in the server config.
评论 0
登录后参与评分
还没有评论,来抢沙发吧