[Bleeding] Cleaned up TFM_Command.senderHasPermission()

This commit is contained in:
unknown 2014-04-21 14:56:24 +02:00
parent 22b0781020
commit 00e9b4ea1f

View File

@ -85,47 +85,52 @@ public abstract class TFM_Command
{ {
return false; return false;
} }
else if (level == AdminLevel.SENIOR && !isSenior)
if (level == AdminLevel.SENIOR && !isSenior)
{ {
return false; return false;
} }
else if (blockHostConsole && TFM_Util.isFromHostConsole(commandSender.getName()))
if (blockHostConsole && TFM_Util.isFromHostConsole(commandSender.getName()))
{ {
return false; return false;
} }
return true;
} }
else
{ final Player senderPlayer = (Player) commandSender;
final Player sender_p = (Player) commandSender;
if (source == SourceType.ONLY_CONSOLE) if (source == SourceType.ONLY_CONSOLE)
{ {
return false; return false;
} }
else if (level == AdminLevel.SENIOR)
if (level == AdminLevel.SENIOR)
{ {
if (isSenior) if (!isSenior)
{
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(sender_p);
if (!playerdata.isSuperadminIdVerified())
{ {
return false; return false;
} }
}
else if (!TFM_PlayerData.getPlayerData(senderPlayer).isSuperadminIdVerified())
{ {
return false; return false;
} }
return true;
} }
else if (level == AdminLevel.SUPER && !isSuper)
if (level == AdminLevel.SUPER && !isSuper)
{ {
return false; return false;
} }
else if (level == AdminLevel.OP && !sender_p.isOp())
if (level == AdminLevel.OP && !senderPlayer.isOp())
{ {
return false; return false;
} }
}
return true; return true;
} }