From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 13 Jul 2020 13:49:41 -0500
Subject: [PATCH] Squid EAR immunity


diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 5d35651f43de81c8cf047479ad9c88c4b3f1c38c..32bb2524641722d16b6bafcc6b1af2793c1d9a45 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -453,6 +453,11 @@ public class PurpurWorldConfig {
         snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
     }
 
+    public boolean squidImmuneToEAR = true;
+    private void squidSettings() {
+        squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
+    }
+
     public int villagerBrainTicks = 1;
     public boolean villagerUseBrainTicksOnlyWhenLagging = true;
     public boolean villagerCanBeLeashed = false;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index f2e978107ef1163ceadb3ea7594eba6e900a8a28..05b165f4f2de1f09164c33c0b222dc660c86ebb9 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -377,6 +377,7 @@ public class ActivationRange
      */
     public static boolean checkIfActive(Entity entity)
     {
+        if (entity.world.purpurConfig.squidImmuneToEAR && entity instanceof net.minecraft.server.EntitySquid) return true; // Purpur
         // Never safe to skip fireworks or entities not yet added to chunk
         if ( !entity.inChunk || entity instanceof EntityFireworks ) {
             return true;
