summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Ward <chris@chrisgward.com>2013-09-18 22:22:56 +1000
committerChris Ward <chris@chrisgward.com>2013-09-18 22:22:56 +1000
commitf789d310eaca5877db508174192c488f5e844bbb (patch)
treeb288cf9103328183f20d2d5d1be04cffd344350c
parent2ccfc003bf21297127203805c9a256aac93524f0 (diff)
downloadEssentials-f789d310eaca5877db508174192c488f5e844bbb.tar
Essentials-f789d310eaca5877db508174192c488f5e844bbb.tar.gz
Essentials-f789d310eaca5877db508174192c488f5e844bbb.tar.lz
Essentials-f789d310eaca5877db508174192c488f5e844bbb.tar.xz
Essentials-f789d310eaca5877db508174192c488f5e844bbb.zip
Cleanup
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandessentials.java51
1 files changed, 40 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index ae2a368e2..96297ff73 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -175,23 +175,52 @@ public class Commandessentials extends EssentialsCommand
noteBlocks.clear();
}
+
+ private final String[] consoleMoo = new String[] {
+ " (__)",
+ " (oo)",
+ " /------\\/",
+ " / | ||",
+ " * /\\---/\\",
+ " ~~ ~~",
+ "....\"Have you mooed today?\"..."
+ };
+
+ private final String[] playerMoo = new String[] {
+ " (__)",
+ " (oo)",
+ " /------\\/",
+ " / | | |",
+ " * /\\---/\\",
+ " ~~ ~~",
+ "....\"Have you mooed today?\"..."
+ };
private void run_moo(final Server server, final CommandSender sender, final String command, final String args[])
{
- if (sender instanceof ConsoleCommandSender)
+ if(args.length == 2 && args[1].equals("moo"))
{
- sender.sendMessage(new String[]
- {
- " (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..."
- });
+ for(String s : consoleMoo)
+ {
+ logger.info(s);
+ }
+ for(Player player : ess.getServer().getOnlinePlayers())
+ {
+ player.sendMessage(playerMoo);
+ player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
+ }
}
else
{
- sender.sendMessage(new String[]
- {
- " (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..."
- });
- final Player player = (Player)sender;
- player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
+ if (sender instanceof ConsoleCommandSender)
+ {
+ sender.sendMessage(consoleMoo);
+ }
+ else
+ {
+ sender.sendMessage(playerMoo);
+ final Player player = (Player)sender;
+ player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
+ }
}
}