[SPIGOT-3747] Provide API to force PlayerChunk staying loaded Created: 07/Jan/18  Updated: 28/Dec/18  Resolved: 27/Dec/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Donald Duck Assignee: Unassigned
Resolution: Fixed Votes: 3
Labels: None


 Description   

There are plugins that keep chunks loaded. This, however, does not help when trying to keep crop farms operational when players log off or move far away. The reason for this is that random block ticks are sent only to blocks in chunks within server view distance from any logged-in player. The PlayerChunkMap manages these chunks.

An API extension should exist that can be used to mark a PlayerChunk as to remain "ticking" which would then make the PlayerChunkMap retain such PlayerChunk objects despite all players being removed from it. Resetting such property shall cause the PlayerChunk to be dropped from the PlayerChunkMap.



 Comments   
Comment by Donald Duck [ 28/Dec/18 ]

When I looked at the code as I implemented TickChunks it seemed to me that there were two "levels" of "activity" for a chunk. Being loaded seemed to mean that some basic mechanics such as moving a minecart passing through, or computing redstone logic, is happening. However, other aspects require a chunk to be ticked, in particular the growth of any weeds.

I had been developing TickChunks in particular as an option to have farms continue to work while no player was logged on. The KeepChunks plugin didn't provide this, despite keeping the respective chunks loaded.

This is why I presume that the force-load approach doesn't really cut it.

Comment by md_5 [ 28/Dec/18 ]

I’m not sure of the exact behaviour.
I presume within CraftBukkit some form of ticking takes place otherwise there would be little reason for /forceload to exist

Comment by Donald Duck [ 28/Dec/18 ]

Without having looked into the 1.13 additions regarding force-loading of chunks, how does this relate to the more crucial ticking of chunks?

 

Comment by md_5 [ 27/Dec/18 ]

Added using new 1.13 features

Comment by Julia Fox [ 01/Sep/18 ]

Use a Reflector and use the native code, I don't ever see this being a thing the API adds because its too critical?

Comment by Fayti1703 [ 24/Aug/18 ]

Since there is now vanilla behavior in 1.13.1 for keeping chunks loaded via the /forceload command, it may be worth revisiting this.

Comment by Donald Duck [ 08/Jan/18 ]

Update: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/78/overview.

https://github.com/axeluhl/TickChunks has a plug-in that uses / demonstrates this extension.

Comment by Donald Duck [ 07/Jan/18 ]

I've created https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/76/overview.

Comment by Donald Duck [ 07/Jan/18 ]

I'm now working on such feature, together with the Plugin described by PLUG-274. Please expect a pull request over the next few days, once I managed to work my way through Spigot patch generation. Should this bug be assigned to myself?

Generated at Tue Apr 22 05:22:32 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.