
如果您是模组整合包开发者,希望将 Smithing Table 添加到一个通过 CurseForge 或 Modrinth 之外分发的整合包中,请使用 File Director 以避免重复上传 Smithing Table 的文件。
Smithing Table 为以下模组添加了特殊支持:
本模组默认不包含任何锻造配方或锻造模板。它纯粹是一个实用工具模组,旨在供模组整合包开发者和模组开发者使用!
话虽如此,本模组添加的锻造台提供了与原版的实现相同的功能,并且更多!您可能立刻注意到的第一个区别是,这些锻造台可以使用所有原版和模组生成的木板制作!

与原版实现的另一个区别是本模组的锻造台可以自动化处理配方(通过漏斗、管道等)!任何物品提取操作都会自动尝试使用存储的物品执行锻造配方,并提取生成的输出物品。只有符合配方要求的物品才能被插入,它们会被自动放入正确的槽位。非输出物品无法被自动提取,从而使得自动化无需物品过滤器!锻造台配方的自动化可以在配置文件中禁用。

致模组整合包开发者和模组开发者(或对模组配方内部机制好奇的其他人)的信息:
请参阅 GitHub 上的 examples 文件夹,其中包含 CraftTweaker 和 GroovyScript 的示例脚本。
所有锻造配方均由一个新的(可修改的)Forge 注册表控制。这意味着每个锻造配方都必须拥有唯一的 ID,且锻造配方注册表允许自由地添加或移除配方。
每个锻造配方由 3 个标准的 Ingredient 输入、1 个 ItemStack 输出和一个生产用的 SoundEvent(可选,默认为基础锻造音效)组成。每种原料在锻造配方处理器中的处理方式略有不同:
- 模板原料: 此原料对应第一个槽位。如果其匹配的物品具有最大耐久度,则该物品会受损而非被消耗。锻造配方处理器也允许该原料为空,因此自定义配方可以根据需要跳过模板原料。
- 装备原料: 此原料对应第二个槽位。如果匹配的物品已损坏,且配方输出物品具有耐久度,则损坏的耐久度将转移到输出物品上。装备物品中的 NBT 数据也将合并到输出物品的 NBT 中(包括附魔、自定义名称等)。
- 材料原料: 此原料对应第三个槽位。即使该物品具有耐久度,它在配方中也总是会被消耗。
所有的锻造模板都由一个新的(不可修改的)Forge 注册表控制。这意味着每个锻造模板必须拥有唯一的 ID,且锻造模板无法从锻造模板注册表中移除。锻造模板包含以下字段:
- model: 必填项。物品模型的
ModelResourceLocation。
- templateSlotTexture: 必填项。指向锻造台 GUI 中模板槽背景纹理的
ResourceLocation。当模板槽中没有放置任何物品时,该槽会循环显示所有已注册锻造模板各自的独特 templateSlotTexture。如果没有注册的锻造模板,模板槽将没有背景纹理。点击此处查看本模组附带的所有槽位纹理。
- equipmentSlotInfo: 可选。当此锻造模板置于模板槽中时,装备槽的 GUI 渲染信息。由用于悬停文本的
ITextComponent 和用于背景纹理的 Set<ResourceLocation> 组成。当此锻造模板位于模板槽中,且装备槽为空时,该槽将使用悬停文本并循环显示每种背景纹理。
- materialSlotInfo: 可选。当此锻造模板置于模板槽中时,材料槽的 GUI 渲染信息。由用于悬停文本的
ITextComponent 和用于背景纹理的 Set<ResourceLocation> 组成。当此锻造模板位于模板槽中,且材料槽为空时,该槽将使用悬停文本并循环显示每种背景纹理。
- creativeTabs: 可选。此锻造模板创造模式标签页。注意:此锻造模板始终会出现在“Smitning Table”和“Search”创造模式标签页中。
- forceEnchantGlint: 可选。如果设为 True,则始终显示附魔光效。
- maxDurability: 可选。此锻造模板的最大耐久度。
- maxStackSize: 可选。此锻造模板的最大堆叠数量。
- rarity: 可选。此锻造模板的
IRarity。默认为 UNCOMMON。
在游戏中的每个锻造模板都作为物品 NBT 处理,语法为 {smithing_table: {TemplateId: "TEMPLATE_REGISTRY_ID_HERE"}}。这允许将其“与槽位相关”的字段应用于任何现有物品,并允许每个锻造模板作为中央 smithing_table:template 物品的子类型存在(以节省物品 ID)。
Smithing Table 提供了一个自定义的 api.SmithingTemplateIngredient 原料类(其 JSON 原料工厂 ID 为 smithing_table:template),使得锻造模板也可以用于所有使用 Ingredient 的模组化配方系统!该原料接受一个锻造模板 ID 数组。它仅检查提供物品中的锻造模板 NBT,以查看其是否与任何可接受的锻造模板 ID 匹配。
此外,本模组还添加了一个简单的 smithing_table:template 战利品函数,它接受一个锻造模板 ID 并将其应用于战利品物品。
以下是 recipes.groovy 和 templates.groovy 示例脚本运行时的截图:
注意:锻造台 GUI 高度可配置,因此如果您不喜欢某些空槽位的盔甲架或悬停文本(例如),您可以将其禁用!
本模组不会移植到其他版本。
直接联系:jbred.dev@gmail.com
Backports and improves upon the Smithing Table!

If you're a modpack developer wanting to add Smithing Table to a modpack distributed outside of CurseForge or Modrinth, use File Director to avoid reuploading Smithing Table's files.
Smithing Table adds special support for the following mods:
- AssetMover: Downloads the official sounds for smithing an item. If you don't have AssetMover installed, or the sounds fail to download, anvil sounds will be used instead.
- CraftTweaker / GroovyScript: New functions to add custom smithing templates, add/remove smithing recipes, and add/remove smithing table variants. Example scripts for both mods can be found here.
- Had Enough Items / Just Enough Items: New recipe category for smithing recipes.
This mod comes with no smithing recipes or smithing templates by default. It exists solely as a utility mod for modpack developers and mod developers who want to make use of a smithing table!
That being said, the smithing tables added by this mod offer the same functionality as what you'd expect from Vanilla's implementation, and much more! The first difference you may notice right off the bat is that these smithing tables can be made from all Vanilla and modded wooden planks!

Another difference from the Vanilla implementation is that this mod's smithing tables can automate recipes (via hoppers, pipes, etc)! Any item extraction will automatically attempt to perform a smithing recipe using the stored items, and extract the resulting output item(s). Only items that are valid for a recipe can be inserted, and they're automatically put into the correct slots. Non-output items cannot be auto-extracted, to make automation require no item filters! Smithing table recipe automation can be disabled in the config.

Info for Modpack Developers and Mod Developers (or anyone else curious about this mod's recipe internals):
See the examples folder on GitHub for example CraftTweaker and GroovyScript scripts.
All smithing recipes are controlled by a new (modifiable) forge registry. This means that each smithing recipe must have a unique id, and that the smithing recipe registry allows recipes to be added/removed freely.
Each smithing recipe consists of 3 standard Ingredient inputs, 1 ItemStack output, and a production SoundEvent (optional, defaults to the basic smithing sound). Each ingredient is treated slightly differently by the smithing recipe processor:
- Template ingredient: This ingredient corresponds to the first slot. If its matching item has a maximum durability, it will be damaged instead of being consumed. The smithing recipe processor also allows this ingredient to be empty, so custom recipes can skip having a template ingredient if desired.
- Equipment ingredient: This ingredient corresponds to the second slot. If the matching item is damaged, and the recipe output has durability, the damaged durability will be carried over to the output item. Nbt data in the equipment item will also be merged into the output item nbt (enchantments, custom name, etc).
- Material ingredient: This ingredient corresponds to the third slot. This item will always be consumed in recipes, even if it has durability.
All smithing templates are controlled by a new (unmodifiable) forge registry. This means that each smithing template must have a unique id, and that smithing templates cannot be removed from the smithing template registry. Smithing templates have the following fields:
- model: Required. A
ModelResourceLocation for the item model.
- templateSlotTexture: Required. A
ResourceLocation pointing to the background texture used by the template slot in the smithing table gui. While no item is in the template slot, the slot will gradually cycle through each unique templateSlotTexture (for all registered smithing templates). If there's no registered smithing template, the template slot will have no background texture. Click here to see all slot textures that come with this mod.
- equipmentSlotInfo: Optional. Gui render info for the equipment slot, while this smithing template is in the template slot. Consists of an
ITextComponent for hover text and a Set<ResourceLocation> for background textures. While this smithing template is in the template slot, and no item is in the equipment slot, the slot will use the hover text and gradually cycle through each background texture.
- materialSlotInfo: Optional. Gui render info for the material slot, while this smithing template is in the template slot. Consists of an
ITextComponent for hover text and a Set<ResourceLocation> for background textures. While this smithing template is in the template slot, and no item is in the material slot, the slot will use the hover text and gradually cycle through each background texture.
- creativeTabs: Optional. The creative tabs for this smithing template. Note: This smithing template will always appear in the "Smitning Table" and "Search" creative tabs.
- forceEnchantGlint: Optional. True if this always has an enchantment glint.
- maxDurability: Optional. The maximum item durability of this smithing template.
- maxStackSize: Optional. The maximum item stack size of this smithing template.
- rarity: Optional. The
IRarity for this smithing template. Defaults to UNCOMMON.
Each smithing template is handled as item nbt in-game, using the syntax {smithing_table: {TemplateId: "TEMPLATE_REGISTRY_ID_HERE"}}. This allows their "slot-related" fields to be applied to any existing item, and allows every smithing template to exist as subtypes for one central smithing_table:template item (to conserve item ids).
Smithing Table provides a custom api.SmithingTemplateIngredient ingredient class (with a json ingredient factory id of smithing_table:template) that allows smithing templates to also be used in all modded recipe systems that use Ingredient! This ingredient accepts an array of smithing template ids. It only checks for smithing template nbt in the provided item to see if it matches any of the acceptable smithing template ids.
This mod also adds a simple smithing_table:template loot function, which accepts a smithing template id and applies it to the loot item.
Below are screenshots of the recipes.groovy and templates.groovy example scripts in action:
Note: The smithing table gui is highly configurable, so if you don't like the armor stand or hover text for certain empty slots (for example), you can disable them!
This mod will not be ported.
Direct contact: jbred.dev@gmail.com
评论 0
登录后参与评分
还没有评论,来抢沙发吧