mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Squid EAR immunity
This commit is contained in:
committed by
granny
parent
bb8ed69b06
commit
c81d37b664
@@ -1,38 +0,0 @@
|
|||||||
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 b5d714f137257810ced4b4457bd5bb01123d3452..0d4eaa2933d2b6501eeb64a0d95b2d4d67fb5523 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -1586,6 +1586,7 @@ public class PurpurWorldConfig {
|
|
||||||
public boolean squidControllable = true;
|
|
||||||
public double squidMaxHealth = 10.0D;
|
|
||||||
public double squidScale = 1.0D;
|
|
||||||
+ public boolean squidImmuneToEAR = true;
|
|
||||||
private void squidSettings() {
|
|
||||||
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
|
||||||
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
|
|
||||||
@@ -1596,6 +1597,7 @@ public class PurpurWorldConfig {
|
|
||||||
}
|
|
||||||
squidMaxHealth = getDouble("mobs.squid.attributes.max_health", squidMaxHealth);
|
|
||||||
squidScale = Mth.clamp(getDouble("mobs.squid.attributes.scale", squidScale), 0.0625D, 16.0D);
|
|
||||||
+ 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 24d7eca3f0b06602a1026eda3432f0a4255d8b01..9d8d0a99f0b2a8e3452c4c86e6c53c66d58c5b3d 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -378,6 +378,7 @@ public class ActivationRange
|
|
||||||
*/
|
|
||||||
public static boolean checkIfActive(Entity entity)
|
|
||||||
{
|
|
||||||
+ if (entity.level().purpurConfig.squidImmuneToEAR && entity instanceof net.minecraft.world.entity.animal.Squid) return true; // Purpur
|
|
||||||
// Never safe to skip fireworks or item gravity
|
|
||||||
if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Paper - Needed for item gravity, see ItemEntity tick
|
|
||||||
return true;
|
|
||||||
@@ -9,3 +9,11 @@
|
|||||||
final int worldHeight = world.getHeight();
|
final int worldHeight = world.getHeight();
|
||||||
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
|
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
|
||||||
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
|
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
|
||||||
|
@@ -282,6 +_,7 @@
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean checkIfActive(final Entity entity) {
|
||||||
|
+ if (entity.level().purpurConfig.squidImmuneToEAR && entity instanceof net.minecraft.world.entity.animal.Squid) return true; // Purpur - Squid EAR immunity
|
||||||
|
// Never safe to skip fireworks or item gravity
|
||||||
|
if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Needed for item gravity, see ItemEntity tick
|
||||||
|
return true;
|
||||||
|
|||||||
@@ -1575,6 +1575,7 @@ public class PurpurWorldConfig {
|
|||||||
public boolean squidControllable = true;
|
public boolean squidControllable = true;
|
||||||
public double squidMaxHealth = 10.0D;
|
public double squidMaxHealth = 10.0D;
|
||||||
public double squidScale = 1.0D;
|
public double squidScale = 1.0D;
|
||||||
|
public boolean squidImmuneToEAR = true;
|
||||||
private void squidSettings() {
|
private void squidSettings() {
|
||||||
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
||||||
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
|
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
|
||||||
@@ -1585,6 +1586,7 @@ public class PurpurWorldConfig {
|
|||||||
}
|
}
|
||||||
squidMaxHealth = getDouble("mobs.squid.attributes.max_health", squidMaxHealth);
|
squidMaxHealth = getDouble("mobs.squid.attributes.max_health", squidMaxHealth);
|
||||||
squidScale = Mth.clamp(getDouble("mobs.squid.attributes.scale", squidScale), 0.0625D, 16.0D);
|
squidScale = Mth.clamp(getDouble("mobs.squid.attributes.scale", squidScale), 0.0625D, 16.0D);
|
||||||
|
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean spiderRidable = false;
|
public boolean spiderRidable = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user