WE FINALLY FUCKING FOUND IT
This took several years to identify because PHP's exception stack traces don't show the actual values of parameters, but rather the values of the variables they were assigned to.
This means that if the parameter variable is mutated, the exception trace will show the value of the variable inside the function, not the value that was actually passed.
sticking with the non-rewind version for now, for simplicity's sake.
We do want the rewind version at some point for server side knockback, but that's a job for later.
For now, using this packet fixes various problems with slightly-incorrect positions and rotations (e.g. AimTP no longer requires you to jump to get the exact correct rotation; previously it would hit the wrong block at long distances due to errors of a fraction of a degree due to the client not sending its position.
Note that this might cause some performance degradation since the packet is sent every tick. This has yet to be assessed, but the advantages offered are undeniable in any case.
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
this can be used to get PHPStan to shut up about stuff that will never return false in normal contexts.
It's more fine-grained than @phpstan-ignore-line and less hassle than ignoreErrors (and works in PhpStorm too).
In addition, it's easy to search for references.
we don't usually add VanillaItems entries for blocks since they already exist in VanillaBlocks, but air has a special use case specifically as an itemstack, so we make an exception for this case.
- The following classes have been added:
- `ItemMergeEvent`
- `ItemEntityStackSizeChangeAnimation`
- The following API methods have been added:
- `ItemEntity->isMergeable()`
- `ItemEntity->tryMergeInto()`
- `ItemEntity->setStackSize()`
- Added the following API methods:
- `Player::hasBlockCollision()`
- `Player::setHasBlockCollision()`
This enables spectator-like noclip behaviour in other gamemodes (could be useful for builders).