It may be possible to invoke moonrise$getRawPalette before
the palette's single value is initialised, so we need to track
the returned raw palette array.
1. Need a better solution for EntityMixin block/fire collision
2. Fixed inconsistent Vanilla behavior for ExplosionMixin
Mostly revolved around the explosion intensity calculator,
as well as the damage calculator
3. Optimise ExplosionMixin to not call getSeenPercent twice,
which is a new "feature" of 1.21
4. Optimise VoxelShapeMixin#toAabbsUncached()
The regular forAllBoxes method on VoxelShape will incur
indirection costs due to the virtual method invoke on
the coordinate retrieval as well as on the consumer itself
If the server tick length is high, then the amount of time
available to process chunk tasks inbetween ticks is low. As a
result, chunk loading and generation may appear to slow down.
To ensure that chunk tasks are always processed, we add logic to
execute chunk tasks during tile entity tick, entity tick, chunk
random ticking, and scheduled block/fluid ticking. The mid-tick task
execution is timed so that it is not prioritised over the server
tick.
To ensure that a single world does not eat up allocated
processing time for tasks, execute tasks for all worlds
before returning from pollTaskInternal().
While the null UUID is almost certainly an error, the old
implementation did not NPE as it used a plain HashMap for lookup
by UUID, whereas we use a ConcurrentHashMap which will NPE on
null keys.
The unload queue stored the chunks in the same section as
the chunk coordinate, when it needed to apply the unload shift.
Additionally, change the default region shift to the ticket
propagator shift as there is no benefit to using a low region
shift since no regionizing is occuring. This makes the unload
queue shift 6, which should reduce the number of sections to deal
with while processing unloads.
They should be less fragile for breakages.
Additionally, modify PoiManagerMixin to work around an issue where
our getOrCreate() method is not being invoked _because_ its return
type was PoiSection and not Object. Apparently, the JVM will search
the superclass when a direct match (params+return type) is not found.
The full chunk map should mirror immediately the
full chunk status, so it should be added immediately after
upgrading to FULL or removed immediately before downgrading to
INACCESSIBLE.
Implementations for ChunkStatuses below FULL are supposed to always
return ProtoChunk instances. However, since we used the last completed
status, it could return LevelChunk.
To resolve this, follow Vanilla behavior of tracking chunk
completions by status and replace old ProtoChunk statuses with
ImposterProtoChunk when the chunk generates to FULL.
Additionally, implement an optimisation for retrieving full chunks
by storing a map of pos -> LevelChunk. This requires only a simple
map lookup to occur for full chunks which are loaded.
This allows us to have safe off-thread reads, as we can guarantee
that the palette is associated with the data (which is why
a Data container is used in the first place).
This allows us to use them for chunk rendering, which
should reduce competition between the background executor pool
and the chunk system for cpu resources.
Palette has 4 implementations: global, hash, linear, and single.
When only one implementation is being used (i.e all chunks
loaded have sections with linear palette) the JIT can optimise
the call to #valueFor quite well. When there are two implementations
(i.e hash, linear) the JIT can still optimise the call but at a
slight cost.
However, when there are three or more in use
(i.e linear, hash, single/global) the JIT cannot
optimise the call and must revert to an interface invoke - which
is terribly slow.
In order to optimise this, we can extract an array for
the hash, linear, and single palette implementations and
perform lookups on the array directly instead of invoking
The light tasks may allocate a light engine themselves, and as a
result increase memory usage. We can avoid these allocations
by only allocating the instances for block changes and releasing
immediately after.