Fixed charges check for passive enchants

This commit is contained in:
nulli0n 2023-01-23 21:56:59 +06:00
parent 6cdd7b7dfc
commit 3c0473330e

View File

@ -344,6 +344,7 @@ public class EnchantManager extends AbstractManager<ExcellentEnchants> {
EnchantManager.getEquippedEnchants(entity, PassiveEnchant.class).forEach((item, enchants) -> {
enchants.forEach((enchant, level) -> {
if (enchant instanceof Potioned potioned) {
if (enchant.isOutOfCharges(item)) return;
if (enchant.onTrigger(entity, item, level)) {
enchant.consumeCharges(item);
}