Skip to content

Commit

Permalink
Check using EntityTypeTag
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Oct 30, 2024
1 parent aeefea8 commit c0cae8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ index 0000000000000000000000000000000000000000..a2e60c43074df560eb01f150bf52b8d0
+ }
+}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 0b2f2fbe462ed628ef3d640824d4162e79279089..e4c0092179e702ecc8dc6aa345b7fb4cc4ea6ebf 100644
index 0b2f2fbe462ed628ef3d640824d4162e79279089..fe1d053a703b6652485b24ba487d8ebfcbabf28b 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -38,7 +38,6 @@ import co.aikar.timings.MinecraftTimings;
Expand All @@ -382,13 +382,14 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..e4c0092179e702ecc8dc6aa345b7fb4c
import org.galemc.gale.configuration.GaleWorldConfiguration;

public class ActivationRange
@@ -238,6 +237,25 @@ public class ActivationRange
@@ -238,6 +237,26 @@ public class ActivationRange
}
// Paper end - Configurable marker ticking
ActivationRange.activateEntity(entity);
+
+ // Pufferfish start
+ if (org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.enabled && entity.getType().dabEnabled && (!org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.dontEnableIfInWater || entity instanceof WaterAnimal || !entity.isInWaterOrBubble())) { // Leaf - Option for dontEnableIfInWater
+ if (org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.enabled && entity.getType().dabEnabled &&
+ (!org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.dontEnableIfInWater || entity.getType().is(net.minecraft.tags.EntityTypeTags.AQUATIC) || entity.getType().is(net.minecraft.tags.EntityTypeTags.UNDEAD) || !entity.isInWaterOrBubble())) { // Leaf - Option for dontEnableIfInWater
+ if (!entity.activatedPriorityReset) {
+ entity.activatedPriorityReset = true;
+ entity.activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio;
Expand All @@ -408,7 +409,7 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..e4c0092179e702ecc8dc6aa345b7fb4c
}
// Paper end
}
@@ -254,12 +272,12 @@ public class ActivationRange
@@ -254,12 +273,12 @@ public class ActivationRange
if ( MinecraftServer.currentTick > entity.activatedTick )
{
if ( entity.defaultActivationState )
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0011-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24824,7 +24824,7 @@ index 0000000000000000000000000000000000000000..129acb8ad139decc6b1c023cb10bc32d
+ // Paper end - lifecycle events
+}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index e4c0092179e702ecc8dc6aa345b7fb4cc4ea6ebf..ab22da71bcd4bd52eb49f92999459684fb29875e 100644
index fe1d053a703b6652485b24ba487d8ebfcbabf28b..b16970195d560dba9d0b3a258961857008b3550c 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -215,6 +215,8 @@ public class ActivationRange
Expand All @@ -24836,7 +24836,7 @@ index e4c0092179e702ecc8dc6aa345b7fb4cc4ea6ebf..ab22da71bcd4bd52eb49f92999459684
// Paper start
int worldHeight = world.getHeight();
ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange );
@@ -412,6 +414,7 @@ public class ActivationRange
@@ -413,6 +415,7 @@ public class ActivationRange
*/
public static boolean checkIfActive(Entity entity)
{
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0015-Remove-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ index 579c2e69d8f6ce8398eb1297d1d1ead98c9068a5..00000000000000000000000000000000
-
-}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index ab22da71bcd4bd52eb49f92999459684fb29875e..e4731087598dca93d55e7ccb65bf440561ad8a96 100644
index b16970195d560dba9d0b3a258961857008b3550c..0f8987d1fe6a9e4d8e9d984d242797215993a269 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -34,7 +34,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
Expand All @@ -1857,7 +1857,7 @@ index ab22da71bcd4bd52eb49f92999459684fb29875e..e4731087598dca93d55e7ccb65bf4405
final int miscActivationRange = world.spigotConfig.miscActivationRange;
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
final int animalActivationRange = world.spigotConfig.animalActivationRange;
@@ -261,7 +259,6 @@ public class ActivationRange
@@ -262,7 +260,6 @@ public class ActivationRange
}
// Paper end
}
Expand Down

0 comments on commit c0cae8a

Please sign in to comment.