MineColonies

MineColonies

57M Downloads

Chunk ticket won't be released after players leave the server world with forceloadcolony enabled

Tidy-Bear opened this issue ยท 0 comments

commented

Prerequisites

  • I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
  • I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
  • I made sure that this issue is not a duplicate of any existing issue.

Context

  • Minecraft Version: 1.16.5
  • MineColonies Version: 0.14.13-BETA
  • Structurize Version: 0.13.148-ALPHA
  • Related Mods and their Versions: None

Expected behavior

Chunk with a colony should be unloaded after all players with permissions leave the server world.

Actual behavior

When related players stay away from their own colonies for more than 10 min, the chunk can be unloaded normally. However, the chunk will keep loaded if players leave the server directly.

Steps to reproduce the issue

  1. Enable forceloadcolony in the server config.
  2. Player with permissions create and activate the colony.
  3. Player leaves the server and make sure that the colony is no longer activated by other players.

Logs

None

Notes

In the game, I use /execute as @e[name="xxx"] run say hello and /data get entity @e[name="xxx",limit=1] Pos to test whether the chunk are loaded or not.
I took some time to look through the relevant code, and find that chunk ticket will be released only when state of colony is either ACTIVATE(Colony#worldTickSlow) or UNLOADED(Colony#worldTickUnloaded). In the Colony#updateState method, however, colony will soon turn into INACTIVATE if ColonyPackageManager#getCloseSubscribers and ColonyPackageManager#getImportantColonyPlayers are empty, both of which should be so when player leaves the server (EventHandler#onPlayerLeaveWorld).
At last, please excuse me for my poor English and lack of experience of using github.


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.