changed namespace to com.massivecraft
This commit is contained in:
54
src/com/massivecraft/factions/struct/Relation.java
Normal file
54
src/com/massivecraft/factions/struct/Relation.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.massivecraft.factions.struct;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
|
||||
|
||||
public enum Relation {
|
||||
MEMBER(3, "member"),
|
||||
ALLY(2, "ally"),
|
||||
NEUTRAL(1, "neutral"),
|
||||
ENEMY(0, "enemy");
|
||||
|
||||
public final int value;
|
||||
public final String nicename;
|
||||
|
||||
private Relation(final int value, final String nicename) {
|
||||
this.value = value;
|
||||
this.nicename = nicename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.nicename;
|
||||
}
|
||||
|
||||
public boolean isMember() {
|
||||
return this == Relation.MEMBER;
|
||||
}
|
||||
|
||||
public boolean isAlly() {
|
||||
return this == Relation.ALLY;
|
||||
}
|
||||
|
||||
public boolean isNeutral() {
|
||||
return this == Relation.NEUTRAL;
|
||||
}
|
||||
|
||||
public boolean isEnemy() {
|
||||
return this == Relation.ENEMY;
|
||||
}
|
||||
|
||||
public ChatColor getColor() {
|
||||
if (this == Relation.MEMBER) {
|
||||
return Conf.colorMember;
|
||||
} else if (this == Relation.ALLY) {
|
||||
return Conf.colorAlly;
|
||||
} else if (this == Relation.NEUTRAL) {
|
||||
return Conf.colorNeutral;
|
||||
} else { //if (relation == FactionRelation.ENEMY) {
|
||||
return Conf.colorEnemy;
|
||||
}
|
||||
}
|
||||
}
|
34
src/com/massivecraft/factions/struct/Role.java
Normal file
34
src/com/massivecraft/factions/struct/Role.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.massivecraft.factions.struct;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
|
||||
public enum Role {
|
||||
ADMIN(2, "admin"),
|
||||
MODERATOR(1, "moderator"),
|
||||
NORMAL(0, "normal member");
|
||||
|
||||
public final int value;
|
||||
public final String nicename;
|
||||
|
||||
private Role(final int value, final String nicename) {
|
||||
this.value = value;
|
||||
this.nicename = nicename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.nicename;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
if (this == Role.ADMIN) {
|
||||
return Conf.prefixAdmin;
|
||||
}
|
||||
|
||||
if (this == Role.MODERATOR) {
|
||||
return Conf.prefixMod;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user