diff --git a/src/main/java/de/erethon/dungeonsxl/command/GroupCommand.java b/src/main/java/de/erethon/dungeonsxl/command/GroupCommand.java index 73e83038..c1984bd2 100644 --- a/src/main/java/de/erethon/dungeonsxl/command/GroupCommand.java +++ b/src/main/java/de/erethon/dungeonsxl/command/GroupCommand.java @@ -59,7 +59,7 @@ public class GroupCommand extends DCommand { if (args.length == 2) { if (args[1].equalsIgnoreCase("disband")) { - disbandGroup(dGroup); + disbandGroup(dGroup, null); return; } else if (args[1].equalsIgnoreCase("show")) { @@ -90,7 +90,7 @@ public class GroupCommand extends DCommand { return; } else if (args[1].equalsIgnoreCase("disband") && DPermission.hasPermission(sender, DPermission.GROUP_ADMIN)) { - disbandGroup(DGroup.getByName(args[2])); + disbandGroup(DGroup.getByName(args[2]), args[2]); return; } else if (args[1].equalsIgnoreCase("join")) { @@ -135,9 +135,11 @@ public class GroupCommand extends DCommand { } } - public void disbandGroup(DGroup dGroup) { - if (dGroup == null) { - MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage()); + public void disbandGroup(DGroup dGroup, String name) { + if (dGroup == null) { // only gets here + MessageUtil.sendMessage(sender, + name == null ? DMessage.ERROR_SELF_NOT_IN_GROUP.getMessage() + : DMessage.ERROR_NO_SUCH_GROUP.getMessage(name)); return; } diff --git a/src/main/java/de/erethon/dungeonsxl/config/DMessage.java b/src/main/java/de/erethon/dungeonsxl/config/DMessage.java index 1bff7421..e017e82a 100644 --- a/src/main/java/de/erethon/dungeonsxl/config/DMessage.java +++ b/src/main/java/de/erethon/dungeonsxl/config/DMessage.java @@ -87,6 +87,7 @@ public enum DMessage implements Message { ERROR_NO_PROTECTED_BLOCK("Error_NoDXLBlock", "&4This is not a block protected by DungeonsXL!"), ERROR_NO_REWARDS_LEFT("Error_NoRewardsLeft", "&4You do not have any item rewards left."), ERROR_NO_REWARDS_TIME("error.noRewardsTime", "&4You cannot receive rewards before &6&v1&4."), + ERROR_SELF_NOT_IN_GROUP("Error_SelfNoGroup", "&4You are not in any group."), ERROR_NO_SUCH_GROUP("Error_NoSuchGroup", "&4The group &6&v1&4 does not exist!"), ERROR_NO_SUCH_MAP("Error_NoSuchMap", "&4The world &6&v1&4 does not exist!"), ERROR_NO_SUCH_PLAYER("Error_NoSuchPlayer", "&4The player &6&v1&4 does not exist!"),