diff --git a/src/main/java/net/aufdemrand/denizen/objects/dList.java b/src/main/java/net/aufdemrand/denizen/objects/dList.java index bd9c8edba6..a0c07b396c 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dList.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dList.java @@ -253,6 +253,26 @@ public String getAttribute(Attribute attribute) { .getAttribute(attribute.fulfill(1)); } + // <-- + // dList + // returns a new dList excluding the items specified. + // --> + if (attribute.startsWith("exclude")) { + String[] exclusions = attribute.getContext(1).split("\\|"); + // Create a new dList that will contain the exclusions + dList list = new dList(this); + // Iterate through + for (String exclusion : exclusions) + for (String value : list) + // If the value of the list equals the value of the exclusion, + // remove it. + if (value.equalsIgnoreCase(exclusion)) + list.remove(value); + + // Return the modified list + return list.getAttribute(attribute.fulfill(1)); + } + // <-- // -> Element // returns an Element of the value specified by the supplied context.