Fix checkinherits command not returning the inheritance data

This commit is contained in:
Luck 2017-08-14 09:38:08 +02:00
parent 82466c2e5d
commit ed15e2838d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public class PermissionCheckInherits extends SharedSubCommand {
} }
String s = Util.formatTristate(result.getResult()); String s = Util.formatTristate(result.getResult());
Message.CHECK_PERMISSION.send(sender, holder.getFriendlyName(), node, s, Util.contextSetToString(context), location); Message.CHECK_INHERITS_PERMISSION.send(sender, holder.getFriendlyName(), node, s, Util.contextSetToString(context), String.valueOf(location));
return CommandResult.SUCCESS; return CommandResult.SUCCESS;
} }

View File

@ -219,6 +219,7 @@ public enum Message {
CONTEXT_PAIR("&8(&7{0}=&f{1}&8)", false), CONTEXT_PAIR("&8(&7{0}=&f{1}&8)", false),
CHECK_PERMISSION("&b{0}&a has permission &b{1}&a set to {2}&a in context {3}&a.", true), CHECK_PERMISSION("&b{0}&a has permission &b{1}&a set to {2}&a in context {3}&a.", true),
CHECK_INHERITS_PERMISSION("&b{0}&a has permission &b{1}&a set to {2}&a in context {3}&a. &7(inherited from &a{4}&7)", true),
SETPERMISSION_SUCCESS("&aSet &b{0}&a to &b{1}&a for &b{2}&a in context {3}&a.", true), SETPERMISSION_SUCCESS("&aSet &b{0}&a to &b{1}&a for &b{2}&a in context {3}&a.", true),
SETPERMISSION_TEMP_SUCCESS("&aSet &b{0}&a to &b{1}&a for &b{2}&a for a duration of &b{3}&a in context {4}&a.", true), SETPERMISSION_TEMP_SUCCESS("&aSet &b{0}&a to &b{1}&a for &b{2}&a for a duration of &b{3}&a in context {4}&a.", true),
UNSETPERMISSION_SUCCESS("&aUnset &b{0}&a for &b{1}&a in context {2}&a.", true), UNSETPERMISSION_SUCCESS("&aUnset &b{0}&a for &b{1}&a in context {2}&a.", true),

View File

@ -983,7 +983,7 @@ public abstract class PermissionHolder {
* @return the result of the lookup * @return the result of the lookup
*/ */
public InheritanceInfo inheritsPermissionInfo(Node node) { public InheritanceInfo inheritsPermissionInfo(Node node) {
for (LocalizedNode n : resolveInheritances(ExtractedContexts.generate(Contexts.allowAll()))) { for (LocalizedNode n : resolveInheritances()) {
if (n.getNode().almostEquals(node)) { if (n.getNode().almostEquals(node)) {
return InheritanceInfo.of(n); return InheritanceInfo.of(n);
} }