2015-07-27 14:20:54 +02:00
|
|
|
From b83fad21f16c150a9559b077d160e143f491c0e1 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
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
|
2015-02-28 12:36:22 +01:00
|
|
|
index e169184..f0e627b 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -36,8 +36,11 @@ public class EntityWitherSkull extends EntityFireball {
|
2014-07-21 22:46:54 +02:00
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
2015-02-28 12:36:22 +01:00
|
|
|
if (!this.world.isClientSide) {
|
2014-07-21 22:46:54 +02:00
|
|
|
if (movingobjectposition.entity != null) {
|
|
|
|
+ // Spigot start
|
2015-01-25 00:37:00 +01:00
|
|
|
+ boolean didDamage = false;
|
2014-07-21 22:46:54 +02:00
|
|
|
if (this.shooter != null) {
|
2015-01-25 00:37:00 +01:00
|
|
|
- if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit
|
|
|
|
+ didDamage = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F);
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (didDamage) {
|
|
|
|
if (!movingobjectposition.entity.isAlive()) {
|
|
|
|
this.shooter.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
|
|
|
|
} else {
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -45,10 +48,11 @@ public class EntityWitherSkull extends EntityFireball {
|
2014-11-28 02:17:45 +01:00
|
|
|
}
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
- movingobjectposition.entity.damageEntity(DamageSource.MAGIC, 5.0F);
|
|
|
|
+ didDamage = movingobjectposition.entity.damageEntity(DamageSource.MAGIC, 5.0F);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (movingobjectposition.entity instanceof EntityLiving) {
|
|
|
|
+ if (didDamage && movingobjectposition.entity instanceof EntityLiving) {
|
|
|
|
+ // Spigot end
|
|
|
|
byte b0 = 0;
|
|
|
|
|
2014-11-28 02:17:45 +01:00
|
|
|
if (this.world.getDifficulty() == EnumDifficulty.NORMAL) {
|
2014-07-21 22:46:54 +02:00
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|