From 8eef4b64496c149bb52b1e0d68a4ee0aea580869 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 23 Feb 2021 19:10:47 +0000 Subject: [PATCH] Fixed shockwave and infernal touch --- .../enchantments/ecoenchants/normal/InfernalTouch.java | 2 +- .../ecoenchants/enchantments/ecoenchants/normal/Shockwave.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java index 3a5b0746..fc86b07f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/InfernalTouch.java @@ -80,7 +80,7 @@ public class InfernalTouch extends EcoEnchant { return; } - if (event.getBlock().getState() instanceof Container) { + if (event.getBlockState() instanceof Container) { return; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java index b97c7215..ef656254 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java @@ -1,6 +1,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; import com.willfp.eco.util.TridentUtils; +import com.willfp.eco.util.integrations.antigrief.AntigriefManager; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -61,6 +62,7 @@ public class Shockwave extends EcoEnchant { .filter(entity1 -> entity1 instanceof LivingEntity) .filter(entity1 -> entity1 != player) .filter(entity1 -> !entity1.hasMetadata("shockwaved")) + .filter(entity1 -> AntigriefManager.canInjure(player, (LivingEntity) entity1)) .forEach((mob -> { ((LivingEntity) mob).damage(finalDamage, entity); mob.setMetadata("shockwaved", this.getPlugin().getMetadataValueFactory().create(true));