From 55d6ef7719c23f8c8fa13ef83c0a3a0d712580ee Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Fri, 15 Jun 2012 11:02:04 +0200 Subject: /vanish [on|off] --- .../essentials/commands/Commandvanish.java | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 2dd0f4ebd..3c5045346 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -16,14 +16,30 @@ public class Commandvanish extends EssentialsCommand @Override protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { - user.toggleVanished(); - if (!user.isVanished()) + if (args.length < 1) { - user.sendMessage(_("unvanished")); + user.toggleVanished(); + if (!user.isVanished()) + { + user.sendMessage(_("unvanished")); + } + else + { + user.sendMessage(_("vanished")); + } } - else + if (args.length > 0) { - user.sendMessage(_("vanished")); + if (args[1].contains("on") && !user.isVanished()) + { + user.toggleVanished(); + user.sendMessage(_("vanished")); + } + if (args[1].contains("off") && user.isVanished()) + { + user.toggleVanished(); + user.sendMessage(_("unvanished")); + } } } } -- cgit v1.2.3