Files
Purpur/patches/server/0035-Fix-pig-zombies-MC-56653.patch
William Blake Galbreath 2d212d6e78 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
7caed1a8 [CI-SKIP] Rebuild patches
777073a5 Check horse entity validity in container interactions (#2584)
d69fe6c5 Fix zero-tick instant grow farms MC-113809 (#2559)
c68dbb86 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#2576)
1e521994 Update Paperclip
30f9955e Fix race conditions in flush allowing for previously scheduled tasks to execute later than the flush call (#2548)
9e1620e3 Improve save logic (#2485)
72860501 [CI-SKIP] Fix duplicate patch number
87355875 Fix nether portal frame creation (#2546)
26acc9b7 Re-add flat bedrock config option
2019-09-26 11:40:21 -05:00

64 lines
2.9 KiB
Diff

From 731b54cf166d56b856ece3056ad504747b3813c7 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 ++++++++-
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
index 5760a1836..54ccc93f1 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)) {
+ if (net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit) 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);
+ if (!net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit) this.setLastDamager((EntityLiving) entity); // Purpur - fix MC-56653
}
return true;
@@ -207,6 +208,12 @@ public class EntityPigZombie extends EntityZombie {
return this.ef();
}
+ // Purpur start - fix MC-56653
+ protected boolean isDropExperience() {
+ return super.isDropExperience() && (!net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit || getLastDamager() instanceof EntityHuman);
+ }
+ // Purpur end
+
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 538ebb7fd..4ce905aba 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -198,6 +198,11 @@ public class PurpurConfig {
phantomsOrbitCrystalsRadius = getDouble("settings.mobs.phantom.orbit-crystal-radius", phantomsOrbitCrystalsRadius);
}
+ public static boolean pigmenDontTargetUnlessHit = false;
+ private static void pigmenSettings() {
+ pigmenDontTargetUnlessHit = getBoolean("settings.mobs.pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
+ }
+
public static boolean snowmanDropsPumpkin = false;
public static boolean snowmanPumpkinPutBack = false;
private static void snowmansSettings() {
--
2.23.0.rc1