mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
40 lines
2 KiB
Diff
40 lines
2 KiB
Diff
From 25c8300086205e2163676452c9728fa4d6a78c3e 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 ece2b9c..3698ac1 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java
|
|
@@ -42,8 +42,11 @@ public class EntityWitherSkull extends EntityFireball {
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
|
if (!this.world.isClientSide) {
|
|
if (movingobjectposition.entity != null) {
|
|
+ // Spigot start
|
|
+ boolean didDamage = false;
|
|
if (this.shooter != null) {
|
|
- if (movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F)) { // CraftBukkit
|
|
+ didDamage = movingobjectposition.entity.damageEntity(DamageSource.projectile(this, shooter), 8.0F);
|
|
+ if (didDamage) { // CraftBukkit
|
|
if (movingobjectposition.entity.isAlive()) {
|
|
this.a(this.shooter, movingobjectposition.entity);
|
|
} else {
|
|
@@ -51,10 +54,11 @@ public class EntityWitherSkull extends EntityFireball {
|
|
}
|
|
}
|
|
} 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;
|
|
|
|
if (this.world.getDifficulty() == EnumDifficulty.NORMAL) {
|
|
--
|
|
2.9.3
|
|
|