Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
88ef0ce35b
@ -89,6 +89,8 @@ public class TextManager extends MiniPlugin
|
||||
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-15, 21, 0), faceSurvival, 159, (byte)1, TextAlign.CENTER);
|
||||
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
|
||||
|
||||
//UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER);
|
||||
//UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
|
||||
|
||||
//Other
|
||||
UtilText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER);
|
||||
|
@ -0,0 +1,82 @@
|
||||
package mineplex.hub.modules;
|
||||
|
||||
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.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.HubManager;
|
||||
|
||||
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.TICK)
|
||||
return;
|
||||
|
||||
System.out.println("UHC in " + UtilTime.MakeStr(_delay - (System.currentTimeMillis() % _delay)));
|
||||
|
||||
//Reset
|
||||
if (System.currentTimeMillis() % _delay > 30000 && System.currentTimeMillis() % _delay < _delay - 180000)
|
||||
{
|
||||
_canAnnounce3 = true;
|
||||
_canAnnounce2 = true;
|
||||
_canAnnounce1 = true;
|
||||
_canAnnounce0 = true;
|
||||
}
|
||||
//Announce
|
||||
else
|
||||
{
|
||||
if (_canAnnounce3 && System.currentTimeMillis() % _delay > _delay - 180000)
|
||||
{
|
||||
_canAnnounce3 = false;
|
||||
announce("Starting in 3 minutes...");
|
||||
}
|
||||
|
||||
else if (_canAnnounce2 && System.currentTimeMillis() % _delay > _delay - 120000)
|
||||
{
|
||||
_canAnnounce2 = false;
|
||||
announce("Starting in 2 minutes...");
|
||||
}
|
||||
|
||||
else if (_canAnnounce1 && System.currentTimeMillis() % _delay > _delay - 60000)
|
||||
{
|
||||
_canAnnounce1 = false;
|
||||
announce("Starting in 1 minute...");
|
||||
}
|
||||
|
||||
else if (_canAnnounce0 && System.currentTimeMillis() % _delay < 30000)
|
||||
{
|
||||
_canAnnounce0 = false;
|
||||
announce("Join at the Ultra Hardcore NPC!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void announce(String message)
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
UtilPlayer.message(player, C.cDPurple + "[Ultra Hardcore] " + C.cPurple + C.Bold + message);
|
||||
}
|
||||
}
|
@ -740,16 +740,16 @@ public class MineStrike extends TeamGame
|
||||
Gun gun = _gunsDropped.get(event.getItem());
|
||||
if (gun != null)
|
||||
{
|
||||
gun.pickup(this, event.getPlayer());
|
||||
event.getItem().remove();
|
||||
if (gun.pickup(this, event.getPlayer()))
|
||||
event.getItem().remove();
|
||||
}
|
||||
|
||||
//Grenades
|
||||
Grenade grenade = _grenadesDropped.get(event.getItem());
|
||||
if (grenade != null)
|
||||
{
|
||||
grenade.pickup(this, event.getPlayer());
|
||||
event.getItem().remove();
|
||||
if (grenade.pickup(this, event.getPlayer()))
|
||||
event.getItem().remove();
|
||||
}
|
||||
|
||||
//Defusal
|
||||
|
@ -185,6 +185,8 @@ public abstract class Grenade extends StrikeItem
|
||||
{
|
||||
game.registerGrenade(this, player);
|
||||
game.deregisterDroppedGrenade(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -174,6 +174,8 @@ public class SurvivalGames extends SoloGame
|
||||
this.ItemPickup = true;
|
||||
|
||||
this.InventoryClick = true;
|
||||
this.InventoryOpenBlock = true;
|
||||
this.InventoryOpenChest = true;
|
||||
|
||||
this.CompassEnabled = false; //XXX
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user