From a1321725072de9175c443eeef7c0469cebefb294 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 8 Jun 2019 10:20:22 -0700 Subject: [PATCH] You can no longer repair/salvage item stacks with more than one item --- Changelog.txt | 4 ++++ .../com/gmail/nossr50/listeners/PlayerListener.java | 10 ++++++++-- .../java/com/gmail/nossr50/util/MaterialMapStore.java | 2 ++ src/main/resources/locale/locale_en_US.properties | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index c2268bc04..8b76c4e00 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,10 @@ Version 2.1.71 Salvage will now always ask for confirmation before breaking your items (instead of only asking for enchanted items) Repair will now always ask for confirmation before repairing items (instead of only asking for enchanted items) + Gold & Iron Blocks will no longer trigger tool ready messages + Salvage & Repair anvils will no longer work on multi-item stacks + + NOTES: You can still turn the confirmation off in config.yml Version 2.1.70 Added new DatabaseAPI to the API package, has features relating to database operations diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index bb4cee868..ca67ab155 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -603,7 +603,10 @@ public class PlayerListener implements Listener { if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) { /* REPAIR CHECKS */ - if (type == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player) && mcMMO.getRepairableManager().isRepairable(heldItem)) { + if (type == Repair.anvilMaterial + && PrimarySkillType.REPAIR.getPermissions(player) + && mcMMO.getRepairableManager().isRepairable(heldItem) + && heldItem.getAmount() <= 1) { RepairManager repairManager = mcMMOPlayer.getRepairManager(); event.setCancelled(true); @@ -614,7 +617,10 @@ public class PlayerListener implements Listener { } } /* SALVAGE CHECKS */ - else if (type == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player) && mcMMO.getSalvageableManager().isSalvageable(heldItem)) { + else if (type == Salvage.anvilMaterial + && PrimarySkillType.SALVAGE.getPermissions(player) + && mcMMO.getSalvageableManager().isSalvageable(heldItem) + && heldItem.getAmount() <= 1) { SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager(); event.setCancelled(true); diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index b301b517d..c46c2e66e 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -410,6 +410,8 @@ public class MaterialMapStore { toolBlackList.add("oak_wood"); toolBlackList.add("spruce_log"); toolBlackList.add("spruce_wood"); + toolBlackList.add("iron_block"); + toolBlackList.add("gold_block"); } private void addToHashSet(String string, HashSet stringHashSet) diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index fbdcb09d9..47215d079 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -54,6 +54,7 @@ JSON.Notification.SuperAbility={0} #These are the JSON Strings used for SubSkills JSON.Acrobatics.Roll.Interaction.Activated=Test [[RED]]Rolled Test JSON.Acrobatics.SubSkill.Roll.Details.Tips=If you hold sneak while falling you can prevent up to twice the damage that you would normally take! +Anvil.SingleItemStack=[[RED]]You cannot salvage or repair item stacks that have more than one item, split the stack first. #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM