From 48dd5639d28bfbcdb0d41e47bebbd04cf069a9ea Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 24 Feb 2015 14:38:12 -0500 Subject: [PATCH] Kick banned players from games --- .../src/mineplex/core/portal/Portal.java | 14 ++++++++++++++ .../game/arcade/managers/GameHostManager.java | 11 +++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java index ad20ccd38..f235733e6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java @@ -7,6 +7,7 @@ import java.util.HashSet; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerJoinEvent; @@ -151,6 +152,19 @@ public class Portal extends MiniPlugin addCommand(new ServerCommand(this)); addCommand(new SendCommand(this)); } + + public void sendToHub(Player player, String message) + { + if (message != null) + { + UtilPlayer.message(player, " "); + UtilPlayer.message(player, C.cGold + C.Bold + message); + UtilPlayer.message(player, " "); + } + + player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 10f, 1f); + sendPlayerToServer(player, "Lobby"); + } private void sendPlayer(final Player player, String serverName) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java index e4b505bac..73ffd2fb6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java @@ -398,10 +398,7 @@ public class GameHostManager implements Listener { _blacklist.add(player.getName()); - UtilPlayer.message(player, C.cGold + C.Bold + "You were kicked from this Mineplex Private Server."); - - player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 10f, 1f); - Manager.GetPortal().sendPlayerToServer(player, "Lobby"); + Manager.GetPortal().sendToHub(player, "You were kicked from this Mineplex Private Server."); } public void giveAdmin(Player player) @@ -484,6 +481,12 @@ public class GameHostManager implements Listener { if (!isPrivateServer()) return; + + if (_blacklist.contains(event.getPlayer().getName())) + { + Manager.GetPortal().sendToHub(event.getPlayer(), "You were kicked from this Mineplex Private Server."); + return; + } String serverName = Manager.GetPlugin().getConfig().getString("serverstatus.name"); UtilPlayer.message(event.getPlayer(), ChatColor.BOLD + "Welcome to Mineplex Private Servers!");