Fix phantom flames from setting players on fire if a plugin cancelled the original damage

This commit is contained in:
William Blake Galbreath
2021-07-31 22:34:32 -05:00
parent b7d424b3dc
commit a2340e3381

View File

@@ -5552,7 +5552,7 @@ index 0000000000000000000000000000000000000000..fda24d4ecff91cc28d2a7a45fbb55ea7
+}
diff --git a/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java b/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java
new file mode 100644
index 0000000000000000000000000000000000000000..57b59a12f609fda0787d49575724762362ce12af
index 0000000000000000000000000000000000000000..b196bee2ea6e67897b367d2be1800f16a89a6167
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java
@@ -0,0 +1,114 @@
@@ -5650,8 +5650,8 @@ index 0000000000000000000000000000000000000000..57b59a12f609fda0787d495757247623
+ if (shooter instanceof LivingEntity) {
+ Entity target = entityHitResult.getEntity();
+ if (canGrief || (target instanceof LivingEntity && !(target instanceof ArmorStand))) {
+ target.hurt(DamageSource.indirectMobAttack(this, (LivingEntity) shooter).setProjectile(), level.purpurConfig.phantomFlameDamage);
+ if (level.purpurConfig.phantomFlameFireTime > 0) {
+ boolean hurt = target.hurt(DamageSource.indirectMobAttack(this, (LivingEntity) shooter).setProjectile(), level.purpurConfig.phantomFlameDamage);
+ if (hurt && level.purpurConfig.phantomFlameFireTime > 0) {
+ target.setSecondsOnFire(level.purpurConfig.phantomFlameFireTime);
+ }
+ }