From 23d89e254982e48790b338bc7ad7e36902e4ae93 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 14 May 2024 03:34:14 +0200 Subject: [PATCH] Use existing DamageSource of EntityDamageByEntityEvent --- .../java/de/fanta/fancyfirework/listners/FireworkListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/fanta/fancyfirework/listners/FireworkListener.java b/src/main/java/de/fanta/fancyfirework/listners/FireworkListener.java index b32e07b..dcc0e12 100644 --- a/src/main/java/de/fanta/fancyfirework/listners/FireworkListener.java +++ b/src/main/java/de/fanta/fancyfirework/listners/FireworkListener.java @@ -309,8 +309,7 @@ public void onDamage(EntityDamageByEntityEvent e) { List stackList = new ArrayList<>(); stackList.add(stack); stand.setLastDamageCause(e); - DamageSource damageSource = DamageSource.builder(DamageType.PLAYER_ATTACK).withCausingEntity(player).withDirectEntity(player).withDamageLocation(stand.getLocation()).build(); - FireworkDeathEvent fireworkDeathEvent = new FireworkDeathEvent(stand, stackList, damageSource); + FireworkDeathEvent fireworkDeathEvent = new FireworkDeathEvent(stand, stackList, e.getDamageSource()); player.getServer().getPluginManager().callEvent(fireworkDeathEvent); if (fireworkDeathEvent.isCancelled()) { e.setCancelled(true);