mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Fix NPE when leaving dungeons; resolves #546
This commit is contained in:
parent
0339ee5763
commit
820527ea28
@ -41,6 +41,9 @@ public class RespawnTask extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
if (player.getWorld() != location.getWorld() || player.getLocation().distance(location) > 2) {
|
||||
PlayerUtil.secureTeleport(player, location);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class WorldUnloadTask extends BukkitRunnable {
|
||||
Set<DInstanceWorld> instances = plugin.getDWorldCache().getInstances();
|
||||
for (DInstanceWorld instance : instances.toArray(new DInstanceWorld[instances.size()])) {
|
||||
if (instance.exists()) {
|
||||
if (instance.getWorld().getPlayers().isEmpty()) {
|
||||
if (instance.getPlayers().isEmpty()) {
|
||||
instance.delete();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user