fixed npe for onPlayerRespawn

This commit is contained in:
Redecouverte 2011-02-26 12:00:02 +01:00
parent d02c5057c6
commit a258400443

View File

@ -260,6 +260,8 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
String spawnconfig = regions.getAreaFlag("spawn", "settings", true, null);
Location spawn = regions.getLocationAreaFlag("spawn", player.getServer(), true, null);
if (spawn != null) {
if (spawnconfig != null) {
if (spawnconfig.equals("owner")) {
if (regions.isOwner(localPlayer)) {
player.teleportTo(spawn);
@ -271,6 +273,9 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
} else {
player.teleportTo(spawn);
}
} else {
player.teleportTo(spawn);
}
}
}
}