Removes disableMaterialLimitation
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
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:
@ -49,15 +49,7 @@ public enum GlobalSetting {
|
||||
* The cost for repairing a damaged anvil
|
||||
*/
|
||||
ANVIL_DAMAGED_COST("global.damagedAnvilReforgingCost", SettingValueType.POSITIVE_DOUBLE, 20.0,
|
||||
"damagedAnvilReforgingCost"),
|
||||
|
||||
/**
|
||||
* Whether to disable the normal limitation for which items are reforgeAble
|
||||
*
|
||||
* <p>If true, all items instanceof Damageable can be reforged</p>
|
||||
*/
|
||||
DISABLE_MATERIAL_LIMITATION("global.disableMaterialLimitation", SettingValueType.BOOLEAN, false,
|
||||
"disableMaterialLimitation");
|
||||
"damagedAnvilReforgingCost");
|
||||
|
||||
private final String path;
|
||||
private final String parent;
|
||||
|
@ -295,15 +295,6 @@ public class GlobalSettings {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to disable the "EnchantmentTarget.BREAKABLE" limitation
|
||||
*
|
||||
* @return <p>True if the material limitation is disabled</p>
|
||||
*/
|
||||
public boolean disableMaterialLimitation() {
|
||||
return asBoolean(GlobalSetting.DISABLE_MATERIAL_LIMITATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the given value as a boolean
|
||||
*
|
||||
|
@ -460,8 +460,7 @@ public class NPCSettings {
|
||||
}
|
||||
|
||||
Material material = InputParsingHelper.matchMaterial(item);
|
||||
boolean limitationDisabled = BlacksmithPlugin.getInstance().getSettings().disableMaterialLimitation();
|
||||
if (material != null && ItemHelper.isRepairable(new ItemStack(material, 1), limitationDisabled)) {
|
||||
if (material != null && ItemHelper.isRepairable(new ItemStack(material, 1))) {
|
||||
if (!blacklist) {
|
||||
reforgeAbleItems.add(material);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user