Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.msgamerhd.system.rang;
- import org.bukkit.entity.Player;
- import de.whidex.permissionsystem.zeugs.PlayerUtils;
- public enum Rang {
- ADMIN("§4", "Administrator", "A", true, "admin", "001"),
- DEVELOPER("§b", "Entwickler", "E", true, "entwickler", "004"),
- PROBEDEVELOPER("§b", "Probe-Developer", "D", true, "testentwickler", "007"),
- MODERATOR("§c", "Moderator", "M", true, "moderator", "010"),
- BUILDER("§e", "Bauteam", "B", true, "bauteam", "020"),
- SUPPORTER("§2", "Supporter", "S", true, "supporter", "025"),
- PROBESUPPORTER("§2", "Probe-Supporter", "S", true, "testsupporter", "030"),
- YOUTUBER("§5", "Youtuber", "Y", true, "youtuber", "035"),
- PREMIUMPLUS("§6", "Premium+", "P+", true, "premiumplus", "040"),
- MASTER("§3", "Master", "M", true, "master", "045"),
- HELD("§d", "Held", "H", true, "held", "050"),
- PREMIUM("§6", "Premium", "P", true, "premium", "055"),
- VIP("§9", "VIP", "V", true, "vip", "060"),
- SPIELER("§a", "Spieler", "S", true, "spieler", "065");
- private String color;
- private String prefix;
- private String shortprefix;
- private boolean trennung;
- private String rangname;
- private String ordnung;
- private Rang(String color, String prefix, String shortprefix, boolean trennung, String pexname, String ordnung){
- this.color = color;
- this.prefix = prefix;
- this.shortprefix = shortprefix;
- this.trennung = trennung;
- this.rangname = pexname;
- this.ordnung = ordnung;
- }
- public String getColor(){
- return this.color;
- }
- public String getPrefix(){
- return this.color+this.prefix;
- }
- public String getShortPrefix(){
- return this.color+this.shortprefix;
- }
- public boolean getTrennung(){
- return this.trennung;
- }
- public String getRangname(){
- return this.rangname;
- }
- public String getOrdnung(){
- return this.ordnung;
- }
- public static Rang getRang(Player p) {
- for(Rang rang : values()){
- if(PlayerUtils.getPlayerGroup(p.getName().toLowerCase()).equalsIgnoreCase(rang.getRangname().toLowerCase())){
- return rang;
- }
- }
- return Rang.SPIELER;
- }
- public static Rang getRangFromName(Player p) {
- try{
- for(Rang rang : values()){
- if(p.getCustomName().startsWith(rang.getPrefix())){
- return rang;
- }
- }
- } catch (Exception d){ }
- return Rang.SPIELER;
- }
- }
Add Comment
Please, Sign In to add comment