Skip to content

Commit

Permalink
Add <e@entity.inventory>
Browse files Browse the repository at this point in the history
Dunno how this hasn't existed
  • Loading branch information
Morphan1 committed Jan 23, 2015
1 parent 86bd9b1 commit 0778b8a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -1392,6 +1392,21 @@ else if (attribute.startsWith("equipment")) {
return new dItem(getLivingEntity().getEquipment().getItemInHand())
.getAttribute(attribute.fulfill(1));

// <--[tag]
// @attribute <e@entity.inventory>
// @returns dInventory
// @group inventory
// @description
// Returns the entity's inventory, if it has one.
// -->
if (attribute.startsWith("inventory")) {
dInventory inventory = getInventory();
if (inventory != null)
return inventory.getAttribute(attribute.fulfill(1));
else
return null;
}


/////////////////////
// LOCATION ATTRIBUTES
Expand All @@ -1400,7 +1415,7 @@ else if (attribute.startsWith("equipment")) {
// <--[tag]
// @attribute <e@entity.map_trace>
// @returns dLocation
// @group inventory
// @group location
// @description
// returns a 2D location indicating where on the map the entity's looking at.
// Each coordinate is in the range of 0 to 128.
Expand Down

0 comments on commit 0778b8a

Please sign in to comment.