SPIGOT-4571: EntityCombustEvent not firing for phantoms

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-01-09 20:38:37 +11:00
parent 5a915978fa
commit ab7419bd7d
5 changed files with 75 additions and 125 deletions

View File

@@ -1,30 +1,6 @@
--- a/net/minecraft/server/EntitySkeletonAbstract.java
+++ b/net/minecraft/server/EntitySkeletonAbstract.java
@@ -3,6 +3,7 @@
import java.time.LocalDate;
import java.time.temporal.ChronoField;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
public abstract class EntitySkeletonAbstract extends EntityMonster implements IRangedEntity {
@@ -78,7 +79,14 @@
}
if (flag) {
- this.setOnFire(8);
+ // CraftBukkit start
+ EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
+ this.world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ this.setOnFire(event.getDuration());
+ }
+ // CraftBukkit end
}
}
@@ -151,8 +159,19 @@
@@ -151,8 +151,19 @@
double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4));