1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-23 23:39:34 +01:00

feat: add event to wind charge explode ()

* feat: add event to wind charge explode

* fix: use correct parameters

* feat: allow setters to work

* fix: use consts

* Unify paper comments

---------

Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
Mart 2025-03-17 05:54:49 -04:00 committed by GitHub
parent aaaeb4e1e6
commit bb1beda67b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 0 deletions
paper-server/patches/sources/net/minecraft/world/entity/projectile/windcharge

View file

@ -0,0 +1,26 @@
--- a/net/minecraft/world/entity/projectile/windcharge/BreezeWindCharge.java
+++ b/net/minecraft/world/entity/projectile/windcharge/BreezeWindCharge.java
@@ -20,6 +_,12 @@
@Override
public void explode(Vec3 pos) {
+ // Paper start - Fire event for WindCharge explosions
+ org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, RADIUS, false);
+ if (event.isCancelled()) {
+ return;
+ }
+ // Paper end - Fire event for WindCharge explosions
this.level()
.explode(
this,
@@ -28,8 +_,8 @@
pos.x(),
pos.y(),
pos.z(),
- 3.0F,
- false,
+ event.getRadius(), // Paper - Fire event for WindCharge explosions
+ event.getFire(), // Paper - Fire event for WindCharge explosions
Level.ExplosionInteraction.TRIGGER,
ParticleTypes.GUST_EMITTER_SMALL,
ParticleTypes.GUST_EMITTER_LARGE,

View file

@ -0,0 +1,26 @@
--- a/net/minecraft/world/entity/projectile/windcharge/WindCharge.java
+++ b/net/minecraft/world/entity/projectile/windcharge/WindCharge.java
@@ -52,6 +_,12 @@
@Override
public void explode(Vec3 pos) {
+ // Paper start - Fire event for WindCharge explosions
+ org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, RADIUS, false);
+ if (event.isCancelled()) {
+ return;
+ }
+ // Paper end - Fire event for WindCharge explosions
this.level()
.explode(
this,
@@ -60,8 +_,8 @@
pos.x(),
pos.y(),
pos.z(),
- 1.2F,
- false,
+ event.getRadius(), // Paper - Fire event for WindCharge explosions
+ event.getFire(), // Paper - Fire event for WindCharge explosions
Level.ExplosionInteraction.TRIGGER,
ParticleTypes.GUST_EMITTER_SMALL,
ParticleTypes.GUST_EMITTER_LARGE,