Commit Graph

17 Commits

Author SHA1 Message Date
Spottedleaf
2da91fa536 Fix VoxelShape#isFullBlock() for non-single AABB types
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.
2023-10-13 03:50:05 -07:00
Spottedleaf
01f9a87d15 Update to 1.20.2 2023-10-13 03:46:04 -07:00
Spottedleaf
dd01bf7bc7 Fix mixin conflict for fabric transfer api in hopper optimisations
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.
2023-09-19 11:43:51 -07:00
Spottedleaf
2b63a849d3 Fix CachedToAABBs when offset becomes zero
If the offset were to be undone, then it would incorrectly mark the
cache as not having an offset when it actually did.
2023-09-19 11:40:19 -07:00
Spottedleaf
c7fea2e95d Change getSeenFraction to return float
Vanilla uses float here, so it may change behaviorly slightly
by using more precision.
2023-09-13 13:44:54 -07:00
Spottedleaf
5f11d81b11 Fix NPE in clipsAnything at world height
If the block is out of bounds, then the block state may
be null.
2023-09-13 13:36:14 -07:00
Spottedleaf
fcc3b02a54 Fix incorrect Entity#isInWall() mixin
The VoxelShapes retrieved need to be offset for the
intersection checks.
2023-09-12 07:12:37 -07:00
Spottedleaf
b8935d1dd1 Fix incorrect forAllBoxes implementation
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.
2023-09-10 17:52:07 -07:00
Spottedleaf
a1e89e9515 Add ZeroCollidingReferenceStateTable for StateHolder property operations
This patch optimises property updating optimisations for StateHolder
operations.

98ae59d859

Additionally, implement some basic optimisations to some BlockPos
operations.

9c4490bda4
2023-09-09 06:02:30 -07:00
Spottedleaf
c4aa0cc0aa Move findSupportingBlock to LevelMixin
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.
2023-09-04 16:49:39 -07:00
Spottedleaf
13ce46a086 Optimise BitSetDiscreteVoxelShape#forAllBoxes
This should speed up general shape joining, as VoxelShape#optimize()
uses this method when performing an uncached toAabbs()
2023-09-04 16:14:33 -07:00
Spottedleaf
dc20d1a144 Optimise findFreePosition
Ghasts teleporting can perform many voxelshape operations.
We can reduce the number of voxelshape operations and use
more efficient ones at the same time.
2023-09-01 15:15:03 -07:00
Spottedleaf
48043cd406 Hopper optimisations 2023-08-27 02:20:06 -07:00
Spottedleaf
e19f6a8796 Offset first input to unique id calculation
So that the first murmurHash3 call is unique
2023-08-20 17:19:46 -07:00
Spottedleaf
716342c922 Fix incorrect specialCollidingBlocks calculation clientside
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.
2023-08-20 15:56:24 -07:00
Spottedleaf
d4248d54bb Fix bad particle light colouring
Swapped the light variables by accident
2023-08-12 03:42:39 -07:00
Spottedleaf
7c753abdb6 Initial Commit 2023-08-11 00:22:07 -07:00