Fixed Indents on all files using the reformat option and optimized imports

This commit is contained in:
Liz3
2019-03-03 04:51:21 +01:00
parent bb7d32bb92
commit c6512bf316
232 changed files with 26900 additions and 26895 deletions

View File

@@ -11,101 +11,101 @@ import org.bukkit.ChatColor;
public class RelationUtil {
public static String describeThatToMe(RelationParticipator that, RelationParticipator me, boolean ucfirst) {
String ret = "";
public static String describeThatToMe(RelationParticipator that, RelationParticipator me, boolean ucfirst) {
String ret = "";
Faction thatFaction = getFaction(that);
if (thatFaction == null) {
return "ERROR"; // ERROR
}
Faction thatFaction = getFaction(that);
if (thatFaction == null) {
return "ERROR"; // ERROR
}
Faction myFaction = getFaction(me);
Faction myFaction = getFaction(me);
// if (myFaction == null) return that.describeTo(null); // no relation, but can show basic name or tag
if (that instanceof Faction) {
if (me instanceof FPlayer && myFaction == thatFaction) {
ret = TL.GENERIC_YOURFACTION.toString();
} else {
ret = thatFaction.getTag();
}
} else if (that instanceof FPlayer) {
FPlayer fplayerthat = (FPlayer) that;
if (that == me) {
ret = TL.GENERIC_YOU.toString();
} else if (thatFaction == myFaction) {
ret = fplayerthat.getNameAndTitle();
} else {
ret = fplayerthat.getNameAndTag();
}
}
if (that instanceof Faction) {
if (me instanceof FPlayer && myFaction == thatFaction) {
ret = TL.GENERIC_YOURFACTION.toString();
} else {
ret = thatFaction.getTag();
}
} else if (that instanceof FPlayer) {
FPlayer fplayerthat = (FPlayer) that;
if (that == me) {
ret = TL.GENERIC_YOU.toString();
} else if (thatFaction == myFaction) {
ret = fplayerthat.getNameAndTitle();
} else {
ret = fplayerthat.getNameAndTag();
}
}
if (ucfirst) {
ret = TextUtil.upperCaseFirst(ret);
}
if (ucfirst) {
ret = TextUtil.upperCaseFirst(ret);
}
return "" + getColorOfThatToMe(that, me) + ret;
}
return "" + getColorOfThatToMe(that, me) + ret;
}
public static String describeThatToMe(RelationParticipator that, RelationParticipator me) {
return describeThatToMe(that, me, false);
}
public static String describeThatToMe(RelationParticipator that, RelationParticipator me) {
return describeThatToMe(that, me, false);
}
public static Relation getRelationTo(RelationParticipator me, RelationParticipator that) {
return getRelationTo(that, me, false);
}
public static Relation getRelationTo(RelationParticipator me, RelationParticipator that) {
return getRelationTo(that, me, false);
}
public static Relation getRelationTo(RelationParticipator me, RelationParticipator that, boolean ignorePeaceful) {
Faction fthat = getFaction(that);
Faction fme = getFaction(me);
public static Relation getRelationTo(RelationParticipator me, RelationParticipator that, boolean ignorePeaceful) {
Faction fthat = getFaction(that);
Faction fme = getFaction(me);
if (fthat == null || fme == null) {
return Relation.NEUTRAL; // ERROR
}
if (fthat == null || fme == null) {
return Relation.NEUTRAL; // ERROR
}
if (!fthat.isNormal() || !fme.isNormal()) {
return Relation.NEUTRAL;
}
if (!fthat.isNormal() || !fme.isNormal()) {
return Relation.NEUTRAL;
}
if (fthat.equals(fme)) {
return Relation.MEMBER;
}
if (fthat.equals(fme)) {
return Relation.MEMBER;
}
if (!ignorePeaceful && (fme.isPeaceful() || fthat.isPeaceful())) {
return Relation.NEUTRAL;
}
if (!ignorePeaceful && (fme.isPeaceful() || fthat.isPeaceful())) {
return Relation.NEUTRAL;
}
if (fme.getRelationWish(fthat).value >= fthat.getRelationWish(fme).value) {
return fthat.getRelationWish(fme);
}
if (fme.getRelationWish(fthat).value >= fthat.getRelationWish(fme).value) {
return fthat.getRelationWish(fme);
}
return fme.getRelationWish(fthat);
}
return fme.getRelationWish(fthat);
}
public static Faction getFaction(RelationParticipator rp) {
if (rp instanceof Faction) {
return (Faction) rp;
}
public static Faction getFaction(RelationParticipator rp) {
if (rp instanceof Faction) {
return (Faction) rp;
}
if (rp instanceof FPlayer) {
return ((FPlayer) rp).getFaction();
}
if (rp instanceof FPlayer) {
return ((FPlayer) rp).getFaction();
}
// ERROR
return null;
}
// ERROR
return null;
}
public static ChatColor getColorOfThatToMe(RelationParticipator that, RelationParticipator me) {
Faction thatFaction = getFaction(that);
public static ChatColor getColorOfThatToMe(RelationParticipator that, RelationParticipator me) {
Faction thatFaction = getFaction(that);
if (thatFaction != null && thatFaction != getFaction(me)) {
if (thatFaction.isPeaceful())
return Conf.colorPeaceful;
else if (thatFaction.isSafeZone())
return Conf.colorPeaceful;
else if (thatFaction.isWarZone())
return Conf.colorWar;
}
if (thatFaction != null && thatFaction != getFaction(me)) {
if (thatFaction.isPeaceful())
return Conf.colorPeaceful;
else if (thatFaction.isSafeZone())
return Conf.colorPeaceful;
else if (thatFaction.isWarZone())
return Conf.colorWar;
}
return getRelationTo(that, me).getColor();
}
return getRelationTo(that, me).getColor();
}
}