summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-06-05 17:40:21 +1000
committermd_5 <git@md-5.net>2015-06-05 17:40:21 +1000
commitab46992aa218b397821caff8dba3ff8e7d470898 (patch)
tree3936bdc08283835fca2ae6f2f712e09111abe13a
parenta5af83911d4d1ea1267b256e02e080800ced298f (diff)
downloadbukkit-ab46992aa218b397821caff8dba3ff8e7d470898.tar
bukkit-ab46992aa218b397821caff8dba3ff8e7d470898.tar.gz
bukkit-ab46992aa218b397821caff8dba3ff8e7d470898.tar.lz
bukkit-ab46992aa218b397821caff8dba3ff8e7d470898.tar.xz
bukkit-ab46992aa218b397821caff8dba3ff8e7d470898.zip
Fix move event validation.
-rw-r--r--src/main/java/org/bukkit/event/player/PlayerMoveEvent.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
index 8debcda7..d56b7e40 100644
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
+++ b/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