* Change min/max section optimisations
* Correctly init dimension type
We need to initialise the field as early as possible in the constructor
to avoid problems.
Also, do not cache min/max section in EntityLookup. Note that mods
that implement worlds with variable heights will not work still,
as the entity slices expect a fixed height.
* Cache calculated height values
---------
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
We can use a simple array lookup table by palette id when the
number of palette entries is low. This eliminates the need for
the map lookup on each entry.
It appears that this call is very expensive. We instead substitute
an exact check with setting the special colliding blocks to whether
the palette initially contains a special colliding block, and after
on block updating by whether any special colliding block was set.
If the relative distance is 0, then we would return the current
instance - which may be a mutable instance. However, Vanilla overrides
the relative function to return an immutable instance even when
the distance is zero. To ensure that this behavior is kept, we return
an immutable instance when the distance is zero.
Not all broadcast chunks are ticking in the new chunk system,
so we need to track them separately to ensure updates take place
in non-simulation range chunks.
By only iterating over chunks that are both ticking AND near players
or marked for ticking, we can reduce the number of chunks to iterate
over in higher SD settings.
Use of a map for category->count is inefficient as the key
is an enum. We can use a simple int array, which reduces
the get() and compute() calls to an array access.
ChunkData is stored directly on chunk holders, entity slices,
and on entities. Currently, this allows access to
NearbyPlayers$TrackedChunk without performing a map lookup.
Use an inject instead of overwrite to avoid mixin conflicts - obviously this will still disregard any changes made by other
mixins, but at least it won't conflict immediately. This is useful because some library mods mixin here when only the content
mod actually needs the change.
Fixes incompatibility with CreativeCore but not LittleTiles
Some mods rely on data initialized in their fluid subclass constructor for the methods we call, which won't be available at the superclass constructor return.
Injecting into the registry add is a little ugly, but should be fine.
Fixes compat with Immersive Engineering.
Newer NeoForge has moved their coremods from JS to Java, which should slightly improve startup times (as the JS engine won't load without another mod that uses it), making this update relevant for development