mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Fix alchemy only POTION
This commit is contained in:
parent
68706e70f6
commit
24185df102
@ -8,6 +8,7 @@ import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityPotionEffectEvent;
|
||||
import org.bukkit.event.entity.EntityPotionEffectEvent.Cause;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -38,6 +39,9 @@ public class Alchemy extends EcoEnchant {
|
||||
if (!(event.getEntity() instanceof LivingEntity entity)) {
|
||||
return;
|
||||
}
|
||||
if (!(event.getCause() == Cause.POTION_DRINK) && !(event.getCause() == Cause.POTION_SPLASH) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity.hasMetadata(event.getNewEffect().toString())) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user