mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 10:05:59 +00:00
[Bleeding] Cleaned up TFM_Command.senderHasPermission()
This commit is contained in:
parent
22b0781020
commit
00e9b4ea1f
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user