diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/outpost/Outpost.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/outpost/Outpost.java index 263c3349b..b42d959f9 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/outpost/Outpost.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/outpost/Outpost.java @@ -44,6 +44,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; import mineplex.core.hologram.Hologram; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.updater.UpdateType; @@ -100,6 +101,8 @@ public class Outpost implements Listener private List _nameHolograms; + private Hologram _lifetimeLeft; + public Outpost(OutpostManager outpostManager, OutpostToken token) { _outpostManager = outpostManager; @@ -127,6 +130,8 @@ public class Outpost implements Listener _preHologram = new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0.5, 2.3, 0.5), F.elem(_ownerClan.getName()) + C.cWhite + "'s Outpost block (Right-Click to activate)"); _preHologram2 = new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0.5, 3, 0.5), "Despawning: " + UtilText.getProgress(null, 0, null, true)); + _lifetimeLeft = new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0.5, 1.5, 0.5), "Despawning in " + F.time(UtilTime.MakeStr(MAX_LIFETIME))); + if (token.OutpostState == OutpostState.AWAITING) { _preHologram.start(); @@ -151,6 +156,8 @@ public class Outpost implements Listener _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().subtract(0, -2, (_type._size / 2) + 1), C.cGreen + _ownerClan.getName())); _nameHolograms.forEach(Hologram::start); + + _lifetimeLeft.start(); } } @@ -175,6 +182,7 @@ public class Outpost implements Listener _timeSpawned = System.currentTimeMillis(); _core = _type.getCoreLocation(_origin); + _nameHolograms = new ArrayList<>(); _preHologram = new Hologram(_ownerClan.Clans.getHologramManager(), _origin.clone().add(0.5, 2.3, 0.5), F.elem(_ownerClan.getName()) + C.cWhite + "'s Outpost block (Right-Click to activate)"); _preHologram2 = new Hologram(_ownerClan.Clans.getHologramManager(), _origin.clone().add(0.5, 3, 0.5), "Despawning: " + UtilText.getProgress(null, 0, null, true)); @@ -194,10 +202,12 @@ public class Outpost implements Listener UtilServer.registerEvents(this); - _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add((_type._size / 2) + 1, 2, 0), C.cGreen + _ownerClan.getName())); - _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().subtract((_type._size / 2) + 1, -2, 0), C.cGreen + _ownerClan.getName())); - _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0, 2, (_type._size / 2) + 1), C.cGreen + _ownerClan.getName())); - _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().subtract(0, -2, (_type._size / 2) + 1), C.cGreen + _ownerClan.getName())); + _lifetimeLeft = new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0.5, 1.5, 0.5), "Despawning in " + F.time(UtilTime.MakeStr(MAX_LIFETIME))); + + _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add((_type._size / 2) + 1, 2, 0).add(1, 0, 0).add(.5, 0, .5), C.cGreen + _ownerClan.getName())); + _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().subtract((_type._size / 2) + 1, -2, 0).subtract(1, 0, 0).add(.5, 0, .5), C.cGreen + _ownerClan.getName())); + _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().add(0, 2, (_type._size / 2) + 1).add(0, 0, 1).add(.5, 0, .5), C.cGreen + _ownerClan.getName())); + _nameHolograms.add(new Hologram(outpostManager.getClansManager().getHologramManager(), _origin.clone().subtract(0, -2, (_type._size / 2) + 1).subtract(0, 0, 1).add(.5, 0, .5), C.cGreen + _ownerClan.getName())); } private void cleanup() @@ -394,6 +404,11 @@ public class Outpost implements Listener return; } + if (_lifetimeLeft != null) + { + _lifetimeLeft.setText("Despawning in " + F.time(UtilTime.MakeStr(MAX_LIFETIME - (System.currentTimeMillis() - _timeSpawned)))); + } + if (_state == OutpostState.CONSTRUCTING) { if (_buildQueue.isEmpty()) @@ -479,6 +494,8 @@ public class Outpost implements Listener _preHologram = null; _preHologram = null; + _lifetimeLeft.start(); + _state = OutpostState.CONSTRUCTING; _blocks = new LinkedHashMap<>(_buildQueue = _type.createBuildQueue(_origin, _ownerClan.Clans)); @@ -556,6 +573,10 @@ public class Outpost implements Listener cleanup(); }, wait.get() + 5L); + if (_lifetimeLeft != null) _lifetimeLeft.stop(); + + _lifetimeLeft = null; + _ownerClan.inform("Your Clan's Outpost has been destroyed.", null); }