version or plugin command now shows version of clans

This commit is contained in:
NewGarbo 2016-02-04 16:09:13 +00:00
parent b13494f399
commit ecdd21a800

View File

@ -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 MiniClientPlugin<ClientClan>implements 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)
{