mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 17:07:34 +01:00
Use getBukkitEntity for ExplosionPrimeEvent instead of creating new one
This commit is contained in:
parent
0f708cbf51
commit
ec17d07def
@ -26,7 +26,7 @@
|
||||
|
||||
- this.world.createExplosion((Entity) null, this.locX, this.locY, this.locZ, (float) this.yield, flag, flag);
|
||||
+ // CraftBukkit start - fire ExplosionPrimeEvent
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this));
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
} else {
|
||||
this.at();
|
||||
this.world.addParticle(Particles.M, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||
@@ -76,9 +82,17 @@
|
||||
@@ -76,9 +82,16 @@
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
@ -41,9 +41,8 @@
|
||||
+ // float f = 4.0F;
|
||||
|
||||
- this.world.explode(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, 4.0F, true);
|
||||
+ org.bukkit.craftbukkit.CraftServer server = this.world.getServer();
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this));
|
||||
+ server.getPluginManager().callEvent(event);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, event.getRadius(), event.getFire(), true);
|
||||
|
Loading…
Reference in New Issue
Block a user