From e1c0c28a0011a7ea2a628e9d649d6a1243906643 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 16 Jan 2021 13:14:30 +0000 Subject: [PATCH] Fixed shockwave --- .../enchantments/ecoenchants/normal/Shockwave.java | 2 +- .../enchantments/ecoenchants/special/Soulbound.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 64fd3b4f..a112682b 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 @@ -63,7 +63,7 @@ public class Shockwave extends EcoEnchant { .filter(entity1 -> entity1 != player) .filter(entity1 -> !entity1.hasMetadata("shockwaved")) .forEach((mob -> { - ((LivingEntity) mob).damage(finalDamage, player); + ((LivingEntity) mob).damage(finalDamage, entity); mob.setMetadata("shockwaved", this.getPlugin().getMetadataValueFactory().create(true)); this.getPlugin().getScheduler().runLater(() -> mob.removeMetadata("shockwaved", this.getPlugin()), 10); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java index a7e2de54..27b53cdf 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java @@ -88,7 +88,10 @@ public class Soulbound extends EcoEnchant { assert meta != null; meta.getPersistentDataContainer().remove(this.getPlugin().getNamespacedKeyFactory().create("soulbound")); soulboundItem.setItemMeta(meta); - player.getInventory().addItem(soulboundItem); + + if (!player.getInventory().contains(soulboundItem)) { + player.getInventory().addItem(soulboundItem); + } } player.removeMetadata("soulbound-items", this.getPlugin());