Add a check for whether a player can remove punishments
This commit is contained in:
parent
1ab800afb8
commit
609d77a4f2
@ -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;
|
||||||
@ -76,6 +77,16 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
|||||||
_player.openInventory(this);
|
_player.openInventory(this);
|
||||||
_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()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user