Skip to content

Commit

Permalink
Improve apple_enchanted property
Browse files Browse the repository at this point in the history
  • Loading branch information
Fortifier42 committed Nov 26, 2015
1 parent aaa6fcc commit 57fcd64
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -34,7 +34,7 @@ public String getAttribute(Attribute attribute) {

// <--[tag]
// @attribute <i@item.apple_enchanted>
// @returns Element
// @returns Element(Boolean)
// @group properties
// @mechanism dItem.apple_enchanted
// @description
Expand Down Expand Up @@ -75,7 +75,7 @@ public void adjust(Mechanism mechanism) {
// <i@item.apple_enchanted>
// -->

if (mechanism.matches("apple_enchanted")) {
if (mechanism.matches("apple_enchanted") && mechanism.requireBoolean()) {
item.getItemStack().setDurability((short) (mechanism.getValue().asBoolean() ? 1 : 0));
}
}
Expand Down

0 comments on commit 57fcd64

Please sign in to comment.