mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-29 16:15:17 +01:00
Prevented Incandescence working from thorns damage
This commit is contained in:
parent
1a69a548f9
commit
f894572e34
@ -9,6 +9,7 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class Incandescence extends EcoEnchant {
|
public class Incandescence extends EcoEnchant {
|
||||||
@ -19,6 +20,10 @@ public class Incandescence extends EcoEnchant {
|
|||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onIncandescenceHurt(@NotNull final EntityDamageByEntityEvent event) {
|
public void onIncandescenceHurt(@NotNull final EntityDamageByEntityEvent event) {
|
||||||
|
if (event.getCause() == EntityDamageEvent.DamageCause.THORNS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Player)) {
|
if (!(event.getEntity() instanceof Player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user