mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 11:42:02 -07:00
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.