Browse Source

You can no longer repair/salvage item stacks with more than one item

nossr50 6 years ago
parent
commit
a132172507

+ 4 - 0
Changelog.txt

@@ -1,6 +1,10 @@
 Version 2.1.71
 Version 2.1.71
     Salvage will now always ask for confirmation before breaking your items (instead of only asking for enchanted items)
     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)
     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
 Version 2.1.70
     Added new DatabaseAPI to the API package, has features relating to database operations
     Added new DatabaseAPI to the API package, has features relating to database operations

+ 8 - 2
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -603,7 +603,10 @@ public class PlayerListener implements Listener {
 
 
                 if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) {
                 if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) {
                     /* REPAIR CHECKS */
                     /* 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();
                         RepairManager repairManager = mcMMOPlayer.getRepairManager();
                         event.setCancelled(true);
                         event.setCancelled(true);
 
 
@@ -614,7 +617,10 @@ public class PlayerListener implements Listener {
                         }
                         }
                     }
                     }
                     /* SALVAGE CHECKS */
                     /* 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();
                         SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager();
                         event.setCancelled(true);
                         event.setCancelled(true);
 
 

+ 2 - 0
src/main/java/com/gmail/nossr50/util/MaterialMapStore.java

@@ -410,6 +410,8 @@ public class MaterialMapStore {
         toolBlackList.add("oak_wood");
         toolBlackList.add("oak_wood");
         toolBlackList.add("spruce_log");
         toolBlackList.add("spruce_log");
         toolBlackList.add("spruce_wood");
         toolBlackList.add("spruce_wood");
+        toolBlackList.add("iron_block");
+        toolBlackList.add("gold_block");
     }
     }
 
 
     private void addToHashSet(String string, HashSet<String> stringHashSet)
     private void addToHashSet(String string, HashSet<String> stringHashSet)

+ 1 - 0
src/main/resources/locale/locale_en_US.properties

@@ -54,6 +54,7 @@ JSON.Notification.SuperAbility={0}
 #These are the JSON Strings used for SubSkills
 #These are the JSON Strings used for SubSkills
 JSON.Acrobatics.Roll.Interaction.Activated=Test [[RED]]Rolled Test
 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!
 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
 #DO NOT USE COLOR CODES IN THE JSON KEYS
 #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM
 #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM