aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch
new file mode 100644
index 0000000000..9fad777d0e
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/WitherSkull.java.patch
@@ -0,0 +1,47 @@
+--- a/net/minecraft/world/entity/projectile/WitherSkull.java
++++ b/net/minecraft/world/entity/projectile/WitherSkull.java
+@@ -20,6 +20,9 @@
+ import net.minecraft.world.level.material.FluidState;
+ import net.minecraft.world.phys.EntityHitResult;
+ import net.minecraft.world.phys.HitResult;
++// CraftBukkit start
++import org.bukkit.event.entity.ExplosionPrimeEvent;
++// CraftBukkit end
+
+ public class WitherSkull extends AbstractHurtingProjectile {
+
+@@ -68,7 +67,7 @@
+ if (entity.isAlive()) {
+ this.doEnchantDamageEffects(livingentity, entity);
+ } else {
+- livingentity.heal(5.0F);
++ entityliving.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
+ }
+ }
+ } else {
+@@ -86,7 +85,7 @@
+ }
+
+ if (b0 > 0) {
+- livingentity.addEffect(new MobEffectInstance(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource());
++ entityliving.addEffect(new MobEffectInstance(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
+ }
+ }
+
+@@ -98,7 +96,15 @@
+ protected void onHit(HitResult hitresult) {
+ super.onHit(hitresult);
+ if (!this.level().isClientSide) {
+- this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, Level.ExplosionInteraction.MOB);
++ // CraftBukkit start
++ // this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
++ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
++ this.level().getCraftServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.a.MOB);
++ }
++ // CraftBukkit end
+ this.discard();
+ }
+