The epsilon used was in the opposite direction, which would cause
the getCollisions method to incorrectly return it for when players
were exactly on the border but not colliding. To bring it in-line
with the rest of the collision code, the collision must be into
the border by +EPSILON.
Additionally, move the setReadTimeoutHook in the server list
ping patch to a client-side mixin so it does not load in the
dedicated server causing a crash.
Change all interfaces used in mixins to have methods prefixed
with "moonrise" or "starlight", to remove risk of conflicting
with Vanilla or other mods methods
Add new patch for optimising ticking block entity removal
- Similar to Paper's patch for this but uses an in-place removal
method
Remove most of the fluid mixins:
- May not be effective, but are a big maintenance problem
Change the read timeout and connection timeout both to 5s. This
is to decrease the time to label servers as offline.
Additionally, increase the worker count for pinging servers to 128
from 5. This allows many more server pings to occur at the same time,
which allows users to scroll their serverlist.
When ChunkAccess was converted to an abstract class some versions
ago, the code to initialise nibble arrays should have been moved.
However, the code was not moved and so now mods constructing their
own implementations of ChunkAccess would not have the nibble arrays
initialised.
Fixes https://github.com/PaperMC/Starlight/issues/186
During feature generation, light data is not initialised and
will always return 15 in Starlight. Vanilla can possibly return
0 if partially initialised, which allows some mushroom blocks to
generate.
In general, the brightness value from the light engine should not
be used until the chunk is ready. To emulate Vanilla behavior better,
we return 0 as the brightness during world gen unless the target
chunk is finished lighting.
The regular light retrieval outside of WorldGenRegion remains
the same, as behaviorally chunks not lit should be at max
skylight and zero block light.
Fixes https://github.com/PaperMC/Starlight/issues/193
There is no point in initialising the sources in Starlight,
as we do not use them. Additionally, they are not saved to
disk so we do not need them.
Maintaining and initialising them is not a negligible cost,
which is why they are being removed.
The correct logic to implement NOT_SAME with Shapes#block()
is to test whether any shape data exists outside of [0.0, 1.0]
and to test whether the shape is completely filled from 0.0 to 1.0
on all axis. This can be implemented by checking whether the
bounds represent the full block and whether everything within
the bounds is filled.
The mixin targetted the getSourceContainer invocation, which failed
when the method was overwritten. Move the optimisations to use
one redirect and one inject, which don't appear to affect the
performance.
The implementation of FlatBitsetUtil#clearRange was
incorrect, as it did not properly clear long values
inbetween the range and the bitmasks for keeping the first
and last bits were off by one.
The implementation of forAllBoxes did not properly account
for multiple ranges of bits to be set on the Z direction
for a given X and Y, as it would only use the first range.
This patch optimises property updating optimisations for StateHolder
operations.
98ae59d859
Additionally, implement some basic optimisations to some BlockPos
operations.
9c4490bda4
This allows us to assume that the getChunkForCollisions
method routes to getChunk(x, z, FULL, false) which allows
us to avoid the indirection caused by different implementations
of that method on different implementations of CollisionGetter.
Ghasts teleporting can perform many voxelshape operations.
We can reduce the number of voxelshape operations and use
more efficient ones at the same time.
Need to add a hook to the section read function that only
the client calls to actually count, as the client does not
invoke recalcBlockCounts on its own.
Can't be bothered to document the other changes in this commit.