Fix unbreakable only being set in certain cases
This commit is contained in:
parent
ca2b28e267
commit
bdb005a3c8
@ -290,7 +290,7 @@ public class ArmoredElytraBuilder
|
|||||||
* Whether the output armored elytra should be unbreakable. This defaults to {@link ConfigLoader#unbreakable()}
|
* Whether the output armored elytra should be unbreakable. This defaults to {@link ConfigLoader#unbreakable()}
|
||||||
* when not overridden.
|
* when not overridden.
|
||||||
*/
|
*/
|
||||||
private boolean isUnbreakable;
|
private @Nullable Boolean isUnbreakable = null;
|
||||||
|
|
||||||
private Builder(NBTEditor nbtEditor, DurabilityManager durabilityManager,
|
private Builder(NBTEditor nbtEditor, DurabilityManager durabilityManager,
|
||||||
ConfigLoader config, ArmoredElytra plugin)
|
ConfigLoader config, ArmoredElytra plugin)
|
||||||
@ -309,6 +309,8 @@ public class ArmoredElytraBuilder
|
|||||||
name = name == null ? plugin.getArmoredElytraName(newArmorTier) : name;
|
name = name == null ? plugin.getArmoredElytraName(newArmorTier) : name;
|
||||||
lore = lore == null ? plugin.getElytraLore(newArmorTier) : lore;
|
lore = lore == null ? plugin.getElytraLore(newArmorTier) : lore;
|
||||||
|
|
||||||
|
isUnbreakable = isUnbreakable == null ? config.unbreakable() : isUnbreakable;
|
||||||
|
|
||||||
final ItemStack output = nbtEditor.addArmorNBTTags(newArmoredElytra, newArmorTier,
|
final ItemStack output = nbtEditor.addArmorNBTTags(newArmoredElytra, newArmorTier,
|
||||||
isUnbreakable, name, lore, color);
|
isUnbreakable, name, lore, color);
|
||||||
durabilityManager.setDurability(output, durability, newArmorTier);
|
durabilityManager.setDurability(output, durability, newArmorTier);
|
||||||
@ -379,7 +381,6 @@ public class ArmoredElytraBuilder
|
|||||||
throw new IllegalArgumentException("A regular elytra cannot be combined with an armored one!");
|
throw new IllegalArgumentException("A regular elytra cannot be combined with an armored one!");
|
||||||
|
|
||||||
withColor(getItemColor(newArmoredElytra, item));
|
withColor(getItemColor(newArmoredElytra, item));
|
||||||
unbreakable(config.unbreakable());
|
|
||||||
|
|
||||||
addEnchantments(item);
|
addEnchantments(item);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user