Skip to content

Commit

Permalink
fix inventory.stacks tag
Browse files Browse the repository at this point in the history
Bad fortifier! Not on the inventories!
  • Loading branch information
mcmonkey4eva committed Apr 25, 2016
1 parent bde20c3 commit 4a51d8e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/java/net/aufdemrand/denizen/objects/dInventory.java
Expand Up @@ -1792,12 +1792,18 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName
// Returns the number of itemstacks that match an item if one is
// specified, or the number of all itemstacks if one is not.
// -->
if (attribute.startsWith("stacks") && attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
return new Element(count // TODO: Handle no-script-entry cases
(dItem.valueOf(attribute.getContext(1),
((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getPlayer(),
((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getNPC()).getItemStack(), true))
.getAttribute(attribute.fulfill(1));
if (attribute.startsWith("stacks")) {
if (attribute.hasContext(1) && dItem.matches(attribute.getContext(1))) {
return new Element(count // TODO: Handle no-script-entry cases
(dItem.valueOf(attribute.getContext(1),
((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getPlayer(),
((BukkitScriptEntryData) attribute.getScriptEntry().entryData).getNPC()).getItemStack(), true))
.getAttribute(attribute.fulfill(1));
}
else {
return new Element(count(null, true))
.getAttribute(attribute.fulfill(1));
}
}

// <--[tag]
Expand Down

0 comments on commit 4a51d8e

Please sign in to comment.