diff --git a/Plugins/Core/.classpath b/Plugins/Core/.classpath index 35c355214..a0fca0d69 100644 --- a/Plugins/Core/.classpath +++ b/Plugins/Core/.classpath @@ -8,6 +8,5 @@ - diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java index a140b70c0..4fd93106b 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java @@ -83,11 +83,25 @@ public class UtilTime else type = TimeUnit.DAYS; } - if (type == TimeUnit.DAYS) return UtilMath.trim(trim, (time)/86400000d) + " Days"; - if (type == TimeUnit.HOURS) return UtilMath.trim(trim, (time)/3600000d) + " Hours"; - if (type == TimeUnit.MINUTES) return UtilMath.trim(trim, (time)/60000d) + " Minutes"; - if (type == TimeUnit.SECONDS) return UtilMath.trim(trim, (time)/1000d) + " Seconds"; - else return UtilMath.trim(trim, time) + " Milliseconds"; + if (trim == 0) + { + if (type == TimeUnit.DAYS) return (int)UtilMath.trim(trim, (time)/86400000d) + " Days"; + if (type == TimeUnit.HOURS) return (int)UtilMath.trim(trim, (time)/3600000d) + " Hours"; + if (type == TimeUnit.MINUTES) return (int)UtilMath.trim(trim, (time)/60000d) + " Minutes"; + if (type == TimeUnit.SECONDS) return (int)UtilMath.trim(trim, (time)/1000d) + " Seconds"; + else return (int)UtilMath.trim(trim, time) + " Milliseconds"; + } + else + { + if (type == TimeUnit.DAYS) return UtilMath.trim(trim, (time)/86400000d) + " Days"; + if (type == TimeUnit.HOURS) return UtilMath.trim(trim, (time)/3600000d) + " Hours"; + if (type == TimeUnit.MINUTES) return UtilMath.trim(trim, (time)/60000d) + " Minutes"; + if (type == TimeUnit.SECONDS) return UtilMath.trim(trim, (time)/1000d) + " Seconds"; + else return UtilMath.trim(trim, time) + " Milliseconds"; + } + + + } public static boolean elapsed(long from, long required) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/timing/TimingManager.java b/Plugins/Mineplex.Core/src/mineplex/core/timing/TimingManager.java index 7f4020fe1..a19401664 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/timing/TimingManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/timing/TimingManager.java @@ -18,7 +18,7 @@ public class TimingManager implements Listener private static Object _timingLock = new Object(); private static Object _totalLock = new Object(); - public static boolean Debug = false; + public static boolean Debug = true; protected TimingManager(JavaPlugin plugin) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 1e054ac7f..1fce65064 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -61,6 +61,7 @@ import mineplex.core.stats.StatsManager; import mineplex.core.task.TaskManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.hub.commands.ForcefieldRadius; import mineplex.hub.commands.GadgetToggle; import mineplex.hub.gadget.GadgetManager; import mineplex.hub.modules.*; @@ -83,6 +84,7 @@ public class HubManager extends MiniClientPlugin private DonationManager _donationManager; private DisguiseManager _disguiseManager; private PartyManager _partyManager; + private ForcefieldManager _forcefieldManager; private Portal _portal; private StatsManager _statsManager; private GadgetManager _gadgetManager; @@ -128,6 +130,7 @@ public class HubManager extends MiniClientPlugin new WorldManager(this); new JumpManager(this); new NewsManager(this); + _mountManager = new MountManager(this); _gadgetManager = new GadgetManager(this, _mountManager, petManager); @@ -136,7 +139,10 @@ public class HubManager extends MiniClientPlugin _preferences = preferences; _tutorialManager = new TutorialManager(this, donationManager, taskManager, _textCreator); _visibilityManager = new VisibilityManager(this); - + + _forcefieldManager = new ForcefieldManager(this); + AddCommand(new ForcefieldRadius(_forcefieldManager)); + _statsManager = new StatsManager(plugin); ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true; @@ -751,37 +757,6 @@ public class HubManager extends MiniClientPlugin this._gadgetsEnabled = _enabled; } - @EventHandler - public void ForcefieldUpdate(UpdateEvent event) - { - if (event.getType() != UpdateType.FAST) - return; - - for (Player player : UtilServer.getPlayers()) - { - if (_preferences.Get(player).HubForcefield) - { - for (Player other : UtilServer.getPlayers()) - { - if (player.equals(other)) - continue; - - if (UtilMath.offset(other, player) > 5) - continue; - - if (GetClients().Get(other).GetRank().Has(Rank.ADMIN)) - continue; - - if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false)) - { - UtilAction.velocity(other, UtilAlg.getTrajectory2d(player, other), 1.6, true, 0.8, 0, 10, true); - other.getWorld().playSound(other.getLocation(), Sound.CHICKEN_EGG_POP, 2f, 0.5f); - } - } - } - } - } - @Override protected void loadClientInformation(RetrieveClientInformationEvent event) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/ForcefieldRadius.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/ForcefieldRadius.java new file mode 100644 index 000000000..03ea7fce2 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/ForcefieldRadius.java @@ -0,0 +1,21 @@ +package mineplex.hub.commands; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.hub.modules.ForcefieldManager; + +public class ForcefieldRadius extends CommandBase +{ + public ForcefieldRadius(ForcefieldManager plugin) + { + super(plugin, Rank.OWNER, new String[] {"radius"}); + } + + @Override + public void Execute(Player caller, String[] args) + { + Plugin.ForcefieldRadius(caller, args); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java new file mode 100644 index 000000000..72e54cd6d --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java @@ -0,0 +1,97 @@ +package mineplex.hub.modules; + +import java.util.HashMap; + +import org.bukkit.Sound; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerQuitEvent; + +import mineplex.core.MiniPlugin; +import mineplex.core.common.Rank; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.hub.HubManager; + +public class ForcefieldManager extends MiniPlugin +{ + public HubManager Manager; + + private HashMap _radius = new HashMap(); + + public ForcefieldManager(HubManager manager) + { + super("Forcefield", manager.GetPlugin()); + + Manager = manager; + } + + @EventHandler + public void ForcefieldUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FASTER) + return; + + for (Player player : UtilServer.getPlayers()) + { + if (Manager.getPreferences().Get(player).HubForcefield) + { + for (Player other : UtilServer.getPlayers()) + { + if (player.equals(other)) + continue; + + int range = 5; + if (_radius.containsKey(player)) + range = _radius.get(player); + + if (UtilMath.offset(other, player) > range) + continue; + + if (Manager.GetClients().Get(other).GetRank().Has(Rank.ADMIN)) + continue; + + if (Recharge.Instance.use(other, "Forcefield Bump", 500, false, false)) + { + Entity bottom = other; + while (bottom.getVehicle() != null) + bottom = bottom.getVehicle(); + + UtilAction.velocity(bottom, UtilAlg.getTrajectory2d(player, bottom), 1.6, true, 0.8, 0, 10, true); + other.getWorld().playSound(other.getLocation(), Sound.CHICKEN_EGG_POP, 2f, 0.5f); + } + } + } + } + } + + public void ForcefieldRadius(Player caller, String[] args) + { + try + { + int range = Integer.parseInt(args[0]); + + _radius.put(caller, range); + + UtilPlayer.message(caller, F.main("Forcefield", "Radius set to " + F.elem(range + "") + ".")); + } + catch (Exception e) + { + UtilPlayer.message(caller, F.main("Forcefield", "Invalid Input. Correct input is " + F.elem("/radius #") + ".")); + } + } + + @EventHandler + public void ForcefieldReset(PlayerQuitEvent event) + { + _radius.remove(event.getPlayer()); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java index d8462ed0e..666e15509 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/addons/CompassAddon.java @@ -21,6 +21,7 @@ import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -83,8 +84,15 @@ public class CompassAddon extends MiniPlugin if (target != null) { - if (!player.getInventory().contains(Material.COMPASS)) - player.getInventory().addItem(new ItemStack(Material.COMPASS)); + if (Manager.GetGame().CompassGiveItem) + if (!player.getInventory().contains(Material.COMPASS)) + { + if (player.getOpenInventory() == null || player.getOpenInventory().getCursor() == null || player.getOpenInventory().getCursor().getType() != Material.COMPASS) + { + player.getInventory().addItem(new ItemStack(Material.COMPASS)); + } + } + player.setCompassTarget(target.getLocation()); @@ -146,9 +154,9 @@ public class CompassAddon extends MiniPlugin } @EventHandler - public void PlayerInteract(PlayerInteractEvent event) + public void SpectatorTeleport(PlayerInteractEvent event) { - if (Manager.GetGame() == null || !Manager.GetGame().CompassEnabled) + if (Manager.GetGame() == null) return; Player player = event.getPlayer(); @@ -159,6 +167,13 @@ public class CompassAddon extends MiniPlugin if (Manager.GetGame().IsAlive(player)) return; + event.setCancelled(true); + + if (!Recharge.Instance.use(player, "Spectate", 5000, true, false)) + { + return; + } + GameTeam team = Manager.GetGame().GetTeam(player); Player target = null; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index ce9ea8d34..c67ab2c82 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -112,6 +112,8 @@ public abstract class Game implements Listener protected String[] _help; //Gameplay Flags + public long GameTimeout = 1200000; + public boolean Damage = true; public boolean DamagePvP = true; public boolean DamagePvE = true; @@ -181,6 +183,8 @@ public abstract class Game implements Listener //Addons public boolean CompassEnabled = false; + public boolean CompassGiveItem = true; + public boolean SoupEnabled = true; public boolean TeamArmor = false; public boolean TeamArmorHotbar = false; @@ -276,7 +280,7 @@ public abstract class Game implements Listener return Scoreboard; } - public Objective GetObjectiveSide() + private Objective GetObjectiveSide() { return Scoreboard.GetObjectiveSide(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java index a2e8e5965..7d4e559db 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java @@ -81,9 +81,11 @@ public abstract class SoloGame extends Game Scoreboard.Reset(); + Scoreboard.WriteBlank(); + GameTeam team = GetTeamList().get(0); - if (team.GetPlayers(false).size() < 16) + if (team.GetPlayers(false).size() < 15) { for (Player player : team.GetPlayers(false)) { @@ -106,8 +108,6 @@ public abstract class SoloGame extends Game } else { - Scoreboard.WriteBlank(); - Scoreboard.Write(C.cGreen + "Players Alive"); Scoreboard.Write("" + team.GetPlayers(true).size()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/TeamGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/TeamGame.java index 87bc9342f..56ed359f0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/TeamGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/TeamGame.java @@ -225,8 +225,10 @@ public abstract class TeamGame extends Game for (GameTeam team : this.GetTeamList()) { //Display Individual Players - if (this.GetPlayers(true).size() < 16) + if (this.GetPlayers(true).size() < 13) { + Scoreboard.WriteBlank(); + for (Player player : team.GetPlayers(true)) { Scoreboard.Write(team.GetColor() + player.getName()); @@ -239,7 +241,7 @@ public abstract class TeamGame extends Game Scoreboard.WriteBlank(); Scoreboard.Write(team.GetColor() + team.GetName()); - Scoreboard.Write("" + team.GetPlayers(true).size()); + Scoreboard.Write(team.GetPlayers(true).size() + "" + team.GetColor() + " Alive"); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java index 7b544ae4a..7c7e5c07b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/GameScore.java @@ -1,13 +1,11 @@ package nautilus.game.arcade.game.games; -import nautilus.game.arcade.game.PlayerScore; - import org.bukkit.entity.Player; -public class GameScore implements PlayerScore +public class GameScore { public org.bukkit.entity.Player Player; - public double Score; + public double Score; public GameScore(Player player, double i) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index 0662cd26b..f88e5eb7f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -130,6 +130,8 @@ public class Bridge extends TeamGame implements OreObsfucation _ore = new OreHider(); // Flags + GameTimeout = 96000000; + DamageSelf = true; ItemDrop = true; @@ -992,27 +994,6 @@ public class Bridge extends TeamGame implements OreObsfucation } } - @EventHandler - public void BridgeTimer(UpdateEvent event) - { - if (GetState() != GameState.Live) - return; - - if (event.getType() != UpdateType.TICK) - return; - - long time = _bridgeTime - - (System.currentTimeMillis() - this.GetStateTime()); - - if (time > 0) - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lBridges in " + C.cGreen + "§l" - + UtilTime.MakeStr(time)); - else - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lBridges are down!"); - } - @EventHandler(priority = EventPriority.LOW) public void ChestProtect(EntityExplodeEvent event) { @@ -1105,8 +1086,26 @@ public class Bridge extends TeamGame implements OreObsfucation //Display Players Alive if (!_tournament) { - super.ScoreboardUpdate(event); - return; + for (GameTeam team : this.GetTeamList()) + { + //Display Individual Players + if (this.GetPlayers(true).size() < 10) + { + Scoreboard.WriteBlank(); + + for (Player player : team.GetPlayers(true)) + { + Scoreboard.Write(team.GetColor() + player.getName()); + } + } + + //Display Players Alive + else + { + Scoreboard.WriteBlank(); + Scoreboard.WriteOrdered("Score", team.GetColor() + "Players", team.GetPlayers(true).size(), true); + } + } } //Display Kills + Players else @@ -1119,12 +1118,27 @@ public class Bridge extends TeamGame implements OreObsfucation Scoreboard.WriteBlank(); - Scoreboard.Write(team.GetColor() + C.Bold + team.GetName()); Scoreboard.Write(team.GetColor() + " " + team.GetPlayers(true).size() + " Players"); Scoreboard.Write(team.GetColor() + " " + kills + " Kills"); } } + Scoreboard.WriteBlank(); + + + long time = _bridgeTime + - (System.currentTimeMillis() - this.GetStateTime()); + + if (time > 0) + { + Scoreboard.Write(C.cYellow + C.Bold + "Bridges Spawn"); + Scoreboard.Write(UtilTime.MakeStr(time, 0)); + } + else + { + Scoreboard.Write(C.cYellow + C.Bold + "Bridges Down!"); + } + Scoreboard.Draw(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java index 96a106ec4..52b3b6104 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java @@ -430,6 +430,26 @@ public class CastleSiege extends TeamGame Scoreboard.Write(_kingHealth + " Health"); } + long timeLeft = 24000 - WorldTimeSet; + timeLeft = timeLeft / 20 * 1000; + + + if (timeLeft > 0) + { + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Sun Rise"); + Scoreboard.Write(UtilTime.MakeStr(timeLeft, 0)); + } + else + { + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Sun Rise"); + Scoreboard.Write("Undead Burning!"); + + for (Player player : GetTeam(ChatColor.RED).GetPlayers(true)) + Manager.GetCondition().Factory().Ignite("Sun Damage", player, player, 5, false, false); + } + Scoreboard.Draw(); } @@ -777,24 +797,6 @@ public class CastleSiege extends TeamGame return; WorldTimeSet = (WorldTimeSet+1); - - long timeLeft = 24000 - WorldTimeSet; - timeLeft = timeLeft / 20 * 1000; - - - if (timeLeft > 0) - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lSun Rise: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - else - { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lSun has risen!"); - - for (Player player : GetTeam(ChatColor.RED).GetPlayers(true)) - Manager.GetCondition().Factory().Ignite("Sun Damage", player, player, 5, false, false); - } - } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java index b0bc30c2e..a850b2545 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java @@ -47,41 +47,41 @@ public class TeamDeathmatch extends TeamGame { private ArrayList _points = new ArrayList(); private ArrayList _resupply = new ArrayList(); - + private HashMap _kills = new HashMap(); - + private Objective _healthObj; private boolean _beaconEnabled = false; private long _beaconTime = 180000; - + //Scores private int _victoryScore = 120; private int _redScore = 0; private int _blueScore = 0; - + public TeamDeathmatch(ArcadeManager manager, GameType type, Kit[] kits) { super(manager, type, kits, - new String[] - { + new String[] + { "Each player has " + C.cRed + C.Bold + "ONE LIFE", "Kill the other team to win!", - }); + }); this.DeathOut = true; this.HungerSet = 20; this.WorldTimeSet = 2000; this.CompassEnabled = true; - + this.Manager.GetDamage().UseSimpleWeaponDamage = false; - + //_healthObj = GetScoreboard().registerNewObjective("HP", "dummy"); //_healthObj.setDisplaySlot(DisplaySlot.BELOW_NAME); } - + @Override public void ParseData() { @@ -89,7 +89,7 @@ public class TeamDeathmatch extends TeamGame { _points.add(new CapturePointTDM(this, pointName, WorldData.GetAllCustomLocs().get(pointName).get(0))); } - + for (Location loc : WorldData.GetDataLocs("YELLOW")) { _resupply.add(new Resupply(this, loc)); @@ -101,14 +101,14 @@ public class TeamDeathmatch extends TeamGame { if (!(event.GetEvent().getEntity() instanceof Player)) return; - + Player killed = (Player)event.GetEvent().getEntity(); SetPlayerState(killed, PlayerState.OUT); - + GameTeam killedTeam = GetTeam(killed); if (killedTeam == null) return; - + if (event.GetLog().GetKiller() != null) { Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); @@ -118,11 +118,11 @@ public class TeamDeathmatch extends TeamGame GameTeam killerTeam = GetTeam(killer); if (killerTeam == null) return; - + int kills = 1; if (killedTeam.equals(killerTeam)) kills = -1; - + if (_kills.containsKey(killer)) kills += _kills.get(killer); @@ -138,14 +138,14 @@ public class TeamDeathmatch extends TeamGame { if (event.GetState() != GameState.Live) return; - + for (Player player : GetPlayers(true)) { player.setMaxHealth(30); player.setHealth(player.getMaxHealth()); } } - + @Override public double GetKillsGems(Player killer, Player killed, boolean assist) { @@ -156,7 +156,7 @@ public class TeamDeathmatch extends TeamGame { return "Team Deathmatch"; } - + @Override public void ValidateKit(Player player, GameTeam team) { @@ -167,13 +167,13 @@ public class TeamDeathmatch extends TeamGame player.closeInventory(); } } - + @Override public DeathMessageType GetDeathMessageType() { return DeathMessageType.Detailed; } - + @EventHandler public void DisplayHealth(UpdateEvent event) { @@ -181,7 +181,7 @@ public class TeamDeathmatch extends TeamGame for (Player player : GetPlayers(true)) _healthObj.getScore(player.getName()).setScore((int)player.getHealth()); } - + @EventHandler public void WaterArrowCancel(EntityShootBowEvent event) { @@ -191,7 +191,7 @@ public class TeamDeathmatch extends TeamGame event.setCancelled(true); } } - + @EventHandler public void Updates(UpdateEvent event) { @@ -206,106 +206,91 @@ public class TeamDeathmatch extends TeamGame for (Resupply cur : _resupply) cur.Update(); } - + @EventHandler public void BeaconUpdate(UpdateEvent event) { if (!IsLive()) return; - + if (event.getType() != UpdateType.TICK) return; - + if (_beaconEnabled) return; - + if (UtilTime.elapsed(GetStateTime(), _beaconTime)) { _beaconEnabled = true; - + Announce(C.cWhite + C.Bold + "Capture Point is active!"); - + _points.get(UtilMath.r(_points.size())).Enable(); - - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lFirst to " + C.cGreen + "§l" + _victoryScore); - + for (Player player : UtilServer.getPlayers()) player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f); } - else - { - long timeLeft = _beaconTime - (System.currentTimeMillis() - GetStateTime()); - - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lBeacon: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - } } - + @Override @EventHandler public void ScoreboardUpdate(UpdateEvent event) { if (event != null && event.getType() != UpdateType.FAST) return; - + ScoreboardWrite(); } - + public void ScoreboardWrite() { Scoreboard.Reset(); - + for (GameTeam team : this.GetTeamList()) { //Display Individual Players - if (this.GetPlayers(true).size() < 11) + if (this.GetPlayers(true).size() < 10) { for (Player player : team.GetPlayers(true)) { Scoreboard.Write(team.GetColor() + player.getName()); } } - + //Display Players Alive else { Scoreboard.WriteBlank(); - - Scoreboard.Write(team.GetColor() + team.GetName()); + + Scoreboard.Write(team.GetColor() + team.GetName() + " Alive"); Scoreboard.Write("" + team.GetPlayers(true).size()); } } - - + + if (_beaconEnabled) { - for (GameTeam team : this.GetTeamList()) - { - Scoreboard.WriteBlank(); - - Scoreboard.Write(team.GetColor() + team.GetName()); - - if (team.GetColor() == ChatColor.RED) - Scoreboard.Write("" + _redScore); - else - Scoreboard.Write("" + _blueScore + " "); - } + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + " Beacon"); + Scoreboard.Write(C.cRed + _redScore + C.cWhite + " " + C.cAqua + _blueScore); } else { - + long timeLeft = _beaconTime - (System.currentTimeMillis() - GetStateTime()); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + " Beacon Spawn"); + Scoreboard.Write(UtilTime.MakeStr(timeLeft, 0)); } - + Scoreboard.Draw(); } - + public void AddScore(GameTeam team, int score) { if (team == null) return; - + if (team.GetColor() == ChatColor.RED) { _redScore = Math.min(_victoryScore, _redScore + score); @@ -317,14 +302,14 @@ public class TeamDeathmatch extends TeamGame EndCheckScore(); } - + public void EndCheckScore() { if (!IsLive()) return; - + GameTeam winner = null; - + if (_redScore >= _victoryScore) winner = GetTeam(ChatColor.RED); else if (_blueScore >= _victoryScore) @@ -332,7 +317,7 @@ public class TeamDeathmatch extends TeamGame if (winner == null) return; - + ScoreboardWrite(); //Announce @@ -350,12 +335,12 @@ public class TeamDeathmatch extends TeamGame if (player.isOnline()) AddGems(player, 10, "Participation", false); } - + if (EloRanking) { EloTeam teamWinner = new EloTeam(); EloTeam teamLoser = new EloTeam(); - + for (GameTeam team : GetTeamList()) { if (WinnerTeam != null && team.equals(WinnerTeam)) @@ -365,7 +350,7 @@ public class TeamDeathmatch extends TeamGame EloPlayer eloPlayer = new EloPlayer(); eloPlayer.UniqueId = player.getUniqueId().toString(); eloPlayer.Rating = Manager.getEloManager().getElo(player.getUniqueId(), GetName()); - + teamWinner.addPlayer(eloPlayer); } } @@ -376,23 +361,23 @@ public class TeamDeathmatch extends TeamGame EloPlayer eloPlayer = new EloPlayer(); eloPlayer.UniqueId = player.getUniqueId().toString(); eloPlayer.Rating = Manager.getEloManager().getElo(player.getUniqueId(), GetName()); - + teamLoser.addPlayer(eloPlayer); } } } - + for (EloPlayer eloPlayer : Manager.getEloManager().getNewRatings(teamWinner, teamLoser, GameResult.Win).getPlayers()) { Manager.getEloManager().saveElo(eloPlayer.UniqueId, GetName(), eloPlayer.Rating); } - + for (EloPlayer eloPlayer : Manager.getEloManager().getNewRatings(teamLoser, teamWinner, GameResult.Loss).getPlayers()) { Manager.getEloManager().saveElo(eloPlayer.UniqueId, GetName(), eloPlayer.Rating); } } - + //End SetState(GameState.End); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java index a59611d46..c13a9b904 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java @@ -15,6 +15,7 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilMath; 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 nautilus.game.arcade.ArcadeManager; @@ -297,8 +298,18 @@ public class DeathTag extends SoloGame if (_runners == null || _chasers == null) return; - GetObjectiveSide().getScore(_runners.GetColor() + _runners.GetName()).setScore(_runners.GetPlayers(true).size()); - GetObjectiveSide().getScore(_chasers.GetColor() + _chasers.GetName()).setScore(_chasers.GetPlayers(true).size()); + //Wipe Last + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(_runners.GetPlayers(true).size() + " " +_runners.GetColor() + " Runners"); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(_chasers.GetPlayers(true).size() + " " +_chasers.GetColor() + " Chasers"); + + Scoreboard.Draw(); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java index 43ef585f4..eac693ec3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java @@ -296,8 +296,10 @@ public class DragonEscape extends SoloGame //Wipe Last Scoreboard.Reset(); + Scoreboard.WriteBlank(); + //Write New - for (int i=0 ; i<_ranks.size() && i<15 ; i++) + for (int i=0 ; i<_ranks.size() && i<14 ; i++) { DragonScore score = _ranks.get(i); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java index ef4215778..3528d43fa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java @@ -375,7 +375,7 @@ public class DragonEscapeTeams extends TeamGame Scoreboard.WriteBlank(); Scoreboard.Write(team.GetColor() + team.GetName()); - Scoreboard.Write(team.GetColor() + "" + score); + Scoreboard.Write(score + "" + team.GetColor() + " Score"); } Scoreboard.Draw(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonsTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonsTeams.java index 27231f499..6f1aa62f5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonsTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonsTeams.java @@ -252,8 +252,6 @@ public class DragonsTeams extends TeamGame //Wipe Last Scoreboard.Reset(); - int i=1; - String space = " "; for (GameTeam team : _teamScore.keySet()) { //Time diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index 090e1161a..a01a09dd9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -953,14 +953,8 @@ public class HideSeek extends TeamGame { long timeLeft = _hideTime - (System.currentTimeMillis() - GetStateTime()); - if (timeLeft > 0) + if (timeLeft <= 0) { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lHide Time: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - } - else - { _started = true; //Hider Items @@ -978,18 +972,10 @@ public class HideSeek extends TeamGame { long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime() - _hideTime); - if (timeLeft > 0) - { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lHunt Time: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - } - else - { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lHunt Time: " + C.cGreen + "§l" - + UtilTime.MakeStr(0)); - + if (timeLeft <= 0) + { + WriteScoreboard(); + SetState(GameState.End); AnnounceEnd(_hiders); @@ -1002,6 +988,48 @@ public class HideSeek extends TeamGame } } } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + WriteScoreboard(); + } + + private void WriteScoreboard() + { + //Wipe Last + Scoreboard.Reset(); + + for (GameTeam team : this.GetTeamList()) + { + Scoreboard.WriteBlank(); + Scoreboard.Write(team.GetPlayers(true).size() + " " + team.GetColor() + team.GetName()); + } + + + if (!_started) + { + long timeLeft = _hideTime - (System.currentTimeMillis() - GetStateTime()); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Hide Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, timeLeft), 0)); + } + else + { + long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime() - _hideTime); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Seek Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, timeLeft), 0)); + } + + Scoreboard.Draw(); + } @Override public GameTeam ChooseTeam(Player player) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java index 7f78e1c8f..13bcb29e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java @@ -477,6 +477,8 @@ public class MilkCow extends SoloGame //Wipe Last Scoreboard.Reset(); + + Scoreboard.WriteBlank(); for (Player player : GetPlayers(true)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/MineWare.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/MineWare.java index 450e2d506..fc707f59c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/MineWare.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/MineWare.java @@ -185,9 +185,11 @@ public class MineWare extends SoloGame Announce(C.cYellow + C.Bold + _order.GetOrder().toUpperCase()); + /* XXX GetObjectiveSide().setDisplayName( ChatColor.WHITE + "§lMineWare " + C.cGreen + "§l" + "Round " + _orderCount); + */ } //Update Order else diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java index d45cd6541..a95ec1b34 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java @@ -86,8 +86,6 @@ public class Quiver extends SoloGame player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)1, 1, F.item("Super Arrow"))); player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f); } - - GetObjectiveSide().setDisplayName(C.cWhite + C.Bold + "First to " + C.cGold + C.Bold + "20 Kills"); } @EventHandler @@ -260,12 +258,12 @@ public class Quiver extends SoloGame //Wipe Last Scoreboard.Reset(); + + Scoreboard.WriteBlank(); //Write New - for (int i=0 ; i<_ranks.size() && i<15 ; i++) + for (QuiverScore score : _ranks) { - QuiverScore score = _ranks.get(i); - Scoreboard.WriteOrdered("Score", C.cGreen + score.Player.getName(), score.Kills, true); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java index 8d9ec6303..ecc6c48be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java @@ -81,8 +81,6 @@ public class QuiverTeams extends TeamGame player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f); } - GetObjectiveSide().setDisplayName(C.cWhite + C.Bold + "First to " + C.cGold + C.Bold + _reqKills +" Kills"); - for (GameTeam team : GetTeamList()) { _teamKills.put(team, 0); @@ -194,7 +192,7 @@ public class QuiverTeams extends TeamGame Scoreboard.WriteBlank(); Scoreboard.Write(team.GetColor() + team.GetName()); - Scoreboard.Write(team.GetColor() + "" + kills + " Kills"); + Scoreboard.Write(kills + "" + team.GetColor() + " Kills"); } Scoreboard.Draw(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 9cab9038b..740599078 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -101,14 +101,14 @@ public class SheepGame extends TeamGame "Return Sheep to your Team Pen!", "Most sheep at 5 minutes wins!" }); - + this.DeathOut = false; this.DeathSpectateSecs = 8; this.HungerSet = 20; - + this.WorldTimeSet = 2000; - + this.TeamArmor = true; this.TeamArmorHotbar = true; } @@ -200,7 +200,7 @@ public class SheepGame extends TeamGame return; Player player = event.getPlayer(); - + if (!Recharge.Instance.usable(player, "Sheep Stack")) return; @@ -212,7 +212,7 @@ public class SheepGame extends TeamGame if (!IsAlive(event.getPlayer())) return; - + if (player.getPassenger() != null && player.getPassenger() instanceof Player) { DropSheep(player); @@ -246,11 +246,11 @@ public class SheepGame extends TeamGame data.SetHolder(event.getPlayer()); } } - + //Put Wool in Inventory player.getInventory().setItem(4 + count, ItemStackFactory.Instance.CreateStack(35, ((Sheep)event.getRightClicked()).getColor().getWoolData())); UtilInv.Update(player); - + //Effect event.getRightClicked().getWorld().playEffect(event.getRightClicked().getLocation(), Effect.STEP_SOUND, 35); @@ -260,7 +260,7 @@ public class SheepGame extends TeamGame //Audio player.playSound(player.getLocation(), Sound.SHEEP_IDLE, 2f, 3f); } - + @EventHandler public void StackPlayer(PlayerInteractEntityEvent event) { @@ -275,16 +275,16 @@ public class SheepGame extends TeamGame Player player = event.getPlayer(); Player other = (Player)event.getRightClicked(); - + if (!(GetKit(player) instanceof KitBrute)) return; - + if (!GetTeam(player).HasPlayer(other)) return; - + if (player.getPassenger() != null) DropSheep(player); - + if (!Recharge.Instance.usable(player, "Sheep Stack")) return; @@ -306,12 +306,12 @@ public class SheepGame extends TeamGame //Audio player.playSound(player.getLocation(), Sound.VILLAGER_YES, 2f, 3f); other.playSound(player.getLocation(), Sound.VILLAGER_NO, 2f, 3f); - + //Inform UtilPlayer.message(other, F.main("Skill", F.elem(GetTeam(player).GetColor() + player.getName()) + " picked you up.")); UtilPlayer.message(player, F.main("Skill", "You picked up " + F.elem(GetTeam(player).GetColor() + player.getName()) + ".")); } - + @EventHandler public void DeathDrop(PlayerDeathEvent event) { @@ -389,7 +389,7 @@ public class SheepGame extends TeamGame } player.setExp(0.33f * (float)count); - + //Inventory Wool Clean if (count <= 0 && UtilGear.isMat(player.getInventory().getItem(4), Material.WOOL)) player.getInventory().setItem(4, null); @@ -456,27 +456,6 @@ public class SheepGame extends TeamGame Manager.GetCondition().Factory().Regen("Respawn", event.GetPlayer(), event.GetPlayer(), 5, 3, false, false, true); } - @EventHandler - public void ScoreboardTimer(UpdateEvent event) - { - if (GetState() != GameState.Live) - return; - - if (event.getType() != UpdateType.TICK) - return; - - long time = _gameTime - - (System.currentTimeMillis() - this.GetStateTime()); - - if (time > 0) - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lTime Left " + C.cGreen + "§l" - + UtilTime.MakeStr(time)); - else - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lTime Up!"); - } - @Override @EventHandler public void ScoreboardUpdate(UpdateEvent event) @@ -489,6 +468,7 @@ public class SheepGame extends TeamGame //Wipe Last Scoreboard.Reset(); + Scoreboard.WriteBlank(); //Write New for (GameTeam team : _sheepPens.keySet()) @@ -512,9 +492,16 @@ public class SheepGame extends TeamGame return; Scoreboard.WriteBlank(); - Scoreboard.Write(C.Bold + "Next Sheep;"); - Scoreboard.Write(C.cGreen + C.Bold + (int)UtilTime.convert(_sheepDelay - (System.currentTimeMillis() - _sheepTimer), 0, TimeUnit.FIT) + " Seconds"); - + Scoreboard.Write(C.cYellow + C.Bold + "Next Sheep"); + Scoreboard.Write(UtilTime.MakeStr(_sheepDelay - (System.currentTimeMillis() - _sheepTimer), 0)); + + long time = _gameTime + - (System.currentTimeMillis() - this.GetStateTime()); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Time Left"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, time), 0)); + Scoreboard.Draw(); } @@ -629,7 +616,7 @@ public class SheepGame extends TeamGame if (event.getMessage().contains("/giant")) { Giant giant = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Giant.class); - + Entity top = giant; for (int i=0 ; i < 10 ; i++) { @@ -637,11 +624,11 @@ public class SheepGame extends TeamGame top.setPassenger(buffer); top = buffer; } - + top.setPassenger(event.getPlayer()); } } - + @EventHandler public void Invul(CustomDamageEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java index e4eb7342d..04e836555 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java @@ -155,7 +155,7 @@ public class SuperSmash extends SoloGame //Wipe Last Scoreboard.Reset(); - if (GetPlayers(true).size() > 15) + if (GetPlayers(true).size() > 14) { Scoreboard.WriteBlank(); Scoreboard.Write(C.cGreen + "Players Alive"); @@ -167,6 +167,8 @@ public class SuperSmash extends SoloGame } else { + Scoreboard.WriteBlank(); + //Write New for (Player player : GetPlayers(true)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmashTeam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmashTeam.java index 6974acfb8..dfe4b7feb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmashTeam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmashTeam.java @@ -155,7 +155,7 @@ public class SuperSmashTeam extends TeamGame //Wipe Last Scoreboard.Reset(); - if (GetPlayers(true).size() > 15) + if (GetPlayers(true).size() > 14) { for (GameTeam team : this.GetTeamList()) { @@ -171,6 +171,8 @@ public class SuperSmashTeam extends TeamGame } else { + Scoreboard.WriteBlank(); + //Write New for (Player player : GetPlayers(true)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/squidshooter/SquidShooter.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/squidshooter/SquidShooter.java index 2a2d9fc8f..bf8bbcfc3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/squidshooter/SquidShooter.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/squidshooter/SquidShooter.java @@ -24,7 +24,6 @@ import nautilus.game.arcade.kit.Kit; public class SquidShooter extends SoloGame { private ArrayList _ranks = new ArrayList(); - private ArrayList _lastScoreboard = new ArrayList(); public SquidShooter(ArcadeManager manager) { @@ -52,17 +51,7 @@ public class SquidShooter extends SoloGame this.SpawnDistanceRequirement = 16; this.CompassEnabled = true; this.KitRegisterState = GameState.Prepare; - } - - @EventHandler(priority = EventPriority.HIGH) - public void GameStateChange(GameStateChangeEvent event) - { - if (event.GetState() != GameState.Live) - return; - - GetObjectiveSide().setDisplayName(C.cWhite + C.Bold + "First to " + C.cGold + C.Bold + "20 Kills"); - } - + } @EventHandler public void Death(CombatDeathEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 975e20113..8987d2a3b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -78,6 +78,7 @@ import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; +import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.survivalgames.kit.*; @@ -161,6 +162,8 @@ public class SurvivalGames extends SoloGame Manager.GetAntiStack().SetEnabled(false); + this.GameTimeout = 9600000; + this.WorldTimeSet = 0; this.WorldBoundaryKill = false; @@ -1207,17 +1210,8 @@ public class SurvivalGames extends SoloGame long timeLeft = 60000 - (System.currentTimeMillis() - _deathmatchTime); - if (timeLeft > 0) + if (timeLeft <= 0) { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lDeathmatch: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - } - else - { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lDeathmatch"); - _deathmatchLive = true; GetTeamList().get(0).SpawnTeleport(); @@ -1629,4 +1623,70 @@ public class SurvivalGames extends SoloGame { _redChunks.remove(event.getPlayer()); } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + if (GetTeamList().isEmpty()) + return; + + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + + GameTeam team = GetTeamList().get(0); + + if (team.GetPlayers(false).size() < 9) + { + for (Player player : team.GetPlayers(false)) + { + if (team.IsAlive(player)) + { + Scoreboard.Write(C.cGreen + player.getName()); + } + else + { + Scoreboard.Write(C.cGray + player.getName()); + } + } + } + else if (team.GetPlayers(true).size() < 9) + { + for (Player player : team.GetPlayers(true)) + { + Scoreboard.Write(C.cGreen + player.getName()); + } + } + else + { + Scoreboard.Write(C.cGreen + "Players Alive"); + Scoreboard.Write("" + team.GetPlayers(true).size()); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cRed + "Players Dead"); + Scoreboard.Write("" + (team.GetPlayers(false).size() - team.GetPlayers(true).size())); + } + + + if (_deathmatchCountdown) + { + if (event.getType() != UpdateType.TICK) + return; + + long timeLeft = 60000 - (System.currentTimeMillis() - _deathmatchTime); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Deathmatch"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, timeLeft), 0)); + + } + + Scoreboard.Draw(); + } + + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesTeams.java index 584588635..006b335a0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGamesTeams.java @@ -157,6 +157,8 @@ public class SurvivalGamesTeams extends TeamGame Manager.GetAntiStack().SetEnabled(false); + this.GameTimeout = 9600000; + this.WorldTimeSet = 0; this.WorldBoundaryKill = false; @@ -1211,17 +1213,8 @@ public class SurvivalGamesTeams extends TeamGame long timeLeft = 60000 - (System.currentTimeMillis() - _deathmatchTime); - if (timeLeft > 0) + if (timeLeft <= 0) { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lDeathmatch: " + C.cGreen + "§l" - + UtilTime.MakeStr(timeLeft)); - } - else - { - GetObjectiveSide().setDisplayName( - ChatColor.WHITE + "§lDeathmatch"); - _deathmatchLive = true; for (GameTeam team : GetTeamList()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index 251980fae..438b76686 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -413,9 +413,6 @@ public class TurfForts extends TeamGame { time = _buildTime - (System.currentTimeMillis() - _phaseTime); - long displayTime = Math.max(0, time); - GetObjectiveSide().setDisplayName(ChatColor.WHITE + C.Bold + "Build Time " + C.cGreen + C.Bold+ UtilTime.MakeStr(displayTime)); - if (time <= 0) { _fight = true; @@ -434,9 +431,6 @@ public class TurfForts extends TeamGame { time = _fightTime - (System.currentTimeMillis() - _phaseTime); - long displayTime = Math.max(0, time); - GetObjectiveSide().setDisplayName(ChatColor.WHITE + C.Bold + "Combat Time " + C.cGreen + C.Bold+ UtilTime.MakeStr(displayTime)); - if (time <= 0) { _fight = false; @@ -465,19 +459,38 @@ public class TurfForts extends TeamGame if (event.getType() != UpdateType.FAST) return; + Scoreboard.Reset(); + for (GameTeam team : this.GetTeamList()) { - String name = team.GetColor() + team.GetName(); - if (name.length() > 16) - name = name.substring(0, 16); - int lines = 0; if (team.GetColor() == ChatColor.RED) lines = GetRedLines(); else lines = GetBlueLines(); - Score score = GetObjectiveSide().getScore(name); - score.setScore(lines); + Scoreboard.WriteBlank(); + Scoreboard.Write(lines + " " + team.GetColor() + team.GetName()); } + + if (!_fight) + { + long time = _buildTime - (System.currentTimeMillis() - _phaseTime); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Build Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, time), 0)); + + } + + else + { + long time = _fightTime - (System.currentTimeMillis() - _phaseTime); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Combat Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, time), 0)); + } + + Scoreboard.Draw(); } public int GetRedLines() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java index 8d3df9203..4f47b52b5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java @@ -3,38 +3,24 @@ package nautilus.game.arcade.game.games.uhc; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; -import org.bukkit.Chunk; import org.bukkit.Difficulty; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.World.Environment; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Ghast; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; -import org.bukkit.event.entity.EntityCreatePortalEvent; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.CreatureSpawnEvent; -import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityRegainHealthEvent; @@ -44,7 +30,6 @@ import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.event.player.PlayerKickEvent; -import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerQuitEvent; @@ -58,44 +43,41 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; -import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.TimeUtil; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; +import mineplex.core.timing.TimingManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.CombatLog; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.ArcadeFormat; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.GameTeam; -import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.TeamGame; -import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.kit.Kit; -import nautilus.game.arcade.managers.GameLobbyManager; public class UHC extends TeamGame { private NautHashMap _deathTime = new NautHashMap(); - - private int _borderSize = 1250; + private NautHashMap _combatTime = new NautHashMap(); + + private int _borderSize = 1000; private int _gameMinutes = 0; - private int _safeTime = 10; + private int _safeTime = 11; private long _lastMinute = System.currentTimeMillis(); private Objective _scoreObj; @@ -116,7 +98,9 @@ public class UHC extends TeamGame "Last player/team alive wins!" }); - this.DamageTeamSelf = true; + this.GameTimeout = 10800000; + + this.DamagePvP = false; this.DeathDropItems = true; @@ -129,7 +113,7 @@ public class UHC extends TeamGame this.InventoryOpen = true; this.DeathOut = true; - this.QuitOut = true; + this.QuitOut = false; this.CreatureAllow = true; @@ -207,6 +191,29 @@ public class UHC extends TeamGame Announce(ChatColor.WHITE + C.Bold + _gameMinutes + " minutes have passed."); } } + + + @EventHandler + public void EarlyGameUpdate(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.FAST) + return; + + if (DamagePvP) + return; + + WorldData.World.setTime(2000); + + for (Player player : GetPlayers(true)) + { + player.setSaturation(3f); + player.setExhaustion(0f); + player.setFoodLevel(20); + } + } @EventHandler public void GameStart(GameStateChangeEvent event) @@ -233,6 +240,7 @@ public class UHC extends TeamGame } } + /* @EventHandler public void WorldBoundaryCheck(PlayerMoveEvent event) { @@ -252,21 +260,32 @@ public class UHC extends TeamGame Manager.GetCondition().Factory().Poison("Border", event.getPlayer(), event.getPlayer(), 1.9, 0, false, false, false); } } + */ @EventHandler public void WorldBoundaryCheck(UpdateEvent event) { - if (event.getType() != UpdateType.FAST) + if (event.getType() != UpdateType.FASTER) return; for (Player player : GetPlayers(true)) { - if (Math.abs(player.getLocation().getX()) + 5 < _borderSize && Math.abs(player.getLocation().getZ()) + 5 < _borderSize) + //Damage + if (Math.abs(player.getLocation().getX()) > _borderSize || Math.abs(player.getLocation().getZ()) > _borderSize) + { + player.damage(0.75); + } + + //Effect + if (Math.abs(player.getLocation().getX()) + 7 < _borderSize && Math.abs(player.getLocation().getZ()) + 7 < _borderSize) continue; - for (Block block : UtilBlock.getInRadius(player.getLocation(), 5d).keySet()) + for (Block block : UtilBlock.getInRadius(player.getLocation(), 7d).keySet()) { - if (Math.abs(block.getX()) < _borderSize && Math.abs(block .getZ()) + 5 < _borderSize) + if (Math.random() > 0.80) + continue; + + if (Math.abs(block.getX()) < _borderSize && Math.abs(block .getZ()) < _borderSize) continue; if (!UtilBlock.airFoliage(block)) @@ -275,7 +294,10 @@ public class UHC extends TeamGame if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN))) continue; - block.setType(Material.FIRE); + + UtilParticle.PlayParticle(player, ParticleType.EXPLODE, block.getLocation(), (float)Math.random(), (float)Math.random(), (float)Math.random(), 0, 1); + + player.playSound(block.getLocation(), Sound.FIZZ, 0.1f, 0.1f); } } } @@ -334,7 +356,7 @@ public class UHC extends TeamGame team.GetSpawns().clear(); } - TimeUtil.start("UHC Spawn Generation"); + TimingManager.start("UHC Spawn Generation"); //Solo Game if (this.GetTeamList().size() == 1) @@ -404,7 +426,7 @@ public class UHC extends TeamGame team.GetSpawns().add(loc); - while (team.GetSpawns().size() < 5) + while (team.GetSpawns().size() < 20) { Location other = GetRandomSpawn(loc); @@ -413,7 +435,7 @@ public class UHC extends TeamGame } } - TimeUtil.stop("UHC Spawn Generation"); + TimingManager.stop("UHC Spawn Generation"); } public Location GetRandomSpawn(Location around) @@ -438,7 +460,7 @@ public class UHC extends TeamGame //Get Radius Location else { - block = UtilBlock.getHighest(WorldData.World, around.getBlockX() - 5 + UtilMath.r(10), around.getBlockZ() - 5 + UtilMath.r(10), ignore); + block = UtilBlock.getHighest(WorldData.World, around.getBlockX() - 8 + UtilMath.r(16), around.getBlockZ() - 8 + UtilMath.r(16), ignore); } //Check Validity @@ -505,22 +527,22 @@ public class UHC extends TeamGame if (killer != null) { Announce(Manager.GetColor(dead) + C.Bold + dead.getName() + - C.cWhite + C.Bold + " was killed by " + + C.cGray + C.Bold + " was killed by " + Manager.GetColor(killer) + C.Bold + killer.getName() + - C.cWhite + C.Bold + "."); + C.cGray + C.Bold + "."); } else { if (log.GetAttackers().isEmpty()) { Announce(Manager.GetColor(dead) + C.Bold + dead.getName() + - C.cWhite + C.Bold + " has died by unknown causes."); + C.cGray + C.Bold + " has died by unknown causes."); } else { Announce(Manager.GetColor(dead) + C.Bold + dead.getName() + - C.cWhite + C.Bold + " was killed by " + log.GetAttackers().getFirst().GetName() + "."); + C.cGray + C.Bold + " was killed by " + log.GetAttackers().getFirst().GetName() + "."); } } } @@ -540,7 +562,7 @@ public class UHC extends TeamGame continue; _deathTime.remove(player.getName()); - Manager.GetPortal().SendPlayerToServer(player, "Lobby"); + //XXX Need this ? Manager.GetPortal().SendPlayerToServer(player, "Lobby"); } } @@ -550,7 +572,6 @@ public class UHC extends TeamGame event.setLeaveMessage(null); } - /* @EventHandler(priority = EventPriority.LOWEST) public void PlayerQuit(PlayerQuitEvent event) { @@ -567,7 +588,7 @@ public class UHC extends TeamGame if (player.isDead()) return; - XXX + /* if (true) { //Announcement @@ -576,6 +597,7 @@ public class UHC extends TeamGame player.damage(5000); return; } + */ if (_combatTime.containsKey(player.getName()) && !UtilTime.elapsed(_combatTime.get(player.getName()), 15000)) { @@ -586,14 +608,17 @@ public class UHC extends TeamGame return; } } - */ - - @EventHandler - public void DamageCancel(CustomDamageEvent event) + + @EventHandler(priority=EventPriority.MONITOR) + public void DamageRecord(CustomDamageEvent event) { - if (_gameMinutes < _safeTime && event.GetDamagerPlayer(true) != null) + if (event.IsCancelled()) + return; + + if (event.GetDamagerPlayer(true) != null && event.GetDamageePlayer() != null) { - event.SetCancelled("Game Not Started"); + _combatTime.put(event.GetDamageePlayer().getName(), System.currentTimeMillis()); + _combatTime.put(event.GetDamagerPlayer(true).getName(), System.currentTimeMillis()); } } @@ -620,8 +645,11 @@ public class UHC extends TeamGame { ArrayList entList = ents.get(type); int count = 0; + + if (type == EntityType.DROPPED_ITEM) + continue; - while (entList.size() > 400) + while (entList.size() > 500) { Entity ent = entList.remove(UtilMath.r(entList.size())); ent.remove(); @@ -939,11 +967,11 @@ public class UHC extends TeamGame //Solo if (GetTeamList().size() == 1) { - if (GetPlayers(true).size() < 10) + if (GetPlayers(true).size() < 8) { for (Player player : GetPlayers(true)) { - Scoreboard.WriteOrdered("Health", player.getName(), (int)player.getHealth(), true); + Scoreboard.WriteOrdered("Health", player.getName(), GetHealth(player), true); } } else @@ -961,18 +989,18 @@ public class UHC extends TeamGame if (team.IsTeamAlive()) aliveList.add(team); - if (GetPlayers(true).size() < 10) + if (GetPlayers(true).size() < 8) { for (Player player : GetPlayers(true)) { - Scoreboard.WriteOrdered("Health", GetTeam(player).GetColor() + player.getName(), (int)player.getHealth(), true); + Scoreboard.WriteOrdered("Health", GetTeam(player).GetColor() + player.getName(), GetHealth(player), true); } } - else if (aliveList.size() < 10) + else if (aliveList.size() < 8) { for (GameTeam team : aliveList) { - Scoreboard.WriteOrdered("Players", team.GetName(), team.GetPlayers(true).size(), true); + Scoreboard.WriteOrdered("Players", team.GetColor() + team.GetName(), team.GetPlayers(true).size(), true); } } else @@ -982,10 +1010,26 @@ public class UHC extends TeamGame } } + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Time"); + Scoreboard.Write(UtilTime.MakeStr(System.currentTimeMillis() - GetStateTime())); + Scoreboard.WriteBlank(); Scoreboard.Write(C.cYellow + C.Bold + "Borders"); - Scoreboard.Write("+-" + _borderSize); + Scoreboard.Write("-" + _borderSize + " to " + "+" + _borderSize); Scoreboard.Draw(); } + + public int GetHealth(Player player) + { + int health = (int)player.getHealth(); + + if (player.getHealth() % 1d != 0) + { + health += 1; + } + + return health; + } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java index 56aac033b..78a071735 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java @@ -359,8 +359,15 @@ public class ZombieSurvival extends SoloGame if (_survivors == null || _undead == null) return; - GetObjectiveSide().getScore(_survivors.GetColor() + _survivors.GetName()).setScore(_survivors.GetPlayers(true).size()); - GetObjectiveSide().getScore(_undead.GetColor() + _undead.GetName()).setScore(_undead.GetPlayers(true).size()); + Scoreboard.Reset(); + + for (GameTeam team : this.GetTeamList()) + { + Scoreboard.WriteBlank(); + Scoreboard.Write(team.GetPlayers(true).size() + " " + team.GetColor() + team.GetName()); + } + + Scoreboard.Draw(); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java index 48b6f0f5c..7321b86fd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java @@ -106,8 +106,16 @@ public class GameChatManager implements Listener if (Manager.GetClients().Get(receiver).GetRank().Has(Rank.MODERATOR)) continue; + + GameTeam recTeam = Manager.GetGame().GetTeam(receiver); + GameTeam sendTeam = Manager.GetGame().GetTeam(sender); + + if (recTeam == null || sendTeam == null) + { + continue; + } - if (Manager.GetGame().GetTeam(receiver) != null && Manager.GetGame().GetTeam(sender) != Manager.GetGame().GetTeam(receiver)) + if (!recTeam.equals(sendTeam)) recipientIterator.remove(); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 8c161d004..8e7b936e5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -149,41 +149,10 @@ public class GameManager implements Listener } else if (game.GetState() == GameState.Live && !Manager.IsTournamentServer()) { - if (game.GetType() == GameType.Bridge) + if (UtilTime.elapsed(game.GetStateTime(), game.GameTimeout)) { - if (UtilTime.elapsed(game.GetStateTime(), 96000000)) - { - game.SetState(GameState.End); - } + game.SetState(GameState.End); } - else if (game.GetType() == GameType.SurvivalGames) - { - if (UtilTime.elapsed(game.GetStateTime(), 9600000)) - { - game.SetState(GameState.End); - } - } - else if (game.GetType().toString().toLowerCase().contains("teams")) - { - if (UtilTime.elapsed(game.GetStateTime(), 9600000)) - { - game.SetState(GameState.End); - } - } - else if (game.GetType() != GameType.UHC) - { - if (UtilTime.elapsed(game.GetStateTime(), 10800000)) - { - game.SetState(GameState.End); - } - } - else - { - if (UtilTime.elapsed(game.GetStateTime(), 1200000)) - { - game.SetState(GameState.End); - } - } } else if (game.GetState() == GameState.End) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/scoreboard/GameScoreboard.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/scoreboard/GameScoreboard.java index 72f73bbb6..c3ab3c388 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/scoreboard/GameScoreboard.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/scoreboard/GameScoreboard.java @@ -37,7 +37,7 @@ public class GameScoreboard _sideObjective = _scoreboard.registerNewObjective("Obj"+UtilMath.r(999999999), "dummy"); _sideObjective.setDisplaySlot(DisplaySlot.SIDEBAR); - _sideObjective.setDisplayName(C.Bold + game.GetName()); + _sideObjective.setDisplayName(C.Bold + " MINEPLEX "); } public Scoreboard GetScoreboard() diff --git a/Plugins/Nautilus.Game.PvP/.classpath b/Plugins/Nautilus.Game.PvP/.classpath index 2378a7180..aeb789270 100644 --- a/Plugins/Nautilus.Game.PvP/.classpath +++ b/Plugins/Nautilus.Game.PvP/.classpath @@ -2,7 +2,6 @@ -