From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 9 Mar 2021 16:16:01 -0500
Subject: [PATCH] Config to ignore Dragon Head wearers and stare aggro

Prevents Enderman from becoming aggresive towards players that are wearing a Dragon Head.
Adds functionality to a useless item!

diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 6c60253fee2098889292837033396f0dcd75c4b7..df4d5ed5957658ee9ca083ac79b38a1202fe7015 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -197,7 +197,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
         // Paper end
         ItemStack itemstack = (ItemStack) entityhuman.inventory.armor.get(3);
 
-        if (itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem()) {
+        if (world.purpurConfig.endermanDisableStareAggro || itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem() || (world.purpurConfig.endermanIgnorePlayerDragonHead && itemstack.getItem() == Items.DRAGON_HEAD)) { // Purpur
             return false;
         } else {
             Vec3D vec3d = entityhuman.f(1.0F).d();
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 28814c8b5ecab56fca113e741305ac5dc4f49e8c..45c5b7b9e7b207e25d80c008a87b06b91e81668b 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -822,6 +822,8 @@ public class PurpurWorldConfig {
     public double endermanMaxHealth = 40.0D;
     public boolean endermanTakeDamageFromWater = true;
     public boolean endermanAggroSpawnedEndermites = false;
+    public boolean endermanIgnorePlayerDragonHead = false;
+    public boolean endermanDisableStareAggro = false;
     private void endermanSettings() {
         endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
         endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
@@ -836,6 +838,8 @@ public class PurpurWorldConfig {
         endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth);
         endermanTakeDamageFromWater = getBoolean("mobs.enderman.takes-damage-from-water", endermanTakeDamageFromWater);
         endermanAggroSpawnedEndermites = getBoolean("mobs.enderman.aggressive-towards-spawned-endermites", endermanAggroSpawnedEndermites);
+        endermanIgnorePlayerDragonHead = getBoolean("mobs.enderman.ignore-players-wearing-dragon-head", endermanIgnorePlayerDragonHead);
+        endermanDisableStareAggro = getBoolean("mobs.enderman.disable-player-stare-aggression", endermanDisableStareAggro);
     }
 
     public boolean endermiteRidable = false;
