Added AntigriefManager support to Corrosive enchantment

This commit is contained in:
_OfTeN_ 2022-01-24 23:09:01 +03:00
parent f164b76c62
commit c538a007da

View File

@ -1,5 +1,6 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.core.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.DurabilityUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
@ -30,6 +31,12 @@ public class Corrosive extends EcoEnchant {
return;
}
if (attacker instanceof Player player) {
if (!AntigriefManager.canInjure(player, uncastVictim)) {
return;
}
}
ArrayList<ItemStack> armor = new ArrayList<>(Arrays.asList(victim.getInventory().getArmorContents()));
if (armor.isEmpty()) {
return;