Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 21:10:10 +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:
Ursprung
f3d25e647f
Commit
b92f54639a
@ -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();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren