aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch b/patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
new file mode 100644
index 0000000000..0554cccc02
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
++++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
+@@ -21,6 +21,10 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+
++// CraftBukkit start
++import org.bukkit.event.entity.ExplosionPrimeEvent;
++// CraftBukkit end
++
+ public class EntityWitherSkull extends EntityFireball {
+
+ private static final DataWatcherObject<Boolean> DATA_DANGEROUS = DataWatcher.defineId(EntityWitherSkull.class, DataWatcherRegistry.BOOLEAN);
+@@ -64,7 +68,7 @@
+ if (entity.isAlive()) {
+ this.doEnchantDamageEffects(entityliving, entity);
+ } else {
+- entityliving.heal(5.0F);
++ entityliving.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
+ }
+ }
+ } else {
+@@ -82,7 +86,7 @@
+ }
+
+ if (b0 > 0) {
+- entityliving.addEffect(new MobEffect(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource());
++ entityliving.addEffect(new MobEffect(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
+ }
+ }
+
+@@ -93,7 +97,15 @@
+ protected void onHit(MovingObjectPosition movingobjectposition) {
+ super.onHit(movingobjectposition);
+ if (!this.level().isClientSide) {
+- this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.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(), World.a.MOB);
++ }
++ // CraftBukkit end
+ this.discard();
+ }
+