Dynamic TFC Structures
你是否曾梦想过用地道的结构来填充你的 TerraFirmaCraft 世界?Dynamic TFC Structures 会将它们带入你的世界!
Dynamic TFC Structures 可以激活任何世界生成结构,并将其方块替换为 TerraFirmaCraft 对应的方块,仿佛这些结构是专门为 TFC 建造的一样。
该模组完全可配置;你可以在 config/tfc_structures 文件夹中找到配置文件。默认情况下,仅启用原版结构,但你可以激活任何其他模组添加的结构。
主要面向 TerraFirmaCraft 整合包作者 —— 此模组帮助你通过可配置的方块替换和世界生成规则,将原版和模组结构引入 TFC 世界。
尽管模组名称如此,Dynamic TFC Structures 即使在没有安装 TerraFirmaCraft 的情况下也能工作,因此请随意在非 TFC 整合包中使用它 :)
如果你没有安装 TFC,则需要自行构建配置文件。
免责声明
请注意,Dynamic TFC Structures 目前处于 BETA(测试)阶段,因此 存在错误 且 仍有大量工作需要完成。
配置说明
Dynamic TFC Structures 有 3 个主要配置文件:
- common-config.toml
allowedDimensions - 允许将结构方块替换为 TFC 方块的维度列表
biomesTagsStructuresToLogs - 调试开关,用于输出生物群系、生物群系标签和结构到日志
fallbackToTfcStructuresLoot - 切换开关,当结构中不存在 lootTablesOverrideMap 时,启用 tfc_structures 的战利品表
mossyBlocks/strippedLogs/strippedWood/crackedBricks - 用于替换的特殊标签。它们都将添加到特殊的方块标签中。
- worldgen_config.json
biomeTags - 将在 tfc_structures_datapacks/tfc_structures_main 数据包中生成的生物群系标签定义。它还包含将在该生物群系标签中生成的结构。
disabledStructures - 你不希望在世界中看到的结构列表
defaultWorldgenStructures - 存在于游戏中但未添加到上述任何列表中的结构列表,因此它们将使用默认的世界生成规则。此属性会在服务器加载时更新。
- structures_config.json
structures - 每个结构的替换规则列表,例如替换预设、lootTablesOverrideMap 等。
此配置文件将在服务器加载时创建(或更新)。
此外,还有一个 presets 文件夹,你可以在其中找到替换预设的配置文件。
每个预设都有 3 个属性:
- directReplacements - 直接替换的方块到方块映射,当结构生成时使用
- randomReplacements - 随机替换的方块到多方块映射。
perBlock=false 意味着整个结构将使用一种方块。
- tfcWorldReplacements - 使用周围环境中的 TFC 方块(如石头、木材、土壤、沙子或矿石)进行替换的方块到类型映射
默认情况下,有两个预设:no-replace(空预设)和 overworld-common,但你可以自行创建额外的预设(别忘了在 structures_config.json 中将预设分配给结构)。
如果你对某个地方出现太多结构感到厌烦,
你可能也有兴趣安装
Sparse Structures。
TFC Structures Datapacks 文件夹
Dynamic TFC Structures 使用配置文件生成自己的数据包,因此它有自己专用的数据包目录:
- tfc_structures_datapacks/tfc_structures_main
但你也可以直接将你的数据包或类似 KubeJS 的数据包文件夹(以 tfc_structures_main 数据包为例)放置在 tfc_structures_datapacks 文件夹中,它们将在世界创建时加载。
不要将文件放入 tfc_structures_main,因为它会在每次资源包生成时被删除并重新创建。
内置数据更改
你应该知道,Dynamic TFC Structures 会覆盖原版战利品表,将其替换为 gameplay 文件夹中的 TFC 物品,例如猫的晨间礼物、村庄英雄奖励、猪灵易货交易以及嗅探兽挖掘。
常见问题
如何添加新结构?
只需在你安装了结构模组的服务器上开启一个新世界。在第一次服务器加载后,你会在 config/tfc_structures/worldgen_config.json(defaultWorldgenStructures 部分)和 config/tfc_structures/structures_config.json(structures 部分)中找到新结构。这两个文件会在服务器启动前自动创建或更新。
底层工作原理
worldgen_config.json —— 模组扫描结构注册表,并将所有未列在 biomeTags 或 disabledStructures 中的结构放入 defaultWorldgenStructures。该列表中的结构保留原始模组的生物群系规则。要使结构在 TFC 生物群系中生成,请将其 ID 从 defaultWorldgenStructures 移动到 biomeTags 条目中(创建新的条目或添加到现有标签中)。请参阅 WorldgenConfig.getDefaultConfig() 中的原版条目作为示例。
structures_config.json —— 所有已注册但未出现在 structures 中的结构都会获得一个默认条目:replacementPreset: "overworld-common",来自 common-config.toml 的默认空箱子战利品表,以及空的 lootTablesOverrideMap。根据需要调整预设、战利品覆盖项,或从 presets 文件夹分配自定义预设。
编辑之后
重启服务器(或创建新世界),以便 _tfc_structures_datapacks/tfc_structures_main 中生成的数据包根据你的 biomeTags 更改重新构建。structures_config.json 中的方块替换设置将在下一次结构生成时生效。
提示: 在 common-config.toml 中启用 biomesTagsStructuresToLogs 可将每个结构 ID 打印到日志中 —— 当你不确定确切资源位置时非常有用。
如何自定义结构的战利品表?
有三种方法:
- 使用自定义数据包(或 KubeJS data 文件夹)直接覆盖结构的战利品表。
- 使用自定义数据包创建你自己的战利品表,并通过
config/tfc_structures/structures_config.json 中的 lootTablesOverrideMap 用你的战利品表覆盖指定结构的原版战利品表。
- 使用 KubeJS + LootJS 替换战利品表中的物品(你可以参考我在整合包 TFC: Lost Light 中
kubejs/server_scripts/modpack_loot_replacement.js 文件里的做法)。这是更简单的方式,因为它会自动处理所有结构战利品表的替换。
已知问题
- 目前,tfcWorldReplacement 不兼容非默认的 TFC 方块(例如 ArborFirmaCraft)
- 结构无法在水中生成(包括咸水和泉水)
Dynamic TFC Structures
Did you ever dream of filling your TerraFirmaCraft world with authentic structures? Dynamic TFC Structures will bring them to your world!
Dynamic TFC Structures can activate any world-gen structure and replace its blocks with TerraFirmaCraft analogues, as if
it were built especially for TFC.
The mod is also fully configurable; you may find configuration files in the config/tfc_structures folder. By
default,
only vanilla structures are activated, but you can activate any other modded structure.
Primarily aimed at TerraFirmaCraft modpack authors — this mod helps you bring vanilla and modded structures into TFC worlds with configurable block replacements and worldgen rules.
Despite the mod's name, Dynamic TFC Structures may work without TerraFirmaCraft, so feel free to use it in non-TFC modpacks :)
But you'll need to build configuration files yourself if you don't have TFC.
Disclaimer
Be aware that Dynamic TFC Structures is currently in BETA, so it contains bugs and there is still work to do.
Configurations
Dynamic TFC Structures has 3 main configuration files:
- common-config.toml
allowedDimensions - list of dimensions where structure blocks will be replaced with TFC blocks
biomesTagsStructuresToLogs - debug toggle to output biomes, biome tags, and structures to logs
fallbackToTfcStructuresLoot - toggle to enable tfc_structures loot tables in case there's no lootTablesOverrideMap
in structure
mossyBlocks/strippedLogs/strippedWood/crackedBricks - special tags for replacements. All of them will be
added to special block tags.
- worldgen_config.json
biomeTags - definitions of biome tags that will be generated to tfc_structures_datapacks/tfc_structures_main
datapack. It also contains structures that will be generated in that biome tag.
disabledStructures - list of structures you don't want to see in your world
defaultWorldgenStructures - list of structures that exist in the game but were not added to any list above, so they
will
use default generation rules. This property will update upon server loading.
- structures_config.json
structures - list of replacement rules for every structure, like replacement preset, lootTablesOverrideMap, etc.
This configuration will be created (or updated) upon server loading.
Also, there's a folder presets where you may find replacement preset configuration files.
Every preset has 3 properties:
- directReplacements - block-to-block map for direct replacement when a structure has spawned
- randomReplacements - block-to-many-blocks map for random replacement.
perBlock=false means the whole structure
will use
one block.
- tfcWorldReplacements - block-to-type map for block replacement with TFC blocks from surroundings (like stone, wood,
soil, sand, or ores)
By default, there are two presets: no-replace (empty preset) and overworld-common, but you can create additional
presets
yourself (don't forget to assign a preset to a structure in structures_config.json).
If you are annoyed by a lot of structures in one place,
you may also be interested in installing
Sparse Structures.
TFC Structures Datapacks folder
Dynamic TFC Structures generates its own data pack using configuration files, so it has its own directory for datapacks:
- tfc_structures_datapacks/tfc_structures_main
But you may place your datapacks or KubeJS-like datapack folders (use the tfc_structures_main datapack as an
example)
directly in the tfc_structures_datapacks folder, and they will load upon world creation.
Don't put your files in tfc_structures_main, because it will be deleted and re-created for every resource pack
generation.
Built-in data changes
You should be aware that Dynamic TFC Structures overrides vanilla loot tables to TFC items in the gameplay folder,
such as the Cat's morning gift, Hero of the Village reward, Piglin bartering, and Sniffer digging.
FAQ
How do I add new structures?
Just start a new world with your structure mods installed. After the first server load, you will find new structures in
config/tfc_structures/worldgen_config.json (in the defaultWorldgenStructures section) and in
config/tfc_structures/structures_config.json (in the structures section). Both files are created or updated
automatically when the server is about to start.
What happens under the hood
worldgen_config.json — the mod scans the structure registry and puts every structure that is not listed in
biomeTags or disabledStructures into defaultWorldgenStructures. Structures in that list keep the biome rules
from the original mod. To make a structure spawn in TFC biomes, move its ID from defaultWorldgenStructures into a
biomeTags entry (create a new one or add it to an existing tag). See the vanilla entries in
WorldgenConfig.getDefaultConfig() for examples.
structures_config.json — every registered structure that is missing from structures gets a default entry:
replacementPreset: "overworld-common", the default empty-chest loot table from common-config.toml, and an empty
lootTablesOverrideMap. Adjust the preset, loot overrides, or assign a custom preset from the presets folder as
needed.
After editing
Restart the server (or create a new world) so the generated datapack in _tfc_structures_datapacks/tfc_structures_main
is rebuilt with your biomeTags changes. Block replacement settings from structures_config.json are picked up on the
next structure spawn.
Tip: enable biomesTagsStructuresToLogs in common-config.toml to print every structure ID to the log — useful
when you are unsure of the exact resource location.
How to customize loot tables on structures?
There are three ways:
- Override loot tables of structures directly using a custom datapack (or KubeJS data folder).
- Create your own loot tables using a custom datapack and override vanilla tables with yours for desired structures
using
lootTablesOverrideMap in config/tfc_structures/structures_config.json.
- Replace items in loot tables using KubeJS + LootJS (you may take a look at how I did that in my modpack TFC: Lost
Light, in file
kubejs/server_scripts/modpack_loot_replacement.js). This one is the easier way, as it will be fully
automatic for all structure loot tables.
Known issues
- Currently, tfcWorldReplacement is not compatible with non-default TFC blocks
(e.g., ArborFirmaCraft)
- Structures can't spawn on water (including salt and spring water)
评论 0
登录后参与评分
还没有评论,来抢沙发吧