TidyChunk 是一款 Minecraft Forge 模组,会在区块生成后移除其中的实体物品(EntityItems)。对我而言,其主要目的是减少探索时的杂物堆积,并避免玩家背包被塞满。
其工作原理相当直接。在世界生成期间,Forge 会发布事件,TidyChunk 会监听这些事件。当有新区块正在生成时,它会记住该区块。随后,当有实体物品加入世界时,TidyChunk 会交叉检查该实体物品的位置是否在其已记录的区块列表中。如果该物品位于其中一个新生成的区块中,则将该实体物品设为死亡状态并取消 Forge 事件。最终结果是世界中残留的垃圾更少。
请注意,此功能仅适用于由 Minecraft 驱动的区块生成和世界生成过程。部分模组的世界生成方式不同于 Minecraft 的常规机制。在这种情况下,TidyChunk 不会起作用,因为它无法可靠地判断实体物品是否因区块生成而产生。一个典型的例子是 AncientWarfare 2 的结构生成。很多时候,结构的生成恰好发生在区块生成附近,因此 TidyChunk 可以清理掉遗留的物品掉落物。然而,有时结构会被生成到已存在的区块中,由于该区块早已存在,TidyChunk 将不会对其进行清理。
TidyChunk is a Minecraft Forge mod which removes EntityItems from the chunk after it has been generated. Main purpose, for me at least, is to try and cut down on the amount of crap when exploring and avoid filling up the player inventory.
The way it works is pretty straight forward. During world gen Forge posts events that TinyChunk listens for. If a new chunk is being generated it remembers that chunk. Subsequently, when an EntityItem joins the world TinyChunks cross checks the EntityItem location in it's remembered chunk list. If the item is present in one of these newly generated chunks the EntityItem is set dead and the Forge event is canceled. Net result is fewer pieces of trash in the world.
Note that this only works with chunk generated and Minecraft driven world gen. Some mods do world gen outside the normal ways Minecraft does. Under these circumstances TidyChunk does nothing because it cannot reliably determine if an EntityItem is being created because of chunk generation. A good example of this is AncientWarfare 2's structure generation. A lot of the time generation of a structure occurs right around chunk generation so TidyChunk can clean up any drops left behind. However, there are times where a structure will be generated into an existing chunk, and because the chunk has existed TidyChunk will not clean it up.
评论 0
登录后参与评分
还没有评论,来抢沙发吧