0

Fixed cgt outputs

This commit is contained in:
Pepich 2017-02-01 18:58:55 +01:00
parent 9c138be860
commit a1e2911331

View File

@ -75,8 +75,8 @@ public class Chatgroups implements Module, Listener
return "command cgt {\n" + return "command cgt {\n" +
" [string:void...] {\n" + " [string:void...] {\n" +
" help Toggles your cgtoggle status.;\n"+ " help Toggles your cgtoggle status.;\n"+
" run cgtoggle;\n" +
" type player;\n" + " type player;\n" +
" run cgtoggle void;\n" +
" }\n" + " }\n" +
"}\n" + "}\n" +
"command cgkey {\n" + "command cgkey {\n" +
@ -128,10 +128,10 @@ public class Chatgroups implements Module, Listener
ArrayList<String> players = new ArrayList<String>(); ArrayList<String> players = new ArrayList<String>();
for (int i = 0; i < groups.entrySet().size(); i++) for (int i = 0; i < groups.entrySet().size(); i++)
{ {
String t_group = (String) groups.entrySet().toArray(new String[] {})[i]; String t_group = (String) groups.entrySet().toArray(new Object[] {})[i];
if (t_group.equals(group)) if (t_group.equals(group))
{ {
String name = (String) groups.values().toArray(new String[] {})[i]; String name = (String) groups.values().toArray(new Object[] {})[i];
if (!name.equals("CONSOLE")) if (!name.equals("CONSOLE"))
{ {
UUID uuid = UUID.fromString(name); UUID uuid = UUID.fromString(name);
@ -192,21 +192,22 @@ public class Chatgroups implements Module, Listener
/** Let's a Player toggle their auto-cg status to allow for automatically sending chat messages to their chatgroup. /** Let's a Player toggle their auto-cg status to allow for automatically sending chat messages to their chatgroup.
* *
* @param sender * @param sender the issuer of the command.
* @return */ * @param _void ignored.
* @return true. */
@Command(hook = "cgtoggle") @Command(hook = "cgtoggle")
public boolean cgToggleCommand(CommandSender sender) public boolean cgToggleCommand(CommandSender sender, String _void)
{ {
if (getGroup(sender) != null) if (getGroup(sender) != null)
if (cgtoggled.contains(sender)) if (cgtoggled.contains(sender))
{ {
cgtoggled.remove(sender); cgtoggled.remove(sender);
Utils.sendMessage(sender, null, "cgt now §aenabled"); Utils.sendMessage(sender, null, "Cgt now §cdisbled");
} }
else else
{ {
cgtoggled.add(sender); cgtoggled.add(sender);
Utils.sendMessage(sender, null, "cgt now §cdisabled"); Utils.sendMessage(sender, null, "Cgt now §aenabled");
} }
else else
Utils.sendErrorMessage(sender, null, "You are not in a chatgroup!"); Utils.sendErrorMessage(sender, null, "You are not in a chatgroup!");