3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00

Added recommended work-around for handling player movement in such a way that it doesn't trigger the movement speed check. Thanks for the help Rigby!

Plugins are advised to no longer teleport players in the PlayerMove event and to use setTo instead, as we now trigger a teleport when setTo is used.
Dieser Commit ist enthalten in:
EvilSeph 2011-06-17 19:19:11 -04:00
Ursprung f3d25e647f
Commit b92f54639a

Datei anzeigen

@ -139,8 +139,18 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
server.getPluginManager().callEvent(event);
from = event.getFrom();
to = event.isCancelled() ? from : event.getTo();
// If the event is cancelled we move the player back to their old location.
if (event.isCancelled()) {
to = from;
}
/* If a Plugin has changed the To destination then we teleport the Player
there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
We only do this if the Event was not cancelled. */
if (!to.equals(event.getTo()) && !event.isCancelled()) {
((CraftPlayer) this.player.getBukkitEntity()).teleport(event.getTo());
return;
}
this.player.locX = to.getX();
this.player.locY = to.getY();