Adding some placeholders
This commit is contained in:
parent
90d39a3974
commit
9a32cd9501
@ -73,6 +73,9 @@ public class EngineDynmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String escapeHtml(String string) {
|
public static String escapeHtml(String string) {
|
||||||
|
if (string == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
StringBuilder out = new StringBuilder(Math.max(16, string.length()));
|
StringBuilder out = new StringBuilder(Math.max(16, string.length()));
|
||||||
for (int i = 0; i < string.length(); i++) {
|
for (int i = 0; i < string.length(); i++) {
|
||||||
char c = string.charAt(i);
|
char c = string.charAt(i);
|
||||||
|
@ -49,6 +49,7 @@ public enum FactionTag implements Tag {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
PEACEFUL("{peaceful}", (fac) -> fac.isPeaceful() ? Conf.colorNeutral + TL.COMMAND_SHOW_PEACEFUL.toString() : ""),
|
PEACEFUL("{peaceful}", (fac) -> fac.isPeaceful() ? Conf.colorNeutral + TL.COMMAND_SHOW_PEACEFUL.toString() : ""),
|
||||||
PERMANENT("permanent", (fac) -> fac.isPermanent() ? "permanent" : "{notPermanent}"), // no braces needed
|
PERMANENT("permanent", (fac) -> fac.isPermanent() ? "permanent" : "{notPermanent}"), // no braces needed
|
||||||
LAND_VALUE("{land-value}", (fac) -> Econ.shouldBeUsed() ? Econ.moneyString(Econ.calculateTotalLandValue(fac.getLandRounded())) : Tag.isMinimalShow() ? null : TL.ECON_OFF.format("value")),
|
LAND_VALUE("{land-value}", (fac) -> Econ.shouldBeUsed() ? Econ.moneyString(Econ.calculateTotalLandValue(fac.getLandRounded())) : Tag.isMinimalShow() ? null : TL.ECON_OFF.format("value")),
|
||||||
@ -61,6 +62,19 @@ public enum FactionTag implements Tag {
|
|||||||
}
|
}
|
||||||
return Tag.isMinimalShow() ? null : TL.ECON_OFF.format("balance");
|
return Tag.isMinimalShow() ? null : TL.ECON_OFF.format("balance");
|
||||||
}),
|
}),
|
||||||
|
TNT_BALANCE("{tnt-balance}", (fac) -> {
|
||||||
|
if (FactionsPlugin.instance.getConfig().getBoolean("ftnt.Enabled")) {
|
||||||
|
return String.valueOf(fac.getTnt());
|
||||||
|
}
|
||||||
|
return Tag.isMinimalShow() ? null : "";
|
||||||
|
}),
|
||||||
|
TNT_MAX("{tnt-max-balance}", (fac) -> {
|
||||||
|
if (FactionsPlugin.instance.getConfig().getBoolean("ftnt.Enabled")) {
|
||||||
|
return String.valueOf(fac.getTntBankLimit());
|
||||||
|
}
|
||||||
|
return Tag.isMinimalShow() ? null : "";
|
||||||
|
}),
|
||||||
|
|
||||||
ALLIES_COUNT("{allies}", (fac) -> String.valueOf(fac.getRelationCount(Relation.ALLY))),
|
ALLIES_COUNT("{allies}", (fac) -> String.valueOf(fac.getRelationCount(Relation.ALLY))),
|
||||||
ENEMIES_COUNT("{enemies}", (fac) -> String.valueOf(fac.getRelationCount(Relation.ENEMY))),
|
ENEMIES_COUNT("{enemies}", (fac) -> String.valueOf(fac.getRelationCount(Relation.ENEMY))),
|
||||||
TRUCES_COUNT("{truces}", (fac) -> String.valueOf(fac.getRelationCount(Relation.TRUCE))),
|
TRUCES_COUNT("{truces}", (fac) -> String.valueOf(fac.getRelationCount(Relation.TRUCE))),
|
||||||
@ -80,6 +94,8 @@ public enum FactionTag implements Tag {
|
|||||||
return String.valueOf(fac.getFPlayersWhereOnline(false).size());
|
return String.valueOf(fac.getFPlayersWhereOnline(false).size());
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
FACTION_STRIKES("{faction-strikes}",(fac) -> String.valueOf(fac.getStrikes())),
|
||||||
|
FACTION_POINTS("{faction-points}", (fac) -> String.valueOf(fac.getPoints())),
|
||||||
FACTION_SIZE("{members}", (fac) -> String.valueOf(fac.getFPlayers().size())),
|
FACTION_SIZE("{members}", (fac) -> String.valueOf(fac.getFPlayers().size())),
|
||||||
FACTION_KILLS("{faction-kills}", (fac) -> String.valueOf(fac.getKills())),
|
FACTION_KILLS("{faction-kills}", (fac) -> String.valueOf(fac.getKills())),
|
||||||
FACTION_DEATHS("{faction-deaths}", (fac) -> String.valueOf(fac.getDeaths())),
|
FACTION_DEATHS("{faction-deaths}", (fac) -> String.valueOf(fac.getDeaths())),
|
||||||
|
@ -100,7 +100,7 @@ public enum FancyTag implements Tag {
|
|||||||
return tag.getMessage(text, faction, player, groupMap);
|
return tag.getMessage(text, faction, player, groupMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Collections.EMPTY_LIST; // We really shouldn't be here.
|
return Collections.emptyList(); // We really shouldn't be here.
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean anyMatch(String text) {
|
public static boolean anyMatch(String text) {
|
||||||
@ -174,7 +174,7 @@ public enum FancyTag implements Tag {
|
|||||||
return test != null && test.contains(this.tag);
|
return test != null && test.contains(this.tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FancyMessage> getMessage(String text, Faction faction, FPlayer player, Map<UUID, String> groupMap) {
|
public List getMessage(String text, Faction faction, FPlayer player, Map<UUID, String> groupMap) {
|
||||||
if (!this.foundInString(text)) {
|
if (!this.foundInString(text)) {
|
||||||
return Collections.EMPTY_LIST; // We really, really shouldn't be here.
|
return Collections.EMPTY_LIST; // We really, really shouldn't be here.
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ public enum GeneralTag implements Tag {
|
|||||||
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
|
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
|
||||||
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),
|
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),
|
||||||
MAX_TRUCES("{max-truces}", () -> getRelation("truce")),
|
MAX_TRUCES("{max-truces}", () -> getRelation("truce")),
|
||||||
FACTIONLESS("factionless", () -> String.valueOf(FPlayers.getInstance().getOnlinePlayers().stream().filter(p -> !p.hasFaction()).count())),
|
FACTIONLESS("{factionless}", () -> String.valueOf(FPlayers.getInstance().getOnlinePlayers().stream().filter(p -> !p.hasFaction()).count())),
|
||||||
FACTIONLESS_TOTAL("factionless-total", () -> String.valueOf(FPlayers.getInstance().getAllFPlayers().stream().filter(p -> !p.hasFaction()).count())),
|
FACTIONLESS_TOTAL("{factionless-total}", () -> String.valueOf(FPlayers.getInstance().getAllFPlayers().stream().filter(p -> !p.hasFaction()).count())),
|
||||||
TOTAL_ONLINE("{total-online}", () -> String.valueOf(Bukkit.getOnlinePlayers().size())),
|
TOTAL_ONLINE("{total-online}", () -> String.valueOf(Bukkit.getOnlinePlayers().size())),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user