Villagers Keep TFC Lamps Lit
一款 Minecraft 模组,通过让附近的村民维护灯具,使 TerraFirmaCraft 的灯具更适合作为永久性建筑的一部分。
? 功能特性
当前功能
- 当附近 TFC 灯具燃料不足时,村民会自动为其补充燃料
- 随机化的补充量带来自然的维护感
- 仅对已点亮的灯具进行补充(空灯或未点亮的灯具将被忽略)
- 所有数值均可配置,以微调体验
计划中的功能
- 允许白名单/黑名单指定燃料类型的配置项
- 添加其他可自动补充灯笼燃料实体的配置项
- 基于燃料燃烧所需时间设置补充冷却时间,以防止无限提取燃料(不过目前这应该不是主要问题;详见下文说明)
? 工作原理
当灯具方块被tick(适用于任何扩展自 TFC LampBlock 类的方块实体)时,模组会检查附近的村民。如果村民在有效范围内且灯具的燃料水平低于配置的阈值,则会将灯具补充至一个随机量的燃料(具体范围由配置文件定义)。
✏️ 配置
所有数值均可在随附的配置文件中调整(位于 forge_dir/config/villagerskeeptfclampslit.toml):
-
villagerRange: 村民需要距离灯具多远才能对其进行维护(单位:方块)
- 默认值:24
- 最小值:1,最大值:Integer.MAX_VALUE
-
fuelThreshold: 村民开始为灯具补充燃料时的燃料水平(单位:mB)
- 默认值:50
- 最小值:1,最大值:254
- 注意:每 mB 燃料大约可持续 8000 tick(约 6-7 分钟)
-
minFuelReplenish: 灯具被补充后的最低燃料量(单位:mB)
-
maxFuelReplenish: 灯具被补充后的最高燃料量(单位:mB)
ℹ️ 技术说明
在使用可以提取流体的模组(例如 Create)时,由于村民正在补充燃料,可能能够无限地提取燃料。然而,这通常不会造成太大影响,原因如下:
- 灯具仅在随机的方块 tick 时被补充
- 如果在 tick 之前灯具被抽空,它将熄灭
- 如有必要,可以将配置值调整为更低的数量,以阻止诸如极其缓慢的泵抽取等机制。
基本上,只有在以下两种情况下才可能发生无限提取:要么你以足够慢的速度提取流体,要么找到一种方法在灯具中保留少量流体。我稍后可能会通过添加合理的冷却时间来限制灯笼的补充频率,这也是我计划加入此模组的功能之一。
⚖️ 许可证
本项目采用 MIT 许可证授权。欢迎将其包含在整合包中。
Villagers Keep TFC Lamps Lit
A Minecraft mod that makes TerraFirmaCraft lamps more viable for permanent structures by having nearby villagers
maintain them.
? Features
Current Features
- Villagers automatically replenish fuel in nearby TFC lamps when they run low
- Natural feeling maintenance with randomized refill amounts
- Only already-lit lamps are refilled (empty or unlit lamps are ignored)
- Fully configurable values for fine-tuning the experience
Planned Fearures
- Config to whitelist/blacklist fuels
- Config to add additional entities that can automatically replenish lanterns
- Refill cooldown based on how long it should take for the fuel to burn, to prevent being able to infinitely extract
fuel (this shouldn't be a major concern as-is though; more information further below)
? How It Works
The mod checks for nearby villagers when a lamp block is ticked (should work with any block entity extending TFC's
LampBlock class). If villagers are within range and the lamp's fuel level falls below the configured threshold, the
lamp will be refilled up to a random amount of fuel (as defined by the range in the config).
✏️ Configuration
All values can be adjusted in the bundled config file (found in forge_dir/config/villagerskeeptfclampslit.toml):
-
villagerRange: Distance (in blocks) villagers need to be from a lamp to maintain it
- Default: 24
- Min: 1, Max: Integer.MAX_VALUE
-
fuelThreshold: Fuel level (in mB) at which villagers will refill lamps
- Default: 50
- Min: 1, Max: 254
- Note: Each mB lasts approximately 8000 ticks (~6-7 minutes)
-
minFuelReplenish: Minimum amount of fuel (in mB) the lamp is refilled to
- Default: 75
- Min: 1, Max: 250
-
maxFuelReplenish: Maximum amount of fuel (in mB) the lamp is refilled to
- Default: 150
- Min: 1, Max: 250
ℹ️ Technical Note
When using mods that can extract fluids (e.g. Create), it is probably possible to infinitely extract the fuel as it is
being refilled by villagers. However, this shouldn't be too big of a deal because:
- Lamps only get refilled on random block ticks
- If a lamp is emptied before being ticked, it will extinguish
- The config values can be adjusted to lower amounts if needed, to thwart mechanisms like really slow pump extraction.
Basically, the only way it's possible is if you either extract the fluids slow enough or you find a way to keep a
small amount of fluid in the lamp. I might later refine this by adding a proper cooldown to how often the lantern can be
refilled, and it's one of the things I plan on adding to this mod.
⚖️ License
This project is licensed under the MIT license. Feel free to include in modpacks.
评论 0
登录后参与评分
还没有评论,来抢沙发吧