From 67e844db2988233c3be5256b8a83a136a7ed42b4 Mon Sep 17 00:00:00 2001 From: Virizion <9b717b9d4e5f09e89fa3@gmail.com> Date: Tue, 8 Mar 2016 21:21:53 -0500 Subject: [PATCH] Added /e bridge PC-17 --- .../game/arcade/game/games/bridge/Bridge.java | 6 +++ .../arcade/game/games/event/EventModule.java | 39 +++++++++++++++++++ 2 files changed, 45 insertions(+) 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 d19dc43e7..afec06080 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 @@ -1943,4 +1943,10 @@ public class Bridge extends TeamGame implements OreObsfucation { event.setCancelled(true); } + + public void setBridgeTime(int time) + { + _bridgeTime = time; + } + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index ab4a9495f..379833f82 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -32,6 +32,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.events.PlayerDeathOutEvent; +import nautilus.game.arcade.game.games.bridge.Bridge; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -494,6 +495,44 @@ public class EventModule extends MiniPlugin } } } + else if (args[0].equalsIgnoreCase("bridge")) + { + if (!(Manager.GetGame() instanceof Bridge)) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only drop the bridges in Bridges!")); + return; + } + + if (((Bridge) Manager.GetGame()).isBridgesDown()) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "The bridges have already dropped!")); + return; + } + + int seconds = 10; + + if (args.length > 1) + { + try + { + seconds = Integer.parseInt(args[1]); + } + catch (NumberFormatException e) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "Invalid integer for seconds!")); + return; + } + } + + if (seconds < 0) + { + UtilPlayer.message(event.getPlayer(), F.main("Event", "Seconds must be greater than 0!")); + return; + } + + ((Bridge) Manager.GetGame()).setBridgeTime((int) ((System.currentTimeMillis() - Manager.GetGame().GetStateTime()) + seconds * 1000)); + UtilPlayer.message(event.getPlayer(), F.main("Event", "Bridges will drop in " + F.elem(seconds + " Seconds") + "!")); + } } public void listSettings(Player player)