diff --git a/src/com/redstoner/modules/imout/Imout.java b/src/com/redstoner/modules/imout/Imout.java deleted file mode 100644 index f7001fe..0000000 --- a/src/com/redstoner/modules/imout/Imout.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.redstoner.modules.imout; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.nemez.cmdmgr.Command; -import com.redstoner.annotations.Commands; -import com.redstoner.annotations.Version; -import com.redstoner.misc.CommandHolderType; -import com.redstoner.misc.Utils; -import com.redstoner.modules.Module; - -@Commands(CommandHolderType.String) -@Version(major = 4, minor = 0, revision = 0, compatible = 4) -public class Imout implements Module -{ - List imout_toggle_list = new ArrayList(); - - @Command(hook = "imout") - public void onImoutCommand(CommandSender sender) - { - String symbol; - Player s = (Player) sender; - String name = sender.getName(); - if (imout_toggle_list.contains(name)) - { - symbol = "§a§l+"; - getLogger().message(sender, "§eWelcome back! You are no longer hidden", ""); - s.performCommand("vanish off"); - s.performCommand("act off"); - imout_toggle_list.remove(name); - } - else - { - symbol = "§c§l-"; - getLogger().message(sender, "§e§oPoof!§e You are now gone!", ""); - s.performCommand("vanish on"); - s.performCommand("act on"); - imout_toggle_list.add(name); - } - Utils.broadcast(symbol, " §7" + name, null); - } - - // @noformat - @Override - public String getCommandString() - { - return "command imout {\n" + - " [empty] {\n" + - " help Makes you magically disappear;\n" + - " type player;\n" + - " perm utils.imout;\n" + - " run imout;\n" + - " }\n" + - "}"; - } - // @format -} diff --git a/src/com/redstoner/modules/vanish/Vanish.cmd b/src/com/redstoner/modules/vanish/Vanish.cmd new file mode 100644 index 0000000..618a4c1 --- /dev/null +++ b/src/com/redstoner/modules/vanish/Vanish.cmd @@ -0,0 +1,33 @@ +command vanish { + [empty] { + help Toggles your vanish status.; + type player; + run vanish; + perm utils.vanish; + } + on { + help Turns your vanish on.; + type player; + run vanish_on; + perm utils.vanish; + } + off { + help Turns your vanish off.; + type player; + run vanish_off; + perm utils.vanish; + } + [string:name] { + help Toggles someone elses vanish; + run vanish_other name; + perm utils.vanishother; + } +} +command imout { + [empty] { + help Makes you magically disappear; + type player; + perm utils.imout; + run imout; + } +} \ No newline at end of file diff --git a/src/com/redstoner/modules/vanish/Vanish.java b/src/com/redstoner/modules/vanish/Vanish.java index 6ac0d09..d4e57e8 100644 --- a/src/com/redstoner/modules/vanish/Vanish.java +++ b/src/com/redstoner/modules/vanish/Vanish.java @@ -2,6 +2,7 @@ package com.redstoner.modules.vanish; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map.Entry; import java.util.UUID; @@ -23,12 +24,13 @@ import com.redstoner.misc.Utils; import com.redstoner.modules.Module; import com.redstoner.modules.datamanager.DataManager; -@Commands(CommandHolderType.String) +@Commands(CommandHolderType.File) @AutoRegisterListener -@Version(major = 4, minor = 0, revision = 3, compatible = 4) +@Version(major = 4, minor = 1, revision = 0, compatible = 4) public class Vanish implements Module, Listener { private ArrayList vanished = new ArrayList<>(); + List imouted = new ArrayList(); private HashMap> vanishOthers = new HashMap<>(); @Override @@ -141,6 +143,7 @@ public class Vanish implements Module, Listener return true; } + @SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { @@ -209,6 +212,7 @@ public class Vanish implements Module, Listener unvanishPlayer(player); } + @SuppressWarnings("deprecation") private void vanishPlayer(Player player) { for (Player p : Bukkit.getOnlinePlayers()) @@ -220,6 +224,7 @@ public class Vanish implements Module, Listener DataManager.setData(Utils.getID(player), "Seen", "lastquit", System.currentTimeMillis()); } + @SuppressWarnings("deprecation") private void unvanishPlayer(Player player) { for (Player p : Bukkit.getOnlinePlayers()) @@ -228,35 +233,28 @@ public class Vanish implements Module, Listener DataManager.setData(Utils.getID(player), "Seen", "lastjoined", System.currentTimeMillis()); } - // @noformat - @Override - public String getCommandString() + @Command(hook = "imout") + public void onImoutCommand(CommandSender sender) { - return "command vanish {\n" + - " [empty] {\n" + - " help Toggles your vanish status.;\n" + - " type player;\n" + - " run vanish;\n" + - " perm utils.vanish;\n" + - " }\n" + - " on {\n" + - " help Turns your vanish on.;\n" + - " type player;\n" + - " run vanish_on;\n" + - " perm utils.vanish;\n" + - " }\n" + - " off {\n" + - " help Turns your vanish off.;\n" + - " type player;\n" + - " run vanish_off;\n" + - " perm utils.vanish;\n" + - " }\n" + - " [string:name] {\n" + - " help Toggles someone elses vanish;\n" + - " run vanish_other name;\n" + - " perm utils.vanishother;\n" + - " }\n" + - "}"; + String symbol; + Player s = (Player) sender; + String name = sender.getName(); + if (imouted.contains(name)) + { + symbol = "§a§l+"; + getLogger().message(sender, "§eWelcome back! You are no longer hidden", ""); + s.performCommand("vanish off"); + s.performCommand("act off"); + imouted.remove(name); + } + else + { + symbol = "§c§l-"; + getLogger().message(sender, "§e§oPoof!§e You are now gone!", ""); + s.performCommand("vanish on"); + s.performCommand("act on"); + imouted.add(name); + } + Utils.broadcast(symbol, " §7" + name, null); } - // @format }