Added shield status placeholder
This commit is contained in:
@@ -4,9 +4,13 @@ import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.shields.struct.ShieldTCMP;
|
||||
import com.massivecraft.factions.cmd.shields.struct.tasks.ShieldManagement;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.util.timer.DateTimeFormats;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
@@ -36,6 +40,11 @@ public enum FactionTag implements Tag {
|
||||
JOINING("{joining}", (fac) -> (fac.getOpen() ? TL.COMMAND_SHOW_UNINVITED.toString() : TL.COMMAND_SHOW_INVITATION.toString())),
|
||||
FACTION("{faction}", (Function<Faction, String>) Faction::getTag),
|
||||
FACTION_RELATION_COLOR("{faction-relation-color}", (fac, fp) -> fp == null ? "" : fp.getColorTo(fac).toString()),
|
||||
SHIELD_STATUS("{shield-status}",(fac) -> {
|
||||
if(fac.isProtected() && fac.getShieldFrame() != null) return String.valueOf(TL.SHIELD_CURRENTLY_ENABLE);
|
||||
if(fac.getShieldFrame() == null) return String.valueOf(TL.SHIELD_NOT_SET);
|
||||
return TL.SHIELD_CURRENTLY_NOT_ENABLED.toString();
|
||||
}),
|
||||
HOME_WORLD("{world}", (fac) -> fac.hasHome() ? fac.getHome().getWorld().getName() : Tag.isMinimalShow() ? null : "{ig}"),
|
||||
RAIDABLE("{raidable}", (fac) -> {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("hcf.raidable", false)) {
|
||||
|
||||
@@ -1254,6 +1254,10 @@ public enum TL {
|
||||
PLAYER_PVP_NEUTRALFAIL("You can't hurt %s in their own territory unless you declare them as an enemy."),
|
||||
PLAYER_PVP_TRIED("%s tried to hurt you."),
|
||||
|
||||
SHIELD_CURRENTLY_ENABLE("&a&lCurrently Protected"),
|
||||
SHIELD_NOT_SET("&c&lNot Set"),
|
||||
SHIELD_CURRENTLY_NOT_ENABLED("&c&lCurrently Unprotected"),
|
||||
|
||||
/**
|
||||
* Strings lying around in other bits of the plugins
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.massivecraft.factions.zcore.util;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.shields.struct.tasks.ShieldManagement;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.util.timer.TimerManager;
|
||||
import org.apache.commons.lang.time.DateFormatUtils;
|
||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -78,6 +80,7 @@ public enum TagReplacer {
|
||||
FACTION_BANCOUNT(TagType.FACTION, "{faction-bancount}"),
|
||||
FACTION_STRIKES(TagType.FACTION, "{strikes}"),
|
||||
FACTION_POINTS(TagType.FACTION, "{faction-points}"),
|
||||
SHIELD_STATUS(TagType.FACTION, "{shield-status}"),
|
||||
|
||||
|
||||
/**
|
||||
@@ -239,6 +242,10 @@ public enum TagReplacer {
|
||||
return fac.hasHome() ? String.valueOf(fac.getHome().getBlockY()) : minimal ? null : "{ig}";
|
||||
case HOME_Z:
|
||||
return fac.hasHome() ? String.valueOf(fac.getHome().getBlockZ()) : minimal ? null : "{ig}";
|
||||
case SHIELD_STATUS:
|
||||
if(fac.isProtected() && fac.getShieldFrame() != null) return String.valueOf(TL.SHIELD_CURRENTLY_ENABLE);
|
||||
if(fac.getShieldFrame() == null) return String.valueOf(TL.SHIELD_NOT_SET);
|
||||
return TL.SHIELD_CURRENTLY_NOT_ENABLED.toString();
|
||||
case LAND_VALUE:
|
||||
return Econ.shouldBeUsed() ? Econ.moneyString(Econ.calculateTotalLandValue(fac.getLandRounded())) : minimal ? null : TL.ECON_OFF.format("value");
|
||||
case LAND_REFUND:
|
||||
|
||||
Reference in New Issue
Block a user