From dcabad78697995916272527f3f40863abc0be2a6 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 5 Jun 2015 17:40:21 +1000 Subject: [PATCH] Fix move event validation. By: md_5 --- .../main/java/org/bukkit/event/player/PlayerMoveEvent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java index 8debcda7dc..d56b7e40ae 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java @@ -64,7 +64,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { * @param from New location to mark as the players previous location */ public void setFrom(Location from) { - validateLocation(to); + validateLocation(from); this.from = from; } @@ -88,7 +88,8 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable { } private void validateLocation(Location loc) { - Preconditions.checkArgument(loc != null, "Cannot use location with null world!"); + Preconditions.checkArgument(loc != null, "Cannot use null location!"); + Preconditions.checkArgument(loc.getWorld() != null, "Cannot use null location with null world!"); } @Override