mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Fixed shockwave
This commit is contained in:
parent
348c4161ee
commit
e1c0c28a00
@ -63,7 +63,7 @@ public class Shockwave extends EcoEnchant {
|
|||||||
.filter(entity1 -> entity1 != player)
|
.filter(entity1 -> entity1 != player)
|
||||||
.filter(entity1 -> !entity1.hasMetadata("shockwaved"))
|
.filter(entity1 -> !entity1.hasMetadata("shockwaved"))
|
||||||
.forEach((mob -> {
|
.forEach((mob -> {
|
||||||
((LivingEntity) mob).damage(finalDamage, player);
|
((LivingEntity) mob).damage(finalDamage, entity);
|
||||||
mob.setMetadata("shockwaved", this.getPlugin().getMetadataValueFactory().create(true));
|
mob.setMetadata("shockwaved", this.getPlugin().getMetadataValueFactory().create(true));
|
||||||
this.getPlugin().getScheduler().runLater(() -> mob.removeMetadata("shockwaved", this.getPlugin()), 10);
|
this.getPlugin().getScheduler().runLater(() -> mob.removeMetadata("shockwaved", this.getPlugin()), 10);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,10 @@ public class Soulbound extends EcoEnchant {
|
|||||||
assert meta != null;
|
assert meta != null;
|
||||||
meta.getPersistentDataContainer().remove(this.getPlugin().getNamespacedKeyFactory().create("soulbound"));
|
meta.getPersistentDataContainer().remove(this.getPlugin().getNamespacedKeyFactory().create("soulbound"));
|
||||||
soulboundItem.setItemMeta(meta);
|
soulboundItem.setItemMeta(meta);
|
||||||
player.getInventory().addItem(soulboundItem);
|
|
||||||
|
if (!player.getInventory().contains(soulboundItem)) {
|
||||||
|
player.getInventory().addItem(soulboundItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.removeMetadata("soulbound-items", this.getPlugin());
|
player.removeMetadata("soulbound-items", this.getPlugin());
|
||||||
|
Loading…
Reference in New Issue
Block a user