From ecdd21a800e718df254916dc9141a35806ec84a3 Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Thu, 4 Feb 2016 16:09:13 +0000 Subject: [PATCH] version or plugin command now shows version of clans --- .../game/clans/clans/ClansManager.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 5a0c6d47c..93c394931 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -69,6 +69,7 @@ import mineplex.core.task.TaskManager; import mineplex.core.teleport.Teleport; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import mineplex.game.clans.Clans; import mineplex.game.clans.clans.ClanTips.TipType; import mineplex.game.clans.clans.ClansUtility.ClanRelation; import mineplex.game.clans.clans.commands.ClanManagementCommand; @@ -641,6 +642,23 @@ public class ClansManager extends MiniClientPluginimplements IRelati } } + @EventHandler(priority = EventPriority.HIGHEST) + public void commandPreProcess(PlayerCommandPreprocessEvent event) + { + String[] messages = { "ver", "version", "pl", "plugins"}; + + for (String message : messages) + { + if (!event.getMessage().equalsIgnoreCase("/" + message) && !event.getMessage().startsWith("/" + message + " ")) + { + continue; + } + + UtilPlayer.message(event.getPlayer(), F.main("Clans", "Server is on version: " + F.elem(Clans.version()))); + event.setCancelled(true); + } + } + @EventHandler public void quit(PlayerQuitEvent event) {