mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-23 23:39:34 +01:00
feat: add event to wind charge explode (#12248)
* 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:
parent
aaaeb4e1e6
commit
bb1beda67b
2 changed files with 52 additions and 0 deletions
paper-server/patches/sources/net/minecraft/world/entity/projectile/windcharge
|
@ -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,
|
|
@ -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,
|
Loading…
Add table
Reference in a new issue