diff --git a/src/com/massivecraft/mcore/MCoreConf.java b/src/com/massivecraft/mcore/MCoreConf.java index 2bd272c4..2c62d85f 100644 --- a/src/com/massivecraft/mcore/MCoreConf.java +++ b/src/com/massivecraft/mcore/MCoreConf.java @@ -40,7 +40,10 @@ public class MCoreConf extends Entity private Map permissionDeniedFormats = MUtil.map( "some.awesome.permission.node", "You must be awesome to %s.", - "some.derp.permission.node", "Only derp people can %s.\nAsk a moderator to become derp." + "some.derp.permission.node.1", "derp", + "some.derp.permission.node.2", "derp", + "some.derp.permission.node.3", "derp", + "derp", "Only derp people can %s.\nAsk a moderator to become derp." ); public Map getPermissionDeniedFormats() { return this.permissionDeniedFormats == null ? new LinkedHashMap() : new LinkedHashMap(this.permissionDeniedFormats); } public void setPermissionDeniedFormats(Map permissionDeniedFormats) { this.permissionDeniedFormats = permissionDeniedFormats == null ? new LinkedHashMap() : new LinkedHashMap(permissionDeniedFormats); this.changed(); } @@ -74,7 +77,11 @@ public class MCoreConf extends Entity public String getPermissionDeniedFormat(String permissionName) { - return this.getPermissionDeniedFormats().get(permissionName); + Map map = this.getPermissionDeniedFormats(); + String ret = map.get(permissionName); + if (ret == null) return null; + ret = MUtil.recurseResolveMap(ret, map); + return ret; } public int getTpdelay(Permissible permissible) diff --git a/src/com/massivecraft/mcore/util/MUtil.java b/src/com/massivecraft/mcore/util/MUtil.java index 443ab60a..29694351 100644 --- a/src/com/massivecraft/mcore/util/MUtil.java +++ b/src/com/massivecraft/mcore/util/MUtil.java @@ -145,6 +145,13 @@ public class MUtil return ret; } + public static T recurseResolveMap(T input, Map map) + { + T output = map.get(input); + if (output == null) return input; + return recurseResolveMap(output, map); + } + // -------------------------------------------- // // LOCATIONS COMPARISON // -------------------------------------------- //