Add a check for whether a player can remove punishments

This commit is contained in:
Alexander Meech 2016-12-06 20:51:34 -05:00 committed by cnr
parent 1ab800afb8
commit 609d77a4f2

View File

@ -17,6 +17,7 @@ import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.punish.Category; import mineplex.core.punish.Category;
import mineplex.core.punish.Punish; import mineplex.core.punish.Punish;
import mineplex.core.punish.PunishClient; import mineplex.core.punish.PunishClient;
@ -77,6 +78,16 @@ public class PunishPage extends CraftInventoryCustom implements Listener
_plugin.registerEvents(this); _plugin.registerEvents(this);
} }
public boolean canUnban(boolean inform)
{
boolean able = _plugin.GetClients().Get(_player).GetRank().has(Rank.ADMIN);
if (inform && !able)
{
UtilPlayer.message(_player, F.main("Punish", "You do not have permission to remove punishments!"));
}
return able;
}
private void BuildPage() private void BuildPage()
{ {
// Player head // Player head