Fixed NPE for Setproximitylocation

This commit is contained in:
alisolarflare 2016-12-17 08:29:40 -05:00
parent 4bc40f6aeb
commit 8e805745b5

View file

@ -31,14 +31,21 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{
PlayerProximityLoop.sY = location.getBlockY();
PlayerProximityLoop.sZ = location.getBlockZ();
PlayerProximityLoop.startLocation = location;
PlayerProximityLoop.endLocation.setWorld(location.getWorld());
if (endLocation == null)
PlayerProximityLoop.endLocation = location;
else
PlayerProximityLoop.endLocation.setWorld(location.getWorld());
}
public static void setEndLocation(Location location){
PlayerProximityLoop.eX = location.getBlockX();
PlayerProximityLoop.eY = location.getBlockY();
PlayerProximityLoop.eZ = location.getBlockZ();
PlayerProximityLoop.startLocation.setWorld(location.getWorld());
PlayerProximityLoop.endLocation = location;
if (endLocation == null)
PlayerProximityLoop.endLocation = location;
else
PlayerProximityLoop.endLocation.setWorld(location.getWorld());
}
@Override