mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
40 lines
1.9 KiB
Diff
40 lines
1.9 KiB
Diff
From 18843061dcc6ae5d2699c28b5b351d5d9a27d739 Mon Sep 17 00:00:00 2001
|
|
From: drXor <mcyoungsota@gmail.com>
|
|
Date: Tue, 25 Feb 2014 15:15:26 -0400
|
|
Subject: [PATCH] Cancellable WitherSkull potion effect
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
index 000a8f95..9610c059 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
@@ -35,8 +35,11 @@ public class EntityWitherSkull extends EntityFireball {
|
|
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
|
|
Entity entity = ((MovingObjectPositionEntity) movingobjectposition).getEntity();
|
|
|
|
+ // Spigot start
|
|
+ boolean didDamage = false;
|
|
if (this.shooter != null) {
|
|
- if (entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit
|
|
+ didDamage = entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F);
|
|
+ if (didDamage) { // CraftBukkit
|
|
if (entity.isAlive()) {
|
|
this.a(this.shooter, entity);
|
|
} else {
|
|
@@ -44,10 +47,11 @@ public class EntityWitherSkull extends EntityFireball {
|
|
}
|
|
}
|
|
} else {
|
|
- entity.damageEntity(DamageSource.MAGIC, 5.0F);
|
|
+ didDamage = entity.damageEntity(DamageSource.MAGIC, 5.0F);
|
|
}
|
|
|
|
- if (entity instanceof EntityLiving) {
|
|
+ if (didDamage && entity instanceof EntityLiving) {
|
|
+ // Spigot end
|
|
byte b0 = 0;
|
|
|
|
if (this.world.getDifficulty() == EnumDifficulty.NORMAL) {
|
|
--
|
|
2.20.1
|
|
|