2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -20,6 +20,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
|
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class EntityWitherSkull extends EntityFireball {
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private static final DataWatcherObject<Boolean> DATA_DANGEROUS = DataWatcher.defineId(EntityWitherSkull.class, DataWatcherRegistry.BOOLEAN);
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -63,7 +65,7 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
if (entity.isAlive()) {
|
2021-11-21 23:00:00 +01:00
|
|
|
this.doEnchantDamageEffects(entityliving, entity);
|
2020-06-25 02:00:00 +02:00
|
|
|
} else {
|
|
|
|
- entityliving.heal(5.0F);
|
|
|
|
+ entityliving.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
} else {
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -80,7 +82,7 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
2018-07-20 08:04:37 +02:00
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
if (b0 > 0) {
|
2021-11-21 23:00:00 +01:00
|
|
|
- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource());
|
|
|
|
+ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.WITHER, 20 * b0, 1), this.getEffectSource(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -91,7 +93,15 @@
|
|
|
|
protected void onHit(MovingObjectPosition movingobjectposition) {
|
|
|
|
super.onHit(movingobjectposition);
|
2021-06-11 07:00:00 +02:00
|
|
|
if (!this.level.isClientSide) {
|
2022-12-07 17:00:00 +01:00
|
|
|
- this.level.explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2022-12-07 17:00:00 +01:00
|
|
|
+ // this.level.explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
2022-12-07 17:00:00 +01:00
|
|
|
+ this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), World.a.MOB);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
this.discard();
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|