SPIGOT-6193: Allow small fireballs to ignite players when MobGriefing is disabled

By: Sander Knauff <sanderknauff@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2020-10-23 18:29:08 +11:00
parent d719a30af5
commit 834e89eca0

View file

@ -20,25 +20,23 @@
}
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
@@ -24,7 +31,16 @@
@@ -24,7 +31,14 @@
Entity entity1 = this.getShooter();
int i = entity.getFireTicks();
- entity.setOnFire(5);
+ // CraftBukkit start - Entity damage by entity event + combust event
+ if (isIncendiary) {
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
+ entity.world.getServer().getPluginManager().callEvent(event);
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
+ entity.world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ entity.setOnFire(event.getDuration(), false);
+ }
+ if (!event.isCancelled()) {
+ entity.setOnFire(event.getDuration(), false);
+ }
+ // CraftBukkit end
boolean flag = entity.damageEntity(DamageSource.fireball(this, entity1), 5.0F);
if (!flag) {
@@ -43,10 +59,10 @@
@@ -43,10 +57,10 @@
if (!this.world.isClientSide) {
Entity entity = this.getShooter();