mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Add config option to enable fix for MC-56653
This commit is contained in:
@@ -139,6 +139,11 @@ mobs
|
|||||||
- **default**: false
|
- **default**: false
|
||||||
- **description**: Set whether phantoms spawn naturally in the end
|
- **description**: Set whether phantoms spawn naturally in the end
|
||||||
|
|
||||||
|
* pigmen
|
||||||
|
* dont-target-unless-hit
|
||||||
|
- **default**: false
|
||||||
|
- **description**: Prevent pigmen from targetting players unless they are hit. (fixes MC-56653)
|
||||||
|
|
||||||
* pillager
|
* pillager
|
||||||
* disable-patrols
|
* disable-patrols
|
||||||
- **default**: false
|
- **default**: false
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
From f87b65f9756c515d89036c36f1165eae2625dd9b Mon Sep 17 00:00:00 2001
|
From d7ce83d1ba4d9bd72c224c519bf9b86483389fc1 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
||||||
Subject: [PATCH] Fix pig zombies (MC-56653)
|
Subject: [PATCH] Fix pig zombies (MC-56653)
|
||||||
|
|
||||||
---
|
---
|
||||||
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
||||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
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
|
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||||
index 5760a1836..4a3383cbf 100644
|
index 5760a1836..54ccc93f1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||||
+++ b/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 {
|
@@ -139,6 +139,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||||
boolean result = super.damageEntity(damagesource, f);
|
boolean result = super.damageEntity(damagesource, f);
|
||||||
|
|
||||||
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
||||||
+ this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
+ if (net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit) this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
||||||
this.a(entity);
|
this.a(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ index 5760a1836..4a3383cbf 100644
|
|||||||
this.soundDelay = this.random.nextInt(40);
|
this.soundDelay = this.random.nextInt(40);
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
- this.setLastDamager((EntityLiving) entity);
|
- this.setLastDamager((EntityLiving) entity);
|
||||||
+ //this.setLastDamager((EntityLiving) entity); // Purpur - move up to damageEntity - fix MC-56653
|
+ if (!net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit) this.setLastDamager((EntityLiving) entity); // Purpur - fix MC-56653
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -32,15 +33,31 @@ index 5760a1836..4a3383cbf 100644
|
|||||||
return this.ef();
|
return this.ef();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Purpur start - only drop exp/items if damaged by player - fix MC-56653
|
+ // Purpur start - fix MC-56653
|
||||||
+ protected boolean isDropExperience() {
|
+ protected boolean isDropExperience() {
|
||||||
+ return super.isDropExperience() && getLastDamager() instanceof EntityHuman;
|
+ return super.isDropExperience() && (!net.pl3x.purpur.PurpurConfig.pigmenDontTargetUnlessHit || getLastDamager() instanceof EntityHuman);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||||
|
|
||||||
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
|
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 c7e634ecc..e3362c4dd 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -187,6 +187,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.20.1
|
2.20.1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 89ed1d4a2fd284f22b605416fd768aaec2276702 Mon Sep 17 00:00:00 2001
|
From d033efb623d1a13c9a55617ae3cc454b8919feb7 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Tue, 23 Jul 2019 08:28:21 -0500
|
Date: Tue, 23 Jul 2019 08:28:21 -0500
|
||||||
Subject: [PATCH] Implement configurable villager brain ticks
|
Subject: [PATCH] Implement configurable villager brain ticks
|
||||||
@@ -40,10 +40,10 @@ index 70e8a422a..da3fb4b57 100644
|
|||||||
this.world.getMethodProfiler().exit();
|
this.world.getMethodProfiler().exit();
|
||||||
if (!this.dY() && this.bE > 0) {
|
if (!this.dY() && this.bE > 0) {
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
index f923291fe..3ff26e47b 100644
|
index 6d531306e..29c656c59 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
@@ -209,6 +209,13 @@ public class PurpurConfig {
|
@@ -214,6 +214,13 @@ public class PurpurConfig {
|
||||||
snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 01c1f69df3650e43577f784e416c171d9b42f7d5 Mon Sep 17 00:00:00 2001
|
From dc61bb558c3e0895bdaa05b9b998e2319e3e3bfe Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Sat, 27 Jul 2019 17:20:35 -0500
|
Date: Sat, 27 Jul 2019 17:20:35 -0500
|
||||||
Subject: [PATCH] Add option to disable pillager patrols
|
Subject: [PATCH] Add option to disable pillager patrols
|
||||||
@@ -21,11 +21,11 @@ index bb612b386..99bb38f03 100644
|
|||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
index 3ff26e47b..77a32cf65 100644
|
index 29c656c59..704142198 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
@@ -202,6 +202,11 @@ public class PurpurConfig {
|
@@ -207,6 +207,11 @@ public class PurpurConfig {
|
||||||
phantomsOrbitCrystalsRadius = getDouble("settings.mobs.phantom.orbit-crystal-radius", phantomsOrbitCrystalsRadius);
|
pigmenDontTargetUnlessHit = getBoolean("settings.mobs.pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public static boolean disablePillagerPatrols = false;
|
+ public static boolean disablePillagerPatrols = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user