Skip to content

Commit

Permalink
Add i@item.simple
Browse files Browse the repository at this point in the history
A simpler identification option
  • Loading branch information
mcmonkey4eva committed Oct 4, 2014
1 parent 0830479 commit eecf276
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/net/aufdemrand/denizen/npc/dNPCRegistry.java
Expand Up @@ -209,7 +209,6 @@ public void onRemove(NPCRemoveEvent event) {
}
dB.log(ChatColor.RED + "Deconstructing Denizen NPC " + npc.getName() + "/" + npc.getId());
FlagManager.clearNPCFlags(npc.getId());
// TODO: Delete flags / etc.
}

@EventHandler
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dItem.java
Expand Up @@ -745,6 +745,16 @@ public String getAttribute(Attribute attribute) {
if (attribute.startsWith("full"))
return new Element(getFullString()).getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <i@item.simple>
// @returns Element
// @group conversion
// @description
// Returns a simple reusable item identification for this item, with minimal extra data.
// -->
if (attribute.startsWith("simple"))
return new Element(identifySimple()).getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <i@item.notable_name>
// @returns Element
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dList.java
Expand Up @@ -747,7 +747,7 @@ public String getAttribute(Attribute attribute) {
// returns the last element in the list.
// If the list is empty, returns null instead.
// EG, a list of "one|two|three" will return "three".
// Effectively equivalent to .get[9999]
// Effectively equivalent to .get[999999]
// -->
if (attribute.startsWith("last")) {
if (size() == 0)
Expand Down

0 comments on commit eecf276

Please sign in to comment.