Deal with remaining shield code

This commit is contained in:
DroppingAnvil 2020-06-08 16:03:28 -04:00
parent cdc07ed5eb
commit e9923344a2
3 changed files with 9 additions and 16 deletions

View File

@ -19,7 +19,6 @@ import com.massivecraft.factions.cmd.relational.CmdRelationTruce;
import com.massivecraft.factions.cmd.reserve.CmdReserve;
import com.massivecraft.factions.cmd.roles.CmdDemote;
import com.massivecraft.factions.cmd.roles.CmdPromote;
import com.massivecraft.factions.cmd.shields.CmdShield;
import com.massivecraft.factions.cmd.tnt.CmdTnt;
import com.massivecraft.factions.cmd.tnt.CmdTntFill;
import com.massivecraft.factions.cmd.wild.CmdWild;
@ -172,7 +171,6 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
public CmdClaimFill cmdClaimFill = new CmdClaimFill();
public CmdNotifications cmdNotifications = new CmdNotifications();
public CmdFriendlyFire cmdFriendlyFire = new CmdFriendlyFire();
public CmdShield cmdShield = new CmdShield();
//Variables to know if we already setup certain sub commands
public Boolean discordEnabled = false;
@ -308,7 +306,6 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
this.addSubCommand(this.cmdLookup);
this.addSubCommand(this.cmdNotifications);
this.addSubCommand(this.cmdFriendlyFire);
this.addSubCommand(this.cmdShield);
addVariableCommands();
if (CommodoreProvider.isSupported()) brigadierManager.build();
}

View File

@ -4,8 +4,6 @@ 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;
@ -40,11 +38,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();
}),
//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)) {

View File

@ -1,11 +1,9 @@
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;
@ -242,10 +240,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 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: