this makes them more recognizable, and also fixes#4630.
This is technically a BC break (behavioural change), but since nothing appears to use this functionality anyway except PM itself, I don't think it matters.
Fixes#4589
The following API methods are added:
- `XpManager->canAttractXpOrbs()`
- `XpManager->setCanAttractXpOrbs()`
Possible future scope: flip this on its head to allow spectator players to attract XP orbs, in case someone wants that for some reason ???
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
closes#4646closes#4645
Impact assessment by core usage search and poggit suggests that the impact of this change will be close to zero.
However, since it changes behaviour which plugins might be unknowingly relying on, it's going into 4.1 rather than a patch release.
this was caused by 083a1e1ff6b6ff5c0c1ba14250d2b026af103b90.
This was discovered by a new PHPStan rule I'm working on, which disallows overwriting the values of parameter variables. During the refactor of this function to correct the error, another error appeared: Variable might not be defined.
This is yet another excellent example of why mutability is bad.
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.