mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-12-01 06:53:26 +01:00
Merge pull request #551 from mxson/disband-arg-less-locale-message
Specify group being disbanded to improve error message
This commit is contained in:
commit
bdf897b64d
@ -59,7 +59,7 @@ public class GroupCommand extends DCommand {
|
|||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
|
|
||||||
if (args[1].equalsIgnoreCase("disband")) {
|
if (args[1].equalsIgnoreCase("disband")) {
|
||||||
disbandGroup(dGroup);
|
disbandGroup(dGroup, null);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else if (args[1].equalsIgnoreCase("show")) {
|
} else if (args[1].equalsIgnoreCase("show")) {
|
||||||
@ -90,7 +90,7 @@ public class GroupCommand extends DCommand {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
} else if (args[1].equalsIgnoreCase("disband") && DPermission.hasPermission(sender, DPermission.GROUP_ADMIN)) {
|
} 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;
|
return;
|
||||||
|
|
||||||
} else if (args[1].equalsIgnoreCase("join")) {
|
} else if (args[1].equalsIgnoreCase("join")) {
|
||||||
@ -135,9 +135,11 @@ public class GroupCommand extends DCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disbandGroup(DGroup dGroup) {
|
public void disbandGroup(DGroup dGroup, String name) {
|
||||||
if (dGroup == null) {
|
if (dGroup == null) { // only gets here
|
||||||
MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_GROUP.getMessage());
|
MessageUtil.sendMessage(sender,
|
||||||
|
name == null ? DMessage.ERROR_SELF_NOT_IN_GROUP.getMessage()
|
||||||
|
: DMessage.ERROR_NO_SUCH_GROUP.getMessage(name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_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_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_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_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_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!"),
|
ERROR_NO_SUCH_PLAYER("Error_NoSuchPlayer", "&4The player &6&v1&4 does not exist!"),
|
||||||
|
Loading…
Reference in New Issue
Block a user