2018-07-22 12:00:00 +10:00
|
|
|
From f21970bbc19a03a0513a2f503cbce4488429e334 Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10: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
|
2018-07-22 12:00:00 +10:00
|
|
|
index 8249bf112..0103837ab 100644
|
2014-04-12 14:18:37 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
2018-07-15 10:00:00 +10:00
|
|
|
@@ -29,8 +29,11 @@ public class EntityWitherSkull extends EntityFireball {
|
2014-04-12 14:18:37 +10:00
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
2015-02-28 11:36:22 +00:00
|
|
|
if (!this.world.isClientSide) {
|
2014-04-12 14:18:37 +10:00
|
|
|
if (movingobjectposition.entity != null) {
|
|
|
|
+ // Spigot start
|
2015-01-25 10:37:00 +11:00
|
|
|
+ boolean didDamage = false;
|
2014-04-12 14:18:37 +10:00
|
|
|
if (this.shooter != null) {
|
2015-01-25 10:37:00 +11:00
|
|
|
- if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit
|
|
|
|
+ didDamage = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F);
|
2016-06-09 11:43:56 +10:00
|
|
|
+ if (didDamage) { // CraftBukkit
|
|
|
|
if (movingobjectposition.entity.isAlive()) {
|
|
|
|
this.a(this.shooter, movingobjectposition.entity);
|
2014-11-26 08:27:08 +11:00
|
|
|
} else {
|
2018-07-15 10:00:00 +10:00
|
|
|
@@ -38,10 +41,11 @@ public class EntityWitherSkull extends EntityFireball {
|
2014-11-26 08:27:08 +11:00
|
|
|
}
|
2014-04-12 14:18:37 +10: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-26 08:27:08 +11:00
|
|
|
if (this.world.getDifficulty() == EnumDifficulty.NORMAL) {
|
2014-04-12 14:18:37 +10:00
|
|
|
--
|
2018-07-15 10:00:00 +10:00
|
|
|
2.17.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|