more audit things

This commit is contained in:
Driftay 2019-12-02 05:38:55 -05:00
parent 06d85573ba
commit d847013e39
2 changed files with 11 additions and 3 deletions

View File

@ -116,17 +116,21 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
case "faction_description":
return faction.getDescription();
case "faction_claims":
return String.valueOf(faction.getAllClaims().size());
return fPlayer.hasFaction() ? String.valueOf(faction.getAllClaims().size()) : "0";
case "faction_maxclaims":
return String.valueOf(Conf.claimedLandsMax);
case "faction_founded":
return TL.sdf.format(faction.getFoundedDate());
case "faction_joining":
return (faction.getOpen() ? TL.COMMAND_SHOW_UNINVITED.toString() : TL.COMMAND_SHOW_INVITATION.toString());
case "faction_strikes":
return fPlayer.hasFaction() ? String.valueOf(faction.getStrikes()) : "0";
case "faction_peaceful":
return faction.isPeaceful() ? Conf.colorNeutral + TL.COMMAND_SHOW_PEACEFUL.toString() : "";
case "faction_tntbank_balance":
return String.valueOf(faction.getTnt());
case "faction_points":
return String.valueOf(faction.getPoints());
return fPlayer.hasFaction() ? String.valueOf(faction.getPoints()) : "0";
case "faction_powerboost":
double powerBoost = faction.getPowerBoost();
return (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? TL.COMMAND_SHOW_BONUS.toString() : TL.COMMAND_SHOW_PENALTY.toString()) + powerBoost + ")";

View File

@ -38,7 +38,11 @@ public class FactionWarpsFrame {
GUIItems.add(new GuiItem(buildDummyItem(), e -> e.setCancelled(true)));
slots.forEach(slot -> GUIItems.set(slot, new GuiItem(XMaterial.AIR.parseItem())));
for (final Map.Entry<String, LazyLocation> warp : fplayer.getFaction().getWarps().entrySet()) {
if (count > slots.size()) continue;
if (slots.size() < fplayer.getFaction().getWarps().entrySet().size()){
slots.add(slots.get(slots.size()-1)+1);
FactionsPlugin.instance.log("Automatically setting F WARP GUI slot since slot not specified. Head config.yml and add more entries in warp-slots section.");
}
GUIItems.set(slots.get(count), new GuiItem(buildWarpAsset(warp, fplayer.getFaction()), e -> {
e.setCancelled(true);
fplayer.getPlayer().closeInventory();