mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-05 09:36:19 +00:00
4daa2a2b6a
Minecraft sometimes keeps chunks in-memory, but not actively loaded. If we schedule a block entity to be ticked and that chunk is is then transitioned to this partially-loaded state, then the block entity is never actually ticked. This is most visible with monitors. When a monitor's contents changes, if the monitor is not already marked as changed, we set it as changed and schedule a tick (see ServerMonitor). However, if the tick is dropped, we don't clear the changed flag, meaning subsequent changes don't requeue the monitor to be ticked, and so the monitor is never updated. We fix this by maintaining a list of block entities whose tick was dropped. If these block entities (or rather their owning chunk) is ever re-loaded, then we reschedule them to be ticked. An alternative approach here would be to add the scheduled tick directly to the LevelChunk. However, getting hold of the LevelChunk for unloaded blocks is quiet nasty, so I think best avoided. Fixes #1146. Fixes #1560 - I believe the second one is a duplicate, and I noticed too late :D. |
||
---|---|---|
.. | ||
src | ||
build.gradle.kts |