Fixed shockwave

This commit is contained in:
Auxilor 2021-01-16 13:14:30 +00:00
parent 348c4161ee
commit e1c0c28a00
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}

View File

@ -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());