From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 7 Jul 2020 00:22:11 +0100
Subject: [PATCH] Fix exp drop of zombie pigmen (MC-56653)


diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
index 047e7d42ce54aa1cb28cfe8b194bf5c6c75824ad..27599f422be266ad2fdbda49617661801c2c1991 100644
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
@@ -131,6 +131,10 @@ public final class OrigamiConfig {
         private void observerClock() {
             disableObserverClocks = getBoolean("disable-observer-clocks", disableObserverClocks);
         }
+        public boolean pigmenDontTargetUnlessHit = false;
+        private void pigmenDontTargetUnlessHit() {
+            pigmenDontTargetUnlessHit = getBoolean("pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
+        }
     }
 
 }
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
index 736c45bae020158866514bc760c05a929f47c531..bf72577af3c5631116fbcf086a2c681ea4a4e0a2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
@@ -123,7 +123,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
     protected void mobTick() {
         AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
 
-        if (this.isAngry()) {
+        if (this.isAngry() && !this.world.origamiConfig.pigmenDontTargetUnlessHit) { // Origami - fix MC-56653
             if (!this.isBaby() && !attributemodifiable.a(EntityPigZombie.c)) {
                 attributemodifiable.b(EntityPigZombie.c);
             }
