mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Fix move event validation.
This commit is contained in:
parent
a5af83911d
commit
ab46992aa2
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue