Chunk Schedudeler
高效且可控的区块加载(对服务器友好)。
区块加载器方块(“Schedudeler”)

Schedudeler 是该模组添加的唯一一个方块。它能够加载其周围区域内的区块,但会随时间缓慢消耗充能。

放置后的 Schedudeler 初始为空,可以通过右键点击对其进行充电。只要有任何玩家附近(在 24 格半径内)或其所有者在线(详见下文),它也会自动充电。Schedudeler 的默认容量为 576000 刻(8 小时)。
在默认状态下,Schedudeler 不属于任何人(公共状态),其区块加载半径为 0,即仅加载其所在的区块。
Schedudeler 仅在主动加载区块时才会消耗充能。

当 Schedudeler 处于充能/激活状态时,位于其中心的染色玻璃方块的边角会亮起并缓慢脉动。

尝试手动给已满充的 Schedudeler 充电时,它会发出粒子效果。

可以通过应用铁质升级(使用 Iron Ingot 右键点击)来升级 Schedudeler。这将把 Schedudeler 的最大充能提升至总计 1728000 刻(24 小时)。
各项升级可以独立应用。

金质升级(使用 Gold Ingot 右键点击)会将 Schedudeler 的区块加载半径提升至总计 1(3x3 区块区域)。
最大的半径
1设置得较低,旨在鼓励玩家使用更多小型区块加载器(而非单个大型加载器),这有助于调度算法在多名玩家之间公平分配区块加载器(参见区块调度部分)。铁质和金质升级提供的增益可以在配置中进行调整。

玩家可以通过应用末影升级(使用 Ender Eye 右键点击)来认领 Schedudeler 的所有权。这具有多项优势:
- 无论距离多远,只要所有者在线,Schedudeler 就会充电。
- 区块加载器的调度将考虑玩家拥有的区块加载器数量与其他玩家及公共区块加载器(未被任何玩家拥有)的比例关系。更多信息请查看区块调度部分。

链式升级(使用 Chain 右键点击)会锁定 Schedudeler,防止玩家(误操作)应用其他升级。

玩家可以使用 Redstone Torch 右键点击任意 Schedudeler,以显示加载区域的预览(区块边界),该预览仅对该玩家在短时间内可见。Redstone Torch 不会被消耗。

一旦被破坏,之前应用的所有升级也将掉落。
区块调度
本模组的核心功能之一是调度算法。这意味着在任何维度中,同时活跃的区块加载器数量始终保持在可配置的限额内(默认为 8 个)。为了实现这一点,区块加载器会被排队,每 8 个区块加载器为一组,每组会在短时间内被激活(默认为 80 刻)。
此外,该算法还会考虑每个所有者(以及公共区块加载器数量)拥有的区块加载器数量,并确保各方获得激活其区块加载器的总时间相同。
举例说明: 假设为了简化起见,始终只有 2 个区块加载器同时活跃。如果玩家 Red 放置了 1 个区块加载器,而玩家 Blue 放置了 100 个区块加载器,那么在每次调度中,玩家 Red 的那 1 个区块加载器将与玩家 Blue 的下一个区块加载器一起被激活。要激活玩家 Blue 的每一个区块加载器各一次,总共需要 100 次调度(8000 刻)。与此同时,玩家 Red 的区块加载器将被激活 100 次。
以下动画演示了算法的工作过程(在一个稍复杂但紧凑的例子中)。你可以查看此仓库以获取有关该主题的更多信息。

配置
可用的配置选项及其默认值:
| 名称 | 描述 | 默认值 |
|---|---|---|
maxActiveChunkLoaders |
定义同时处于活动状态的区块加载器的最大数量。 | 8 |
maxChunkLoaderCharge |
定义区块加载器总共可以活动的最大刻数(ticks)。 | 576000 |
ticksOfActiveChunkLoading |
定义每一组排队中的区块加载器保持活动的刻数。注意:如果此值过低,某些(方块)实体更新可能会被跳过(例如,“日光传感器”每 20 个世界刻更新一次)。 | 80 |
rechargeFactorRightClick |
定义区块加载器每次右键点击所充能的百分比量。 | 0.1 |
rechargeFactorPlayersNearby |
定义区块加载器在玩家附近时,每刻所充能的百分比量。 | 0.05 |
rechargeFactorOwnerOnline |
定义区块加载器在其所有者在线时,每个激活周期所充能的百分比量。 | 0.1 |
rechargeRadiusPlayersNearby |
定义区块加载器周围扫描附近玩家的半径,以确定是否应该充能。 | 24 |
ironUpgradeBonusCharge |
定义带有铁质升级的区块加载器所增加的最大充能值。 | 1152000 |
ironUpgradeBonusRadius |
定义带有铁质升级的区块加载器所增加的额外区块半径。 | 0 |
goldUpgradeBonusCharge |
定义带有金质升级的区块加载器所增加的额外区块半径。 | 0 |
goldUpgradeBonusRadius |
定义带有金质升级的区块加载器所增加的额外区块半径。 | 1 |
logChunkStateChange |
如果启用,将记录任何区块“强制加载”状态的变化。 | false |
logChunkLoaderUpdates |
如果启用,将记录区块加载器方块实体的更新。 | false |
logChunkLoaderRegistration |
如果启用,将记录区块加载器的(反)注册情况。 | false |
命令
所有命令都需要至少 1 级的权限等级:
chunkschedudeler get <blockPos> [charge|radius|owner|locked]:获取给定位置处 Schedudeler 的相关信息。
常见问题
区块加载器是否按玩家限制?
否。
如果可以有无限制的区块加载器,性能表现如何?
始终相同,因为同时处于活动状态的区块加载器永远不会超过配置的数量(默认为 8)。
是否存在区块加载器永远不激活的情况?
不会。只要它们有充能,迟早会轮到它们激活。
玩家可以通过在同一区域放置大量区块加载器来“作弊”吗?
不会。由于认领这些区块加载器符合他们的利益,玩家拥有的区块加载器总数会增加,这将导致该玩家拥有的每个区块加载器激活频率降低(更多信息请参阅 区块调度)。
免责声明
我在测试中发现,紧邻由区块加载器强制加载的区块旁边的区块也会被加载。我还从其他模组的区块加载器中注意到了这种行为。总之,这意味着一个半径为 0 的区块加载器(即 1x1 区块区域)实际上会加载一个 3x3 的区域,一个半径为 1 的区块加载器(即 3x3 区块区域)会加载一个 5x5 的区块区域,依此类推。由于我不完全确定额外的区块会被可靠地加载,因此将这些视为开销而不予考虑。
Chunk Schedudeler
Efficient and controlled chunk loading (server friendly).
Chunk Loader Block ("Schedudeler")

The Schedudeler is the only block added by this mod. It is capable to load chunks in an area around it but will slowly loose charge over time.

A Schedudeler will be empty once placed but it can be recharged by right clicking it. It will also recharge as long as any player is nearby (within a 24 block radius) or its owner is online (more to that later). The default capacity of a Schedudeler is 576000 ticks (8 hrs).
In its default state the Schedudeler isn't owned by anyone (public) and has a chunk radius of 0 i.e. it will only load the chunk it was placed in.
A Schedudeler will only loose charge while it is actively loading its chunks.

The Tinted Glass Block in the center of a Schedudeler will turn on its corner and slowly pulsate while the Schedudeler is charged/active.

When attempting to manually recharge a Schedudeler that is already full it will emit particles.

A Schedudeler can be upgraded by applying the Iron Upgrade to it (right click with Iron Ingot). This will increase the max charge of a Schedudeler to a total of 1728000 ticks (24 hrs).
Upgrades can be applied independent of each other.

The Gold Upgrade (right click with Gold Ingot) will increase the chunk radius of a Schedudeler to a total of 1 (3x3 chunk area).
The largest radius of
1is this low to incentivise players to use more small chunk loaders (rather than single big ones), which helps the scheduling algorithm to fairly distribute chunk loaders among multiple players (see Chunk Scheduling section). The benefits provided by the Iron- and Gold upgrade can be configured.

Players can claim ownage of Schedudelers by applying the Ender Upgrade (right click with Ender Eye). This has several advantages:
- The Schedudeler will recharge whenever the owner is online (regardless of how far away).
- The scheduling of chunk loaders will account for the amount of chunk loaders a player owns in relation to other players and public chunk loaders (not owned by any player). For more info make sure to check the Chunk Scheduling section.

The Chain Upgrade (right click with Chain) locks a Schedudeler, which will prevent players from (mistakenly) applying any further upgrades.

A player may right click any Schedudeler with a Redstone Torch to display a preview of the loaded area (chunk boundaries) only visible to that player for a short amount of time. The Redstone Torch is not used up.

Once destroyed all previously applied upgrades will be dropped as well.
Chunk Scheduling
A core feature of this mod is the scheduling algorithm. This means there will always only be a configurable amount of chunk loaders active at the same time, per dimension (8 by default). To achieve this the chunk loaders are queued and each set of 8 chunk loaders will be activated for a short period of time (80 ticks by default).
In addition the algorithm takes the number of chunk loaders per owner (and number of public chunk loaders) into account and ensures that each party will receive the same amount of time to activate its chunk loaders.
To give an example: Lets assume for simplicity sake there will only always be 2 chunk loaders active at the same time. If player Red has placed a single chunk loader and player Blue has placed 100 chunk loaders, during each schedule the single chunk loader from player Red along the next chunk loader from player Blue will be activated. It will take a total of 100 schedules (8000 ticks) to activate each of player Blues chunk loaders exactly once. At the same time the chunk loader of player Red will be activated 100 times.
Following animation illustrates the algorithm at work (on a little more complex but compact example). You may check out this repo for more information on the topic.

Configuration
Available config options and their default values:
| Name | Description | Default |
|---|---|---|
maxActiveChunkLoaders |
Defines the maximum number of chunk loaders that can be active at the same time. | 8 |
maxChunkLoaderCharge |
Defines the max number of ticks chunk loaders can be active in total. | 576000 |
ticksOfActiveChunkLoading |
Defines the number of ticks every set of queued chunk loaders stay active. Note: If this value is to low some (block) entity updates may get skipped (e.g. the 'Daylight Sensor' updates on every 20th world tick). | 80 |
rechargeFactorRightClick |
Defines the percentage amount a chunk loader recharges per right click. | 0.1 |
rechargeFactorPlayersNearby |
Defines the percentage amount a chunk loader recharges per tick while players are nearby. | 0.05 |
rechargeFactorOwnerOnline |
Defines the percentage amount a chunk loader recharges per activation cycle while its owner is online. | 0.1 |
rechargeRadiusPlayersNearby |
Defines the radius around a chunk loader it will scan for nearby players to determine if it should recharge. | 24 |
ironUpgradeBonusCharge |
Defines the additional max charge that is added to the charge of chunk loaders with an iron upgrade. | 1152000 |
ironUpgradeBonusRadius |
Defines the additional chunk radius that is added to the radius of chunk loaders with an iron upgrade. | 0 |
goldUpgradeBonusCharge |
Defines the additional chunk radius that is added to the radius of chunk loaders with a gold upgrade. | 0 |
goldUpgradeBonusRadius |
Defines the additional chunk radius that is added to the radius of chunk loaders with a gold upgrade. | 1 |
logChunkStateChange |
If enabled any change of the 'forced' state from chunks will be logged. | false |
logChunkLoaderUpdates |
If enabled updates of chunk loader block entities will be logged. | false |
logChunkLoaderRegistration |
If enabled the (un)registration of chunk loaders will be logged. | false |
Commands
All commands require a permission level of atleast 1:
chunkschedudeler get <blockPos> [charge|radius|owner|locked]: Retrieves information about the Schedudeler at the given position.
FAQ
Are chunk loaders limited per player?
No.
How is the performance if there can be unlimited chunk loaders?
Always the same as there will never be more than the configured amount of chunk loaders active at the same time (8 by default).
Is it possible that chunk loaders never activate?
No. As long as they are charged it will eventually be their turn.
Can players 'cheat' the system by placing many chunk loaders in the same area?
No. As it would be in their interest to claim those chunk loaders the number of total chunk loaders the player owns will go up, which will result in every single chunk loader owned by that player getting activated less often (see Chunk Scheduling for more info).
Disclaimer
I noticed in my testings that the chunks right next to chunks that are forcefully loaded by chunk loaders will be loaded as well. I also noticed this behaviour with chunk loaders from other mods. In conclusion this means a chunk loader with a radius of 0 (i.e 1x1 chunk area) will in reality load a 3x3 area, a chunk loader with a radius of 1 (i.e. 3x3 chunk area) will load a 5x5 chunk area and so on. Since I am not 100% certain the additional chunks are realiably loaded those are disregarded as overhead.
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
下载 Chunk Schedudeler
更新日志
[0.9.1-beta] - 2024-12-17
已修复
- 专用服务器在 Forge 环境下尝试加载客户端类导致的崩溃问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
评论 0
登录后参与评分
还没有评论,来抢沙发吧