mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 23:57:43 +01:00
SPIGOT-5265: FireworkExplodeEvent only fired when rockets explode in air
This commit is contained in:
parent
b2bcde89d9
commit
3fc97f086d
1 changed files with 28 additions and 2 deletions
|
@ -28,7 +28,33 @@
|
|||
}
|
||||
|
||||
}
|
||||
@@ -184,7 +189,9 @@
|
||||
@@ -146,7 +151,11 @@
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY && !this.world.isClientSide) {
|
||||
- this.explode();
|
||||
+ // CraftBukkit start
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
|
||||
+ this.explode();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (this.z) {
|
||||
BlockPosition blockposition;
|
||||
|
||||
@@ -158,7 +167,11 @@
|
||||
|
||||
this.world.getType(blockposition).a(this.world, blockposition, (Entity) this);
|
||||
if (this.l()) {
|
||||
- this.explode();
|
||||
+ // CraftBukkit start
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
|
||||
+ this.explode();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +197,9 @@
|
||||
|
||||
if (f > 0.0F) {
|
||||
if (this.ridingEntity != null) {
|
||||
|
@ -38,7 +64,7 @@
|
|||
}
|
||||
|
||||
double d0 = 5.0D;
|
||||
@@ -211,7 +218,9 @@
|
||||
@@ -211,7 +226,9 @@
|
||||
if (flag) {
|
||||
float f1 = f * (float) Math.sqrt((5.0D - (double) this.g(entityliving)) / 5.0D);
|
||||
|
||||
|
|
Loading…
Reference in a new issue