mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
SPIGOT-6193: Allow small fireballs to ignite players when MobGriefing is disabled
By: Sander Knauff <sanderknauff@hotmail.com>
This commit is contained in:
parent
d719a30af5
commit
834e89eca0
1 changed files with 6 additions and 8 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue