From 90e1bc6dd8185e42568e28fc328e61c450969336 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 10 Jan 2013 14:49:59 +1100 Subject: [PATCH] Add Bungee command. --- src/main/java/net/md_5/bungee/BungeeCord.java | 3 ++- .../net/md_5/bungee/command/CommandBungee.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/main/java/net/md_5/bungee/command/CommandBungee.java diff --git a/src/main/java/net/md_5/bungee/BungeeCord.java b/src/main/java/net/md_5/bungee/BungeeCord.java index b1f29aca..b25ef180 100644 --- a/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/src/main/java/net/md_5/bungee/BungeeCord.java @@ -66,7 +66,7 @@ public class BungeeCord /** * Current version. */ - public String version = (getClass().getPackage().getImplementationVersion() == null) ? "unknown" : getClass().getPackage().getImplementationVersion(); + public static String version = (BungeeCord.class.getPackage().getImplementationVersion() == null) ? "unknown" : BungeeCord.class.getPackage().getImplementationVersion(); /** * Fully qualified connections. */ @@ -98,6 +98,7 @@ public class BungeeCord commandMap.put("ip", new CommandIP()); commandMap.put("alert", new CommandAlert()); commandMap.put("motd", new CommandMotd()); + commandMap.put("bungee", new CommandBungee()); } /** diff --git a/src/main/java/net/md_5/bungee/command/CommandBungee.java b/src/main/java/net/md_5/bungee/command/CommandBungee.java new file mode 100644 index 00000000..8ea902df --- /dev/null +++ b/src/main/java/net/md_5/bungee/command/CommandBungee.java @@ -0,0 +1,15 @@ +package net.md_5.bungee.command; + +import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.ChatColor; + +public class CommandBungee extends Command +{ + + @Override + public void execute(CommandSender sender, String[] args) + { + sender.sendMessage(ChatColor.BLUE + "This server is running BungeeCord version " + BungeeCord.version + " by md_5"); + sender.sendMessage(ChatColor.BLUE + "Your current permission level is " + getPermission(sender).name()); + } +}