If the player dies, then they are removed from the world and
as a result are not present in the world entity map.
To guarantee that the player entity scheduler is ticked, we can
tick all schedulers for players in the server player list, and
then skip all players we find in the world entity map.
This problem is not present on Folia since Folia must guarantee
that the player remains in the world.
The ServerLevel#getAllEntities function only returns entities which
are accessible. FeatureHooks#getAllEntities will return all
entities, whether or not they are accessible.
Use the new hook in the EntityCommand, which allows server admins
to inspect entities in unloaded chunks.
Use the hook as well for ticking the EntityScheduler. This fixes
an issue whether unloaded entities did not have their scheduler ticked.
Send more keepalives, record all transactions within the last minute.
We send more keepalives so that the latency calculation is more
accurate. Since we send more keepalives, we track all pending
keepalives in case multiple end up in flight.
Additionally, replace the latency calculation with a true
average over the last 5 seconds of keepalive transactions.
We add the change to guarantee that the player position moves
in-sync with the vehicle's. As a result, it should be teleporting
the player using the new position of the vehicle rather than the
old.
Ports the follow commits from spigot to paper.
All credits to go the respective commit authors listed below.
CraftBukkit: 3b4fd5b321f4440a2b3a67f3945739b45e6e687f
By: md_5 <git@md-5.net>
The exit location passed to PlayerTeleportEvent/PlayerTeleportEndGatewayEvent in ServerPlayer#teleport(TeleportTransition) needs to be cloned, as it is later compared in case it was changed. Not cloning it results in the ability for plugins to mutate it but such changes will be ignored, as the instance of the Location being the same results in a successful equality check.
It is not necessary to clone the location in other instantiations of the event (or subclasses) as those are not compared afterwards to change the outcome.
* CraftServerTickManager - silence feedback when sprinting
* CraftServerTickManager - forgot secondary note
* ServerTickRateManager - only set to silent if not already sprinting
Set the old pos/rot to be the same as the current pos/rot for new
entities as the default value for the old pos/rot is zero.
Fixes https://github.com/PaperMC/Folia/issues/302
While the running server will still be using the recently introduced
copy-mechanic for vanilla command namespacing, the data converter logic
relies on the fact that namespaced aliases were redirects as well.
To not break the converted, the commands type now takes a modern flag
only set by the running server.