Hello there. I currently am making a MySQL ranks system. I have ranks setup with a hashmap and enums. When the player joins, it adds the player to the hashmap with the string rank he gets from MySQL. I then check the players rank with if (p.getRank().equals(OWNER.toString()) then it would make his prefix the prefix of the rank. If you can help me make this alot simpler, how would i be able to select a enum that has a certain name? Like how would i be able to get an enum value with the name "OWNER"
@Shxke Loops enum values and compare the names. And for get a string value of an enum, use 'ENUM.name()'
Code? Also just assign each enum a string to it, or even better make your getRank method return your Rank enum. if(getRank(p).equals(Rank.OWNER)){ //do stuff }