Note: This cannot happen on the Fabric/NeoForge versions since
async ticket level processing is not allowed, but can happen on
Paper. This change is made here so that Paper can
remain in sync.
Ticket level decreases may be handled asynchronously when the
off-thread invokes processTicketUpdates() when the main thread
is running ChunkHolderManager#tick(). This is because the ticket
update is queued during tick(), but not executed (invoking
processTicketUpdates) until after releasing the ticket lock.
This creates a small window for an off-thread to invoke
processTicketUpdates() and steal the update.
When the update is stolen, the full chunk status update (if any)
will be eventually queued to execute via the chunk task queue.
If the chunk queue is processed during the server tick at any
point other than the ChunkHolderManager tick, then any ticket
level decrease will violate an important invariant in the
Moonrise chunk system: ticket level decreases only occur during
ChunkHolderManager tick. This invariant exists to make interfacing
with the chunk system easier, especially working with off-thread
contexts.
This change is specifically made to work towards fixing
https://github.com/PaperMC/Folia/issues/363
Vanilla does not increment ticket timeouts if the chunk is
progressing in generation. They made this change in 1.21.6
so that the ender pearl ticket does not expire if the chunk
fails to generate before the timeout expires. Rather than
blindly adjusting the entire system behavior to fix this
small issue, we instead add non-expirable tickets to keep
ender pearls ticking.
We are awaiting cloth config for a release.
We also need to make a fix for MC-297591, as we revert Mojang's solution.
Mojang's solution makes the rest of the chunk system's timing with
tickets unpredictable, which is almost certainly too large of a change
on its own. Surely, the ender pearl code could be modified to fix
this properly.
If an exception is thrown during decompress then the read process
would be started again, which of course would eventually throw in
the decompress process.
1. Use the provided ticket's identifier when routing to the new
chunk system. Not needed in Moonrise but Paper may set the
identifier.
2. Mark TicketStorage as dirty after ticking it
VoxelShape coordiantes generally are an integer + a sum of powers of
two between [-1, -3]. Most offsets are generally an integer. As
a result, applying an offset to the coordinates generally results
in an error of 0. However, coordinate inputs do not follow such
trends. Thus, when applying an offset to the coordinate input,
there may be some floating point error.
By applying the offset to the VoxelShape coordinates, we can
eliminate additional floating point error.
This change also fixes the inconsistency when using
the single AABB, as input coordinates were not offset
when using the single AABB as the single AABB is already
offset.
Fixes https://github.com/Tuinity/Moonrise/issues/81
This specific issue is caused by floating point error resulting
in the falling anvil's y position becoming around -8E-17 when it
should be 0.
While this is still very comfortably in the collision
epsilon (1.0E-7), this results in the falling anvil's y block
position to become -1 (as the block position is simply
the floor of the coordinate).
* Use YamlConfig from Paper repo
* Add comment to settings
* Use ConcurrentUtil from Paper repo and use release of YamlConfig
* Use ConcurrentUtil release