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 da1e6d8571caea7c275c48f7eb20c7e698cb2640..519968a57783008234fde804ba007c562d8b928c 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1269,6 +1269,7 @@ public class PurpurWorldConfig {
 
     public boolean squidRidable = false;
     public double squidMaxHealth = 10.0D;
+    public boolean squidImmuneToEAR = true;
     private void squidSettings() {
         squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
         if (PurpurConfig.version < 10) {
@@ -1277,6 +1278,7 @@ public class PurpurWorldConfig {
             set("mobs.squid.attributes.max_health", oldValue);
         }
         squidMaxHealth = getDouble("mobs.squid.attributes.max_health", squidMaxHealth);
+        squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
     }
 
     public boolean spiderRidable = false;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index e58db9acba9fd4f0b7e93ad82ae823c43246fde7..2c13393247d35635dfb038fc987ddd11345615ce 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -14,6 +14,7 @@ import net.minecraft.world.entity.ambient.AmbientCreature;
 import net.minecraft.world.entity.animal.Animal;
 import net.minecraft.world.entity.animal.Bee;
 import net.minecraft.world.entity.animal.Sheep;
+import net.minecraft.world.entity.animal.Squid;
 import net.minecraft.world.entity.animal.WaterAnimal;
 import net.minecraft.world.entity.animal.horse.Llama;
 import net.minecraft.world.entity.boss.EnderDragonPart;
@@ -373,6 +374,7 @@ public class ActivationRange
      */
     public static boolean checkIfActive(Entity entity)
     {
+        if (entity.level.purpurConfig.squidImmuneToEAR && entity instanceof Squid) return true; // Purpur
         // Never safe to skip fireworks or entities not yet added to chunk
         if ( entity instanceof FireworkRocketEntity ) {
             return true;
