Fix handling of changes to PlayerVelocityEvent.velocity by event callers.
Dieser Commit ist enthalten in:
Ursprung
3e9b5c93d6
Commit
83cb83dcd4
@ -315,7 +315,7 @@
|
|||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ cancelled = true;
|
+ cancelled = true;
|
||||||
+ } else if (!velocity.equals(event.getVelocity())) {
|
+ } else if (!velocity.equals(event.getVelocity())) {
|
||||||
+ player.setVelocity(velocity);
|
+ player.setVelocity(event.getVelocity());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (!cancelled) {
|
+ if (!cancelled) {
|
||||||
|
@ -89,13 +89,13 @@
|
|||||||
+ Player player = (Player) this.tracker.getBukkitEntity();
|
+ Player player = (Player) this.tracker.getBukkitEntity();
|
||||||
+ org.bukkit.util.Vector velocity = player.getVelocity();
|
+ 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);
|
+ this.tracker.world.getServer().getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ cancelled = true;
|
+ cancelled = true;
|
||||||
+ } else if (!velocity.equals(event.getVelocity())) {
|
+ } else if (!velocity.equals(event.getVelocity())) {
|
||||||
+ player.setVelocity(velocity);
|
+ player.setVelocity(event.getVelocity());
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren