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
The caller would block indefinitely if a sync load is requested
during shutdown. Rather than block indefinitely, we should throw
an exception to indicate to the caller that the chunk system is
unable to process requests.
1. For NearbyPlayers, we need to be using the view distance, and
not the load distance (which is +1 of the view distance).
2. Correctly clamp tick distance to view distance. Since
load distance is +1 of view distance, we need to subtract
one from the load distance when clamping.
Additionally, add checks inside ViewDistances to ensure that
the inputs are in range to catch future errors.
Our previous hack did not actually catch every case. For now,
it will only assume a constant collision shape of EMPTY for
air blocks.
Fixes https://github.com/PaperMC/Paper/issues/11697
ThreadUnsafeRandom is a random implementation that is
identical to LegacyRandomSource behaviourally, but
without the thread checks.
SimpleThreadUnsafeRandom is ThreadUnsafeRandom except with
its nextInt(int) function replaced with a faster
but more biased implementation when bound is very large.