-
-
Notifications
You must be signed in to change notification settings - Fork 479
Expand file tree
/
Copy path0074-Squid-EAR-immunity.patch
More file actions
46 lines (43 loc) · 2.42 KB
/
Copy path0074-Squid-EAR-immunity.patch
File metadata and controls
46 lines (43 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e813fa037ca17bec29db916eac882cbfab432e56..c87c7feb140864771cbef3dcee1f89319c9a1f83 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1453,6 +1453,7 @@ public class PurpurWorldConfig {
public boolean squidRidable = false;
public boolean squidControllable = true;
public double squidMaxHealth = 10.0D;
+ public boolean squidImmuneToEAR = true;
private void squidSettings() {
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
@@ -1462,6 +1463,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 08b266efbefc45e9b08b2c03a36441a8c7564197..e7c384a8bf16de5132245c24226fff22f5c38585 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -15,6 +15,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;
@@ -402,6 +403,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;