Removed console output when trying to leave groups when not in one
This commit is contained in:
parent
bfa6d6fa07
commit
44281b3cc0
@ -26,7 +26,7 @@ import com.redstoner.modules.Module;
|
|||||||
*
|
*
|
||||||
* @author Pepich */
|
* @author Pepich */
|
||||||
@AutoRegisterListener
|
@AutoRegisterListener
|
||||||
@Version(major = 1, minor = 3, revision = 1, compatible = 1)
|
@Version(major = 1, minor = 3, revision = 2, compatible = 1)
|
||||||
public class Chatgroups implements Module, Listener
|
public class Chatgroups implements Module, Listener
|
||||||
{
|
{
|
||||||
private static final char defaultKey = ':';
|
private static final char defaultKey = ':';
|
||||||
@ -222,12 +222,18 @@ public class Chatgroups implements Module, Listener
|
|||||||
@Command(hook = "cgleave")
|
@Command(hook = "cgleave")
|
||||||
public boolean cgLeave(CommandSender sender)
|
public boolean cgLeave(CommandSender sender)
|
||||||
{
|
{
|
||||||
|
String group = removeGroup(sender);
|
||||||
|
if (group == null)
|
||||||
|
{
|
||||||
|
Utils.sendErrorMessage(sender, null, "You were not in a chatgroup!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
String name;
|
String name;
|
||||||
if (sender instanceof Player)
|
if (sender instanceof Player)
|
||||||
name = ((Player) sender).getDisplayName();
|
name = ((Player) sender).getDisplayName();
|
||||||
else
|
else
|
||||||
name = sender.getName();
|
name = sender.getName();
|
||||||
sendToGroup(removeGroup(sender), "&9" + name + " &7left the group!");
|
sendToGroup(group, "&9" + name + " &7left the group!");
|
||||||
Utils.sendMessage(sender, null, "Successfully removed you from your group!");
|
Utils.sendMessage(sender, null, "Successfully removed you from your group!");
|
||||||
if (sender instanceof Player)
|
if (sender instanceof Player)
|
||||||
cgtoggled.remove(((Player) sender).getUniqueId());
|
cgtoggled.remove(((Player) sender).getUniqueId());
|
||||||
|
Reference in New Issue
Block a user