mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +01:00
fixed npe for onPlayerRespawn
This commit is contained in:
parent
d02c5057c6
commit
a258400443
@ -260,17 +260,22 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
|
|||||||
String spawnconfig = regions.getAreaFlag("spawn", "settings", true, null);
|
String spawnconfig = regions.getAreaFlag("spawn", "settings", true, null);
|
||||||
Location spawn = regions.getLocationAreaFlag("spawn", player.getServer(), true, null);
|
Location spawn = regions.getLocationAreaFlag("spawn", player.getServer(), true, null);
|
||||||
|
|
||||||
if (spawnconfig.equals("owner")) {
|
if (spawn != null) {
|
||||||
if (regions.isOwner(localPlayer)) {
|
if (spawnconfig != null) {
|
||||||
|
if (spawnconfig.equals("owner")) {
|
||||||
|
if (regions.isOwner(localPlayer)) {
|
||||||
|
player.teleportTo(spawn);
|
||||||
|
}
|
||||||
|
} else if (spawnconfig.equals("member")) {
|
||||||
|
if (regions.isMember(localPlayer)) {
|
||||||
|
player.teleportTo(spawn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.teleportTo(spawn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
player.teleportTo(spawn);
|
player.teleportTo(spawn);
|
||||||
}
|
}
|
||||||
} else if (spawnconfig.equals("member")) {
|
|
||||||
if (regions.isMember(localPlayer)) {
|
|
||||||
player.teleportTo(spawn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
player.teleportTo(spawn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user