mirror of
https://github.com/taoneill/war.git
synced 2024-11-30 14:13:23 +01:00
Merge pull request #249 from Evil-Code/opsAreZonemakers
Improved code a bit :)
This commit is contained in:
commit
0132699d0e
@ -1433,8 +1433,7 @@ public class War extends JavaPlugin {
|
||||
return true;
|
||||
}
|
||||
// w/o Permissions, if buildInZonesOnly, no one can build outside the zone except Zonemakers
|
||||
if(isZoneMaker(player)) return true;
|
||||
else return false;
|
||||
return isZoneMaker(player);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@ -1455,24 +1454,24 @@ public class War extends JavaPlugin {
|
||||
}
|
||||
|
||||
public boolean isZoneMaker(Player player) {
|
||||
boolean isPlayerImpersonator = false;
|
||||
for(String disguised : zoneMakersImpersonatingPlayers) {
|
||||
if(disguised.equals(player.getName())) isPlayerImpersonator = true;
|
||||
if(disguised.equals(player.getName())) return false;
|
||||
}
|
||||
if(!isPlayerImpersonator) {
|
||||
if(player.isOp()) {
|
||||
return true;
|
||||
}
|
||||
for(String zoneMaker : zoneMakerNames) {
|
||||
if(zoneMaker.equals(player.getName())) return true;
|
||||
}
|
||||
if(War.permissionHandler != null
|
||||
&& (War.permissionHandler.has(player, "war.*")
|
||||
|| War.permissionHandler.has(player, "War.*"))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(String zoneMaker : zoneMakerNames) {
|
||||
if(zoneMaker.equals(player.getName())) return true;
|
||||
}
|
||||
if( War.permissionHandler != null
|
||||
&& (
|
||||
War.permissionHandler.has(player, "war.*")
|
||||
|| War.permissionHandler.has(player, "War.*")
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return player.isOp();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getDefaultAutoAssignOnly() {
|
||||
|
Loading…
Reference in New Issue
Block a user