ForceloadLib
一个 Minecraft 数据包库,添加了与强制加载区块相关的各种有用功能。
下载:Modrinth
如有咨询,请在 Discord 上联系 @silicatYT。
为什么你需要 ForceloadLib
如果你的数据包使用了强制加载的区块,它本质上将与任何也使用强制加载的数据包不兼容。同一数据包内多个使用强制加载的系统也是如此。
ForceloadLib 通过提供基于引用的方法以及命名空间隔离引用来解决此问题。这允许你的系统或数据包独立地强制加载区块,而不会相互干扰。
除了这一点,ForceloadLib 还提供了许多其他有用的功能。
注意: 尽管 ForceloadLib 力求跨数据包兼容性,但不使用该库的数据包仍然会不兼容。
功能
- 基于引用的强制加载
- 向区块添加和移除强制加载引用
- 只有当所有引用都被移除后,区块才会停止被强制加载
- 每个引用都属于一个命名空间,以便更好地控制并确保跨系统兼容性
- 为你的强制加载引用提供各种可选参数:
Command:在指定位置运行命令
CommandTrigger:指定命令运行的时机
Force:使引用不可移除,直到区块加载
Protected:使引用不可移除,除非你通过 ID 直接针对它
Duration:使引用在经过任意数量的刻后消失
- 强大的引用管理
- 要么移除区块中最后一个可移除的引用,要么通过 ID 直接针对它
- 区块加载管理。当区块被加载时:
#ForceloadLib.ChunkLoaded ForceloadLib 分数会被设置为该引用的 ID
forceloadlib:event ChunkLoaded 存储会被设置区块的 Dimension、X 和 Z 数据
#forceloadlib:chunk_loaded 函数标签会被调用,并将该存储作为宏源
- 每当区块被加载时调用的函数标签
- 它还会设置一个分数(引用 ID)和一个存储(维度及 X/Z 坐标)用于
- 与原版强制加载区块的兼容性
使用方法
请遵循相应函数中的说明(除 zprivate 之外的所有内容):
- 添加强制加载引用:
forceloadlib:util/add/from_storage
forceloadlib:util/add/from_storage_and_position => 比 from_storage 少 1 次宏调用,但必须在正确的区块内执行
- 移除强制加载引用:
forceloadlib:util/remove/from_storage
forceloadlib:util/remove/from_storage_and_position => 比 from_storage 少 1 次宏调用,但必须在正确的区块内执行
forceloadlib:util/remove/with_id
forceloadlib:util/remove/with_id_from_position => 比 with_id 少 1 次宏调用,但必须在正确的区块内执行
- 更新 ForceloadLib:
- 运行
forceloadlib:uninstall
- 移除数据包并替换为新版本
- 重新加载
- 卸载 ForceloadLib:
- 运行
forceloadlib:uninstall 并点击红色的 CLICK HERE 消息以清除所有剩余的区块数据
- 移除数据包
注意: ForceloadLib 提供了一个免费使用的记分板目标,名为 ForceloadLib.ChunkID
致谢
来自 CMDred:
许可证
根据 MIT 许可证,只要我们对原始工作给予署名,你就可以重新分发、修改和使用本项目。
ForceloadLib
A Minecraft Data Pack library that adds various useful features related to forceloading chunks.
Download: Modrinth
For inquiries, please contact @silicatYT on Discord.
Why you need ForceloadLib
If your DataPack uses forceloaded chunks, it's inherently incompatible with any other DataPack which does too. The same is the case for multiple systems within the same DataPack which use forceloads.
ForceloadLib solves this by not only providing a reference-based approach, but also by namespacing the references. This allows your systems or DataPacks to independently forceload chunks without interfering with one another.
ForceloadLib also offers many useful features aside from that.
Note: While ForceloadLib strives for cross-pack compatibility, DataPacks that don't use it will still be incompatible.
Features
- Reference-based forceloading
- Add and remove forceload references from a chunk
- The chunk will only stop being forceloaded once every single reference has been removed
- Each reference belongs to a namespace for better control & cross-system compatibility
- Various optional parameters for your forceload references:
Command: Run a command at the specified location
CommandTrigger: Specify when the command runs
- Instantly (or as soon as the chunk loads)
- Only if the chunk loads
Force: Make the reference unremovable until the chunk is loaded
Protected: Make the reference unremovable unless you target it directly via ID
Duration: Make the reference disappear after an arbitrary number of ticks
- Powerful reference management
- Either remove the last removable reference from a chunk, or target it directly via ID
- Chunk loading management. When a chunk gets loaded:
#ForceloadLib.ChunkLoaded ForceloadLib score gets set to the reference's ID
forceloadlib:event ChunkLoaded storage gets set with the Dimension, X and Z data of the chunk
#forceloadlib:chunk_loaded function tag gets called with that storage as a macro source
- A function tag that's called whenever a chunk gets loaded
- It also sets a score (Reference ID) & a storage (Dimension & X/Z coords) for
- Compatibility with Vanilla forceloaded chunks
- These chunks will be ignored when trying to add/remove references
How to use
Follow the instructions in the respective function (Everything except zprivate):
- Add forceload references:
forceloadlib:util/add/from_storage
forceloadlib:util/add/from_storage_and_position => 1 macro call less than from_storage, but must be executed inside the correct chunk
- Remove forceload references:
forceloadlib:util/remove/from_storage
forceloadlib:util/remove/from_storage_and_position => 1 macro call less than from_storage, but must be executed inside the correct chunk
forceloadlib:util/remove/with_id
forceloadlib:util/remove/with_id_from_position => 1 macro call less than with_id, but must be executed inside the correct chunk
- Update ForceloadLib:
- Run
forceloadlib:uninstall
- Remove the datapack and replace it with the new version
- Reload
- Uninstall ForceloadLib:
- Run
forceloadlib:uninstall and click the red CLICK HERE message to clear all remaining chunk data
- Remove the datapack
Note: ForceloadLib provides a free-to-use scoreboard objective called ForceloadLib.ChunkID
Credit
From CMDred:
License
As per the MIT License, you are allowed to redistribute, modify and use this project as long as we are credited for the original work.
评论 0
登录后参与评分
还没有评论,来抢沙发吧