mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Add a few more checks for sanity on the new ability buffs.
This commit is contained in:
parent
afe28d54c6
commit
ec8221610a
@ -14,7 +14,6 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.AnvilInventory;
|
||||
import org.bukkit.inventory.FurnaceInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -134,8 +133,6 @@ public class InventoryListener implements Listener{
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onInventoryClickEvent(InventoryClickEvent event) {
|
||||
if (event.getInventory() instanceof AnvilInventory) {
|
||||
SkillTools.removeAbilityBuff(event.getCurrentItem());
|
||||
}
|
||||
SkillTools.removeAbilityBuff(event.getCurrentItem());
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,10 @@ public class PlayerListener implements Listener {
|
||||
|
||||
if (playerProfile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) || playerProfile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
SkillTools.removeAbilityBuff(event.getItemDrop().getItemStack());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,6 +30,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mods.ModChecks;
|
||||
import com.gmail.nossr50.spout.SpoutConfig;
|
||||
import com.gmail.nossr50.spout.SpoutTools;
|
||||
import com.gmail.nossr50.util.ItemChecks;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.ParticleEffectUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
@ -544,6 +545,10 @@ public class SkillTools {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (!ItemChecks.isPickaxe(item) && !ItemChecks.isShovel(item)) {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (item.containsEnchantment(Enchantment.DIG_SPEED)) {
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user