Skip to content

Commit

Permalink
add tag material.hardness
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 10, 2019
1 parent 56d5eba commit a066a0b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugin/src/main/java/net/aufdemrand/denizen/objects/dMaterial.java
Expand Up @@ -635,6 +635,25 @@ public String run(Attribute attribute, dObject object) {
}
});

// <--[tag]
// @attribute <m@material.hardness>
// @returns Element(Decimal)
// @description
// Returns the value representing how hard a material, used as a basis for calculating the time it takes to break.
// -->
registerTag("hardness", new TagRunnable() {
@Override
public String run(Attribute attribute, dObject object) {
dMaterial material = (dMaterial) object;
if (!material.getMaterial().isBlock()) {
dB.echoError("Provided material does not have a placeable block.");
return null;
}
return new Element(material.getMaterial().getHardness())
.getAttribute(attribute.fulfill(1));
}
});

// <--[tag]
// @attribute <m@material.max_stack_size>
// @returns Element(Number)
Expand Down

0 comments on commit a066a0b

Please sign in to comment.