mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
Fix issues with enchant-based Superbreaker implementation.
This commit is contained in:
parent
e8319aee81
commit
01e26f321d
@ -1,7 +1,6 @@
|
|||||||
package com.gmail.nossr50.skills.utilities;
|
package com.gmail.nossr50.skills.utilities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -553,16 +552,8 @@ public class SkillTools {
|
|||||||
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
||||||
List<String> itemLore = itemMeta.getLore();
|
List<String> itemLore = itemMeta.getLore();
|
||||||
|
|
||||||
for (Iterator<String> loreIterator = itemLore.iterator(); loreIterator.hasNext();) {
|
if (itemLore.remove("mcMMO Ability Tool")) {
|
||||||
String lore = loreIterator.next();
|
if (efficiencyLevel <= 5) {
|
||||||
|
|
||||||
if (lore.equalsIgnoreCase("mcMMO Ability Tool")) {
|
|
||||||
loreIterator.remove();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (efficiencyLevel == 5) {
|
|
||||||
item.removeEnchantment(Enchantment.DIG_SPEED);
|
item.removeEnchantment(Enchantment.DIG_SPEED);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -577,3 +568,4 @@ public class SkillTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user