Add name, icon, max sev, and permission to Category enum

This commit is contained in:
Spencer 2018-01-02 17:11:12 -05:00 committed by Alexander Meech
parent 8a16b419c4
commit f6e0174c70

View File

@ -1,17 +1,53 @@
package mineplex.core.punish;
import org.bukkit.Material;
import mineplex.core.account.permissions.Permission;
public enum Category
{
ChatOffense,
Advertisement, // No longer used
Exploiting, // General Offense
Hacking, // Illegal Mods
Warning,
PermMute,
ReportAbuse, // Abusing /report command
Other; // Represents perm ban - (or old perm mutes)
public static boolean contains(String s)
ChatOffense("Chat", Material.BOOK_AND_QUILL, 3, Punish.Perm.PUNISHMENT_COMMAND),
Exploiting("Gameplay", Material.HOPPER, 1, Punish.Perm.PUNISHMENT_COMMAND), // General Offense
Hacking("Hacking", Material.IRON_SWORD, 3, Punish.Perm.PUNISHMENT_COMMAND), // Illegal Mods
Warning("Warning", Material.PAPER, 1, Punish.Perm.PUNISHMENT_COMMAND),
PermMute("Permanent Mute", Material.BOOK_AND_QUILL, 1, Punish.Perm.FULL_PUNISHMENT_ACCESS),
ReportAbuse("Report Ban", Material.ENCHANTED_BOOK, 1, Punish.Perm.REPORT_BAN_ACCESS), // Abusing /report command
Other("Permanent Ban", Material.REDSTONE_BLOCK, 1, Punish.Perm.FULL_PUNISHMENT_ACCESS); // Represents perm ban - (or old perm mutes)
String _name;
Material _icon;
int _maxSeverity;
Permission _neededPermission;
Category(String name, Material icon, int maxSeverity, Permission neededPermission)
{
_name = name;
_icon = icon;
_maxSeverity = maxSeverity;
_neededPermission = neededPermission;
}
public String getName()
{
return _name;
}
public Material getIcon()
{
return _icon;
}
public int getMaxSeverity()
{
return _maxSeverity;
}
public Permission getNeededPermission()
{
return _neededPermission;
}
public static boolean contains(String s)
{
try
{