diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index 17cdc3de4..39dd6db99 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -62,6 +62,11 @@ public class RepairManager extends SkillManager { Player player = getPlayer(); Repairable repairable = mcMMO.getRepairableManager().getRepairable(item.getType()); + if (item.getItemMeta().isUnbreakable()) { + player.sendMessage(LocaleLoader.getString("Anvil.Unbreakable")); + return; + } + // Permissions checks on material and item types if (!Permissions.repairMaterialType(player, repairable.getRepairMaterialType())) { player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission")); diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index 18698dd17..3be2f04c8 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -60,6 +60,11 @@ public class SalvageManager extends SkillManager { Salvageable salvageable = mcMMO.getSalvageableManager().getSalvageable(item.getType()); + if (item.getItemMeta().isUnbreakable()) { + player.sendMessage(LocaleLoader.getString("Anvil.Unbreakable")); + return; + } + // Permissions checks on material and item types if (!Permissions.salvageItemType(player, salvageable.getSalvageItemType())) { player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission")); diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index cd50af3c1..be2f646d4 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -283,6 +283,9 @@ Salvage.Listener.Anvil=[[DARK_RED]]You have placed a Salvage anvil, use this to Salvage.Listener=Salvage: Salvage.SkillName=SALVAGE +#Anvil (Shared between SALVAGE and REPAIR) +Anvil.Unbreakable=This item is unbreakable! + #SWORDS Swords.Ability.Lower=[[GRAY]]**YOU LOWER YOUR SWORD** Swords.Ability.Ready=[[GREEN]]**YOU READY YOUR SWORD**