Skip to content

Commit

Permalink
Add tag item.script
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 28, 2015
1 parent 967d473 commit a4acf7a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dItem.java
Expand Up @@ -829,6 +829,24 @@ public String run(Attribute attribute, dObject object) {
}
});

// <--[tag]
// @attribute <i@item.script>
// @returns dScript
// @group scripts
// @description
// Returns the script of the item if it was created by an item script.
// -->
registerTag("script", new TagRunnable() {
@Override
public String run(Attribute attribute, dObject object) {
if (((dItem) object).isItemscript()) {
return new dScript(((dItem) object).getScriptName())
.getAttribute(attribute.fulfill(1));
}
return null;
}
});

registerTag("prefix", new TagRunnable() {
@Override
public String run(Attribute attribute, dObject object) {
Expand Down

0 comments on commit a4acf7a

Please sign in to comment.