removed hub uhc hourly announcements
This commit is contained in:
parent
e1dd3a318e
commit
f9735006b8
@ -93,7 +93,6 @@ import mineplex.hub.modules.JumpManager;
|
||||
import mineplex.hub.modules.NewsManager;
|
||||
import mineplex.hub.modules.ParkourManager;
|
||||
import mineplex.hub.modules.TextManager;
|
||||
import mineplex.hub.modules.UHCManager;
|
||||
import mineplex.hub.modules.HubVisibilityManager;
|
||||
import mineplex.hub.modules.WorldManager;
|
||||
import mineplex.hub.poll.PollManager;
|
||||
@ -170,7 +169,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
|
||||
new WorldManager(this);
|
||||
new JumpManager(this);
|
||||
new UHCManager(this);
|
||||
//new TournamentInviter(this);
|
||||
|
||||
_news = new NewsManager(this);
|
||||
|
@ -1,101 +0,0 @@
|
||||
package mineplex.hub.modules;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.HubManager;
|
||||
import mineplex.serverdata.Utility;
|
||||
|
||||
public class UHCManager extends MiniPlugin
|
||||
{
|
||||
public HubManager Manager;
|
||||
|
||||
private long _delay = 3600000;
|
||||
private boolean _canAnnounce3 = true;
|
||||
private boolean _canAnnounce2 = true;
|
||||
private boolean _canAnnounce1 = true;
|
||||
private boolean _canAnnounce0 = true;
|
||||
|
||||
public UHCManager(HubManager manager)
|
||||
{
|
||||
super("UHC Manager", manager.getPlugin());
|
||||
|
||||
Manager = manager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void AnnounceUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
long time = Utility.currentTimeMillis();
|
||||
|
||||
//System.out.println("UHC in " + UtilTime.MakeStr(_delay - (time % _delay)));
|
||||
|
||||
//Reset
|
||||
if (time % _delay > 30000 && time % _delay < _delay - 180000)
|
||||
{
|
||||
_canAnnounce3 = true;
|
||||
_canAnnounce2 = true;
|
||||
_canAnnounce1 = true;
|
||||
_canAnnounce0 = true;
|
||||
}
|
||||
//Announce
|
||||
else
|
||||
{
|
||||
if (_canAnnounce3 && time % _delay > _delay - 180000)
|
||||
{
|
||||
_canAnnounce3 = false;
|
||||
announce("Opening in 3 minutes...");
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 3 minutes...", 10, 100, 20);
|
||||
}
|
||||
|
||||
else if (_canAnnounce2 && time % _delay > _delay - 120000)
|
||||
{
|
||||
_canAnnounce2 = false;
|
||||
announce("Opening in 2 minutes...");
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 2 minutes...", 10, 100, 20);
|
||||
}
|
||||
|
||||
else if (_canAnnounce1 && time % _delay > _delay - 60000)
|
||||
{
|
||||
_canAnnounce1 = false;
|
||||
announce("Opening in 1 minute...");
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Open in 1 minute...", 10, 100, 20);
|
||||
}
|
||||
|
||||
else if (_canAnnounce0 && time % _delay < 30000)
|
||||
{
|
||||
_canAnnounce0 = false;
|
||||
announce("UHC Open! Join at the Ultra Hardcore NPC!");
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Ultra Hardcore", "Join at the NPC to play", 10, 100, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void announce(String message)
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
UtilPlayer.message(player, C.cDPurple + "[Ultra Hardcore] " + C.cPurple + C.Bold + message);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user