mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 9fe63a16 Update to 1.14.4 (#2333)
47 lines
1.9 KiB
Diff
47 lines
1.9 KiB
Diff
From 28196eef8c75872f29151e8ef55efeb160ed2212 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
|
Subject: [PATCH] Fix pig zombies (MC-56653)
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
index e76842a57b..fa056b8b22 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
@@ -139,6 +139,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
boolean result = super.damageEntity(damagesource, f);
|
|
|
|
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
|
+ this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
|
this.a(entity);
|
|
}
|
|
|
|
@@ -158,7 +159,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
// CraftBukkit end
|
|
this.soundDelay = this.random.nextInt(40);
|
|
if (entity instanceof EntityLiving) {
|
|
- this.setLastDamager((EntityLiving) entity);
|
|
+ //this.setLastDamager((EntityLiving) entity); // Purpur - move up to damageEntity - fix MC-56653
|
|
}
|
|
|
|
return true;
|
|
@@ -207,6 +208,12 @@ public class EntityPigZombie extends EntityZombie {
|
|
return this.ef();
|
|
}
|
|
|
|
+ // Purpur start - only drop exp/items if damaged by player - fix MC-56653
|
|
+ protected boolean isDropExperience() {
|
|
+ return super.isDropExperience() && getLastDamager() instanceof EntityHuman;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
|
|
|
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
|
|
--
|
|
2.20.1
|
|
|