The Block Keeps Ticking
这个精美的模组图标由 Sulmino_ 在 Twitter/X 上 创作。
模拟未加载区块中的方块 ticking 和实体
The Block Keeps Ticking 是 Alive World(它是 Presence Not Required 的一个分支)的完全重写版本,它允许方块和实体在未加载的区块中继续推进状态,这样即使你远离这些区域,你的农田、熔炉和被动型生物也能继续生长和工作。
功能
-
离开时模拟: 当你远离那些区块时,模拟未加载区块中的方块和实体。
-
方块支持:
- 方块实体: 熔炉、营火、酿造台
- 作物与藤蔓: 小麦、胡萝卜、马铃薯、甜菜根、火把花、南瓜和西瓜
- 下界疣: 生长进度
- 可可豆: 生长进度
- 树木: 树苗生长
- 树叶: 腐烂进度
- 生长植物: 海带、竹子、甘蔗、仙人掌
- 干烬幽灵 & 嗅探器蛋: 水分保持与孵化进度
- 芽孢紫水晶: 生长进度
- 炼药锅: 水和岩浆滴落
- 泥块 & 耕地: 滴水石上方的泥块转化为黏土,耕地的湿润度
- 甜浆果丛: 生长进度
-
实体支持: 可成长生物(向成年形态生长),包括在未加载区块中母鸡产蛋
*注意:由于处理嗅探器蛋和干烬幽灵的方式不同,模拟过程中会损失一些精度。
-
时间模式: 选择世界时间(仅在游玩时推进)或真实时间(离线时也会推进)。
-
睡眠后模拟: 时间跳跃(例如通过睡觉跳过夜晚)期间,将模拟已加载区块的时间流逝。
-
Lazy Tax 设置: 配置模拟刻数的减少百分比,以便根据你的偏好平衡速度来减缓模拟进程。
-
逐对象配置: 单独启用或禁用特定方块和实体的模拟。
-
命令: 拥有者/OP 命令用于检查或更改配置,并手动模拟区块或方块(见下文)。
-
服务端: 当安装在服务器上时,玩家无需安装该模组。也可安装在单人世界中。
配置
你可以使用 ModMenu 和 YetAnotherConfigLib,通过编辑 config\the-block-keeps-ticking.json,或使用 /tbkt config(参见命令部分)来配置以下值。
-
时间源: 选择“世界时间”(仅在游玩时推进)或“真实时间”(离线时也会推进)。真实时间与 Lazy Tax 配合效果良好。(默认:世界时间)
-
睡眠后模拟: 启用后,时间跳跃(例如通过睡觉跳过夜晚)期间,将模拟已加载区块的时间流逝。(默认:true)
-
最小居住时间(刻): 居住时间短于此值的区块不会被模拟。这有助于控制探索时的延迟。
6000代表 5 分钟。0表示始终模拟。范围:0–24000。(默认:6000) -
Lazy Tax(%): 模拟刻数将按此百分比减少。增加此值会减慢未加载区块中的模拟速度。范围:0-99。(默认:0)
-
调试日志: 启用详细的日志记录,包括扫描与模拟耗时、居住时间跳过以及分阶段追赶切片等信息。(默认:false)
-
Ticking 对象: 针对每种支持的方块类型和实体的独立开关,以启用或禁用模拟。默认全部启用。
命令
所有命令都需要权限级别 4。也可以使用 /theblockkeepsticking ...。
/tbkt config:列出当前配置值和设置用法/tbkt config reload:从磁盘重新加载配置,并写入任何缺失的默认值/tbkt config set <option> <value>:设置通用选项(timeMode,lazyTaxPercent,simulateChunksWhenSleeping,minInhabitedTicks,debugLogging)/tbkt config set tickingObject <true|false> <name>:启用或禁用某个 ticking 对象/tbkt simulate chunk <ticks> [<chunkX> <chunkZ>]:模拟已加载区块中的所有 ticking 对象。省略坐标则使用执行命令的玩家所在的区块/tbkt simulate block <ticks> [<x> <y> <z>]:模拟单个支持的方块或方块实体。省略坐标则使用执行命令的玩家的位置
simulate chunk 要求该区块必须处于加载状态。
⚠️ 警告:此模组存储 Fabric 区块附件(chunk attachments)。移除它可能会导致关于未知附件类型的无害日志刷屏。这是 Fabric 的限制,并非模组本身的错误。
API 用法
The Block Keeps Ticking 提供了一个小型 API,以便其他模组可以注册自己的 ticking 对象,使其在未加载区块中进行模拟。
注册自定义 ticking 对象
要为你的模组注册自定义 ticking 对象:
-
为每个你想要模拟的方块、方块实体或实体创建一个
TickingObject实现。
继承TickingObject并至少实现以下方法:getType()– 返回你想要处理的类(例如一个Block、BlockEntity或Entity子类)getName()– 一个唯一名称,仅用于配置和日志记录Simulate(...)– 包含模拟逻辑
重要提示: 你需要负责完整实现自己的
Simulate(...)方法。The Block Keeps Ticking 只会告诉你应该模拟多少刻以及何时模拟。它不提供默认行为,也不会自动为你推进你的方块或实体。为了简化操作,提供的 API 和实用类中包含了一些辅助方法,你可以在自己的Simulate(...)实现中调用它们。
可选地重写 getModId() 以返回你模组的 ID,从而使日志和配置文件能清晰地显示是哪个模组注册了该对象。
-
暴露一个
TickingAccessor(推荐)
对于原版或第三方内容,请将TickingAccessor接口添加到针对相关类的 mixin 中,并将模拟转发到你现有的 tick 逻辑中。对于自定义方块/实体,你可以选择:- 实现
TickingAccessor并进行委托,或者 - 直接在
TickingObject内部实现模拟逻辑(不推荐,但对于简单的方块是可行的)。
- 实现
-
实现
InitializeTickingBlocks入口点
在你的模组中创建一个实现InitializeTickingBlocks的类,并注册你的 ticking 对象:public class YourTickingBlocksInitializer implements InitializeTickingBlocks { @Override public void registerTickingBlocks(TickingBlockRegistry registry) { registry.register(new YourTickingBlock()); // 如果需要,在此处注册更多 ticking 对象 } } -
在
fabric.mod.json中注册入口点
在你的模组的fabric.mod.json中,添加指向你的初始化器的theblockkeepsticking入口点:"entrypoints": { "theblockkeepsticking": [ "[[YOUR-MODID]].YourTickingBlocksInitializer" ] }
当 The Block Keeps Ticking 初始化时,它将发现所有 theblockkeepsticking 入口点并调用 registerTickingBlocks,将你的 TickingObjects 接入模拟系统。
API 示例项目
此仓库在 api-example 文件夹下包含一个 API 示例模组。它演示了:
- 如何为原版
ChestBlockEntity实现自定义TickingObject(TickingChestBlockEntity) - 如何使用 mixin 结合
TickingAccessor接口桥接到现有的 tick 逻辑 - 如何挂钩到
theblockkeepsticking入口点(APIExampleTickingBlocks)并注册你的 ticking 对象
你可以将此示例作为起点,用于将你自己的模组集成到 The Block Keeps Ticking 中。
The Block Keeps Ticking
This wonderful mod icon was created by Sulmino_ on Twitter/X.
Simulate block ticking and entities in unloaded chunks
The Block Keeps Ticking is a complete rewrite of Alive World, (which is a fork of Presence Not Required) that allows blocks and entities to continue progressing in unloaded chunks, so your farms, furnaces, and passive mobs keep growing and working even when you're far away.
Features
-
Simulate When Away: Simulate blocks and entities in unloaded chunks when you are away from those chunks.
-
Block Support:
- Block Entities: Furnaces, Campfires, Brewing Stands
- Crops & Stems: Wheat, Carrots, Potatoes, Beetroots, Torchflowers, Pumpkins and Melons
- Nether Wart: Growth progression
- Cocoa Beans: Growth progression
- Trees: Sapling growth
- Leaves: Decay progression
- Growing Plants: Kelp, Bamboo, Sugar Cane, Cactus
- Dried Ghast & Sniffer Eggs: Hydration and hatching progression
- Budding Amethyst: Growth progression
- Cauldrons: Water and lava dripping
- Mud & Farmland: Mud above dripstone converting to clay, farmland hydration
- Sweet Berry Bushes: Growth progression
-
Entity Support: Ageable mobs (growth toward adulthood), including chicken egg laying in unloaded chunks
*Note: Due to the way Sniffer Eggs and Dried Ghasts are processed, some precision is lost during simulation.
-
Time Modes: Choose between world time (only progresses when playing) or real time (progresses even when offline).
-
Simulate After Sleeping: Time skips (e.g. from sleeping) will simulate loaded chunks for the duration of the time skip.
-
Lazy Tax setting: Configure a percentage reduction of simulated ticks to slow down simulation for your prefered balance level.
-
Per-Object Configuration: Enable or disable simulation for specific blocks and entities individually.
-
Commands: Owner/op commands to inspect or change config and manually simulate chunks or blocks (see below).
-
Serverside: When installed on a server, players do not need to install the mod. Can also be installed in singleplayer worlds.
Configuration
You can configure the following values with ModMenu and YetAnotherConfigLib, by editing config\the-block-keeps-ticking.json, or with /tbkt config (see Commands).
-
Time Source: Choose between "World Time" (only progresses when playing) or "Real Time" (progresses even when offline). Real Time works well with lazy tax. (Default: World Time)
-
Simulate After Sleeping: When enabled, time skips (e.g. from sleeping) will simulate loaded chunks for the duration of the time skip. (Default: true)
-
Min Inhabited Time (ticks): Chunks with less inhabited time than this are not simulated. Keeps exploration lag down.
6000is 5 minutes.0always simulates. Range: 0–24000. (Default: 6000) -
Lazy Tax (%): Simulated ticks are reduced by this percentage. Increasing this value slows down simulation in unloaded chunks. Range: 0-99. (Default: 0)
-
Debug Logging: Enables detailed logging when simulation occurs, including scan vs simulate timings, inhabited-time skips, and staggered catch-up slices. (Default: false)
-
Ticking Objects: Individual toggles to enable or disable simulation for each supported block type and entity. All are enabled by default.
Commands
All commands require permission level 4. Also available as /theblockkeepsticking ....
/tbkt config: Lists current config values and set usage/tbkt config reload: Reloads the config from disk and writes any missing defaults/tbkt config set <option> <value>: Sets a general option (timeMode,lazyTaxPercent,simulateChunksWhenSleeping,minInhabitedTicks,debugLogging)/tbkt config set tickingObject <true|false> <name>: Enables or disables a ticking object/tbkt simulate chunk <ticks> [<chunkX> <chunkZ>]: Simulates all ticking objects in a loaded chunk. Omit coordinates to use the executing player's chunk/tbkt simulate block <ticks> [<x> <y> <z>]: Simulates a single supported block or block entity. Omit coordinates to use the executing player's position
The chunk must be loaded for simulate chunk.
⚠️ Warning: This mod stores Fabric chunk attachments. Removing it may cause harmless log spam about unknown attachment types. This is a Fabric limitation, not a bug in the mod.
API usage
The Block Keeps Ticking exposes a small API so other mods can register their own ticking objects to be simulated in unloaded chunks.
Registering custom ticking objects
To register custom ticking objects for your mod:
-
Create a
TickingObjectimplementation for each block, block entity, or entity you want to simulate.
ExtendTickingObjectand implement at least:getType()– returns the class you want to handle (e.g. aBlock,BlockEntity, orEntitysubclass)getName()– a unique name, only used for configuration and loggingSimulate(...)– contains the simulation logic
Important: You are responsible for fully implementing your own
Simulate(...)method. The Block Keeps Ticking only tells you how many ticks should be simulated and when. It does not provide default behavior or automatically advance your blocks or entities for you. To make this easier, there are helper methods available in the provided API and utility classes that you can call from inside yourSimulate(...)implementation.Optionally override
getModId()to return your mod's ID, so logs and config clearly show which mod registered the object. -
Expose a
TickingAccessor(recommended)
For vanilla or third‑party content, add theTickingAccessorinterface to a mixin targeting the relevant class, and forward the simulation to your existing tick logic. For custom blocks/entities you can either:- implement
TickingAccessorand delegate, or - implement the simulation logic directly inside your
TickingObject(not recommended, but possible for simple blocks).
- implement
-
Implement the
InitializeTickingBlocksentrypoint
Create a class in your mod that implementsInitializeTickingBlocksand registers your ticking objects:public class YourTickingBlocksInitializer implements InitializeTickingBlocks { @Override public void registerTickingBlocks(TickingBlockRegistry registry) { registry.register(new YourTickingBlock()); // register more ticking objects here if needed } } -
Register the entrypoint in
fabric.mod.json
In your mod'sfabric.mod.json, add thetheblockkeepstickingentrypoint pointing to your initializer:"entrypoints": { "theblockkeepsticking": [ "[[YOUR-MODID]].YourTickingBlocksInitializer" ] }
When The Block Keeps Ticking initializes, it will discover all theblockkeepsticking entrypoints and call registerTickingBlocks, wiring your TickingObjects into the simulation system.
API example project
This repository includes an API example mod under the api-example folder. It demonstrates:
- How to implement a custom
TickingObject(TickingChestBlockEntity) for a vanillaChestBlockEntity - How to use a mixin plus the
TickingAccessorinterface to bridge into existing tick logic - How to hook into the
theblockkeepstickingentrypoint (APIExampleTickingBlocks) and register your ticking objects
You can use this example as a starting point for integrating your own mod with The Block Keeps Ticking.
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
下载 The Block Keeps Ticking
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 支持 NeoForge!
- 已更新至 26.3 版本
- 新增农田(Farmland)支持
- 新增命令
- /tbkt config:列出当前配置值及设置用法
- /tbkt config reload:从磁盘重新加载配置文件,并写入任何缺失的默认值
- /tbkt config set
- /tbkt config set tickingObject <true|false> <name>:启用或禁用某个运行中的对象
- /tbkt simulate chunk <ticks> [<chunkX> <chunkZ>]:模拟已加载区块中的所有运行中的对象。省略坐标将使用执行者所在的区块
- /tbkt simulate block <ticks> [<x> <y> <z>]:模拟单个受支持的方块或方块实体。省略坐标将使用执行者的位置
- 也可使用 /theblockkeepsticking。需要权限等级 4。simulate chunk 要求相关区块必须处于加载状态
- 加载时间不足 5 分钟的区块将不再进行模拟,以减少沿半常见世界路径移动时产生的卡顿
- 可模拟对象的区块扫描现在最多分 20 个刻(ticks)错开执行,以减轻卡顿
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧