mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
68 lines
3.5 KiB
Diff
68 lines
3.5 KiB
Diff
From da674165b50d62d2d433c19f4b50941e06b01782 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] MC-56653 Fix - pig zombies aggro
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 10 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
index 90bf12c735..c78876fc42 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
@@ -170,6 +170,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
boolean result = super.damageEntity(damagesource, f);
|
|
|
|
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
|
+ if (world.purpurConfig.zombiePigmanDontTargetUnlessHit) this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
|
this.i((EntityLiving) entity);
|
|
}
|
|
|
|
@@ -188,7 +189,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
this.angerLevel = event.getNewAnger();
|
|
// CraftBukkit end
|
|
this.soundDelay = this.random.nextInt(40);
|
|
- this.setLastDamager(entityliving);
|
|
+ if (!world.purpurConfig.zombiePigmanDontTargetUnlessHit) this.setLastDamager(entityliving); // Purpur - fix MC-56653
|
|
return true;
|
|
}
|
|
|
|
@@ -230,6 +231,12 @@ public class EntityPigZombie extends EntityZombie {
|
|
return this.eA();
|
|
}
|
|
|
|
+ // Purpur start - fix MC-56653
|
|
+ protected boolean isDropExperience() {
|
|
+ return super.isDropExperience() && (!world.purpurConfig.zombiePigmanDontTargetUnlessHit || getLastDamager() instanceof EntityHuman);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
|
|
|
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 296274896e..7e7f10351b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1013,6 +1013,7 @@ public class PurpurWorldConfig {
|
|
public boolean zombiePigmanJockeyOnlyBaby = true;
|
|
public double zombiePigmanJockeyChance = 0.05D;
|
|
public boolean zombiePigmanJockeyTryExistingChickens = true;
|
|
+ public boolean zombiePigmanDontTargetUnlessHit = false;
|
|
private void zombiePigmanSettings() {
|
|
zombiePigmanRidable = getBoolean("mobs.zombie_pigman.ridable", zombiePigmanRidable);
|
|
zombiePigmanRidableInWater = getBoolean("mobs.zombie_pigman.ridable-in-water", zombiePigmanRidableInWater);
|
|
@@ -1020,6 +1021,7 @@ public class PurpurWorldConfig {
|
|
zombiePigmanJockeyOnlyBaby = getBoolean("mobs.zombie_pigman.jockey.only-babies", zombiePigmanJockeyOnlyBaby);
|
|
zombiePigmanJockeyChance = getDouble("mobs.zombie_pigman.jockey.chance", zombiePigmanJockeyChance);
|
|
zombiePigmanJockeyTryExistingChickens = getBoolean("mobs.zombie_pigman.jockey.try-existing-chickens", zombiePigmanJockeyTryExistingChickens);
|
|
+ zombiePigmanDontTargetUnlessHit = getBoolean("mobs.zombie_pigman.dont-target-unless-hit", zombiePigmanDontTargetUnlessHit);
|
|
}
|
|
|
|
public boolean zombieVillagerRidable = false;
|
|
--
|
|
2.24.0
|
|
|