Fix subdivision context with commands.

This commit is contained in:
bloodshot 2020-02-01 19:03:18 -05:00
parent 44fc1c94e6
commit 4ccfda01f9
2 changed files with 10 additions and 2 deletions

View File

@ -115,7 +115,7 @@ public static Set<Context> generateContexts(String permission, CommandSender src
GriefDefenderPlugin.sendMessage(src, TextComponent.of("Invalid context entered."));
return null;
}
final String contextName = parts[0];
final String contextName = parts[0].toLowerCase();
parts = parts[1].split(":");
if (parts.length < 1) {
GriefDefenderPlugin.sendMessage(src, TextComponent.of("Invalid context entered."));
@ -155,6 +155,8 @@ public static Set<Context> generateContexts(String permission, CommandSender src
contextSet.add(ClaimContexts.ADMIN_DEFAULT_CONTEXT);
} else if (arg1.equals("basic")) {
contextSet.add(ClaimContexts.BASIC_DEFAULT_CONTEXT);
} else if (arg1.equals("subdivision")) {
contextSet.add(ClaimContexts.SUBDIVISION_DEFAULT_CONTEXT);
} else if (arg1.equals("town")) {
contextSet.add(ClaimContexts.TOWN_DEFAULT_CONTEXT);
} else if (arg1.equals("wilderness")) {
@ -178,6 +180,8 @@ public static Set<Context> generateContexts(String permission, CommandSender src
contextSet.add(ClaimContexts.ADMIN_OVERRIDE_CONTEXT);
} else if (arg1.equals("basic")) {
contextSet.add(ClaimContexts.BASIC_OVERRIDE_CONTEXT);
} else if (arg1.equals("subdivision")) {
contextSet.add(ClaimContexts.SUBDIVISION_OVERRIDE_CONTEXT);
} else if (arg1.equals("town")) {
contextSet.add(ClaimContexts.TOWN_OVERRIDE_CONTEXT);
} else if (arg1.equals("wilderness")) {

View File

@ -184,7 +184,7 @@ public static Set<Context> generateContexts(String permission, CommandSource src
GriefDefenderPlugin.sendMessage(src, TextComponent.of("Invalid context entered."));
return null;
}
final String contextName = parts[0];
final String contextName = parts[0].toLowerCase();
parts = parts[1].split(":");
if (parts.length < 1) {
GriefDefenderPlugin.sendMessage(src, TextComponent.of("Invalid context entered."));
@ -224,6 +224,8 @@ public static Set<Context> generateContexts(String permission, CommandSource src
contextSet.add(ClaimContexts.ADMIN_DEFAULT_CONTEXT);
} else if (arg1.equals("basic")) {
contextSet.add(ClaimContexts.BASIC_DEFAULT_CONTEXT);
} else if (arg1.equals("subdivision")) {
contextSet.add(ClaimContexts.SUBDIVISION_DEFAULT_CONTEXT);
} else if (arg1.equals("town")) {
contextSet.add(ClaimContexts.TOWN_DEFAULT_CONTEXT);
} else if (arg1.equals("wilderness")) {
@ -247,6 +249,8 @@ public static Set<Context> generateContexts(String permission, CommandSource src
contextSet.add(ClaimContexts.ADMIN_OVERRIDE_CONTEXT);
} else if (arg1.equals("basic")) {
contextSet.add(ClaimContexts.BASIC_OVERRIDE_CONTEXT);
} else if (arg1.equals("subdivision")) {
contextSet.add(ClaimContexts.SUBDIVISION_OVERRIDE_CONTEXT);
} else if (arg1.equals("town")) {
contextSet.add(ClaimContexts.TOWN_OVERRIDE_CONTEXT);
} else if (arg1.equals("wilderness")) {