Fixes some savage fail problems
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
Fixes item not being returned when salvage fails Removes some redundancy when giving back items Makes extended salvage return 50% of the salvage (no items if only one item would be returned) Adds a better message when failing to salvage extended salvage items Fixes a bug in the caching of smith presets
This commit is contained in:
@ -83,16 +83,16 @@ public final class ItemHelper {
|
||||
*
|
||||
* @param item <p>The item to update damage for</p>
|
||||
* @param newDamage <p>The new damage done</p>
|
||||
* @return <p>True if the damage was updated. False if not damageable.</p>
|
||||
* @return <p>False if the damage was updated. False if not damageable.</p>
|
||||
*/
|
||||
public static boolean updateDamage(@NotNull ItemStack item, int newDamage) {
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (!(meta instanceof Damageable damageable)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
damageable.setDamage(newDamage);
|
||||
item.setItemMeta(meta);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user