diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java index 438f626c..b6c84c5f 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java @@ -186,10 +186,9 @@ public class GroupCommand extends BRCommand { return; } - for (DGroup anyDGroup : plugin.getDGroups()) { - if (anyDGroup.getPlayers().contains(player)) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); - } + if (DGroup.getByPlayer(player) != null) { + MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); + return; } if (!dGroup.getInvitedPlayers().contains(player) && !player.hasPermission("dxl.bypass")) {