MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / setDurability

Method setDurability

src/main/java/com/volmit/adapt/util/Items.java:281–287  ·  view source on GitHub ↗

Set the durability (if higher than max, it will be set to the max) @param is the item @param dmg the durability

(ItemStack is, short dmg)

Source from the content-addressed store, hash-verified

279 * @param dmg the durability
280 */
281 public static void setDurability(ItemStack is, short dmg) {
282 if (!is(is)) {
283 return;
284 }
285
286 is.setDurability(dmg > getMaxDurability(is) ? getMaxDurability(is) : dmg);
287 }
288
289 /**
290 * Set the durability (if higher than max, it will be set to the max)

Callers 3

setDurabilityPercentMethod · 0.95
damageMethod · 0.95
getRecipesMethod · 0.80

Calls 2

isMethod · 0.95
getMaxDurabilityMethod · 0.95

Tested by

no test coverage detected