Removes disableMaterialLimitation
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

Removes the disableMaterialLimitation option
Replaces EnchantmentTarget.BREAKABLE.includes(item) with getMaxDurability(item) > 0 as it seems more generic
This commit is contained in:
2023-01-16 19:45:41 +01:00
parent e5cb3b4a30
commit 347b69b2a8
9 changed files with 26 additions and 64 deletions

View File

@ -23,16 +23,14 @@ public final class SalvageHelper {
*
* <p>Note: Only items craft-able in a crafting table are salvageable. Netherite gear is therefore not salvageable.</p>
*
* @param server <p>The server to get recipes from</p>
* @param salvagedItem <p>The item stack to salvage</p>
* @param ignoredSalvage <p>Any material which should not be returned as part of the salvage.</p>
* @param limitationDisabled <p>Whether the repairable item limitation is disabled</p>
* @param server <p>The server to get recipes from</p>
* @param salvagedItem <p>The item stack to salvage</p>
* @param ignoredSalvage <p>Any material which should not be returned as part of the salvage.</p>
* @return <p>The items to return to the user, or null if not salvageable</p>
*/
public static List<ItemStack> getSalvage(Server server, ItemStack salvagedItem, List<Material> ignoredSalvage,
boolean limitationDisabled) {
public static List<ItemStack> getSalvage(Server server, ItemStack salvagedItem, List<Material> ignoredSalvage) {
if (salvagedItem == null || salvagedItem.getAmount() < 1 ||
!ItemHelper.isRepairable(salvagedItem, limitationDisabled)) {
!ItemHelper.isRepairable(salvagedItem)) {
return null;
}