Skip to content

Commit

Permalink
Add ID tags to dInventory.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Oct 21, 2013
1 parent 7572f06 commit dd12715
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/main/java/net/aufdemrand/denizen/objects/dInventory.java
Expand Up @@ -695,16 +695,36 @@ public String getAttribute(Attribute attribute) {
}
}

// <--[tag]
// @attribute <in@inventory.id_holder>
// @returns Element
// @description
// Returns Denizen's holder ID for this inventory
// -->
if (attribute.startsWith("id_holder")) {
return new Element(idHolder).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <in@inventory.id_type>
// @returns Element
// @description
// Returns Denizen's type ID for this inventory
// -->
if (attribute.startsWith("id_type")) {
return new Element(idType).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <in@inventory.location>
// @returns dLocation
// @description
// Returns the location of this inventory's holder.
// -->
if (attribute.startsWith("location")) {

return new dLocation(getLocation())
.getAttribute(attribute.fulfill(1));
if (getLocation() != null)
return getLocation().getAttribute(attribute.fulfill(1));
else return "null";
}

// <--[tag]
Expand Down

0 comments on commit dd12715

Please sign in to comment.