mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 03:32:46 +01:00
Fix handling of changes to PlayerVelocityEvent.velocity by event callers.
This commit is contained in:
parent
3e9b5c93d6
commit
83cb83dcd4
2 changed files with 3 additions and 3 deletions
|
@ -315,7 +315,7 @@
|
|||
+ if (event.isCancelled()) {
|
||||
+ cancelled = true;
|
||||
+ } else if (!velocity.equals(event.getVelocity())) {
|
||||
+ player.setVelocity(velocity);
|
||||
+ player.setVelocity(event.getVelocity());
|
||||
+ }
|
||||
+
|
||||
+ if (!cancelled) {
|
||||
|
|
|
@ -89,13 +89,13 @@
|
|||
+ Player player = (Player) this.tracker.getBukkitEntity();
|
||||
+ org.bukkit.util.Vector velocity = player.getVelocity();
|
||||
+
|
||||
+ PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity);
|
||||
+ PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone());
|
||||
+ this.tracker.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ cancelled = true;
|
||||
+ } else if (!velocity.equals(event.getVelocity())) {
|
||||
+ player.setVelocity(velocity);
|
||||
+ player.setVelocity(event.getVelocity());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
|
Loading…
Reference in a new issue