2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -21,6 +21,10 @@
|
2021-03-16 09:00:00 +11:00
|
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
|
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2023-06-24 17:15:05 +10:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
|
|
+// CraftBukkit end
|
2014-11-26 08:32:16 +11:00
|
|
|
+
|
|
|
|
public class EntityWitherSkull extends EntityFireball {
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
private static final DataWatcherObject<Boolean> DATA_DANGEROUS = DataWatcher.defineId(EntityWitherSkull.class, DataWatcherRegistry.BOOLEAN);
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -64,7 +68,7 @@
|
2020-06-25 10:00:00 +10:00
|
|
|
if (entity.isAlive()) {
|
2021-11-22 09:00:00 +11:00
|
|
|
this.doEnchantDamageEffects(entityliving, entity);
|
2020-06-25 10:00:00 +10:00
|
|
|
} else {
|
|
|
|
- entityliving.heal(5.0F);
|
|
|
|
+ entityliving.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
|
2018-07-20 16:04:37 +10:00
|
|
|
}
|
2020-06-25 10:00:00 +10:00
|
|
|
}
|
|
|
|
} else {
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -82,7 +86,7 @@
|
2020-06-25 10:00:00 +10:00
|
|
|
}
|
2018-07-20 16:04:37 +10:00
|
|
|
|
2020-06-25 10:00:00 +10:00
|
|
|
if (b0 > 0) {
|
2023-03-15 03:30:00 +11:00
|
|
|
- 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
|
2014-11-26 08:32:16 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-06 03:40:00 +11:00
|
|
|
@@ -93,7 +97,15 @@
|
2022-12-08 03:00:00 +11:00
|
|
|
protected void onHit(MovingObjectPosition movingobjectposition) {
|
|
|
|
super.onHit(movingobjectposition);
|
2023-06-08 01:30:00 +10:00
|
|
|
if (!this.level().isClientSide) {
|
|
|
|
- this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
|
2014-11-26 08:32:16 +11:00
|
|
|
+ // CraftBukkit start
|
2023-06-08 01:30:00 +10:00
|
|
|
+ // this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
|
2014-11-26 08:32:16 +11:00
|
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
|
2023-06-08 01:30:00 +10:00
|
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(event);
|
2014-11-26 08:32:16 +11:00
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
2023-06-08 01:30:00 +10:00
|
|
|
+ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), World.a.MOB);
|
2014-11-26 08:32:16 +11:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-22 09:00:00 +11:00
|
|
|
this.discard();
|
2014-11-26 08:32:16 +11:00
|
|
|
}
|
|
|
|
|