From f86119b7c448b46ec6ff18f1120d2818b4c27086 Mon Sep 17 00:00:00 2001 From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:36:53 +0800 Subject: [PATCH] Simplify condition --- ...ufferfish-Dynamic-Activation-of-Brain.patch | 18 +++++++++++++----- .../server/0011-Purpur-Server-Changes.patch | 6 +++--- patches/server/0015-Remove-Timings.patch | 8 ++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch index 9e8a7e4bf..b5553f55d 100644 --- a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch +++ b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch @@ -371,10 +371,18 @@ index 0000000000000000000000000000000000000000..a2e60c43074df560eb01f150bf52b8d0 + } +} diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 0b2f2fbe462ed628ef3d640824d4162e79279089..fe1d053a703b6652485b24ba487d8ebfcbabf28b 100644 +index 0b2f2fbe462ed628ef3d640824d4162e79279089..dce90b9c38ed5734bc3259c4de4387fa862b9c9f 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; +@@ -3,6 +3,7 @@ package org.spigotmc; + import net.minecraft.core.BlockPos; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.ServerChunkCache; ++import net.minecraft.tags.EntityTypeTags; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.ExperienceOrb; + import net.minecraft.world.entity.FlyingMob; +@@ -38,7 +39,6 @@ import co.aikar.timings.MinecraftTimings; import net.minecraft.world.entity.schedule.Activity; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; @@ -382,14 +390,14 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..fe1d053a703b6652485b24ba487d8ebf import org.galemc.gale.configuration.GaleWorldConfiguration; public class ActivationRange -@@ -238,6 +237,26 @@ public class ActivationRange +@@ -238,6 +238,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.getType().is(net.minecraft.tags.EntityTypeTags.AQUATIC) || entity.getType().is(net.minecraft.tags.EntityTypeTags.UNDEAD) || !entity.isInWaterOrBubble())) { // Leaf - Option for dontEnableIfInWater ++ (!org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.dontEnableIfInWater || entity.getType().is(EntityTypeTags.CAN_BREATHE_UNDER_WATER) || !entity.isInWaterOrBubble())) { // Leaf - Option for dontEnableIfInWater + if (!entity.activatedPriorityReset) { + entity.activatedPriorityReset = true; + entity.activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio; @@ -409,7 +417,7 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..fe1d053a703b6652485b24ba487d8ebf } // Paper end } -@@ -254,12 +273,12 @@ public class ActivationRange +@@ -254,12 +274,12 @@ public class ActivationRange if ( MinecraftServer.currentTick > entity.activatedTick ) { if ( entity.defaultActivationState ) diff --git a/patches/server/0011-Purpur-Server-Changes.patch b/patches/server/0011-Purpur-Server-Changes.patch index 60a61dbe4..01e1e2f05 100644 --- a/patches/server/0011-Purpur-Server-Changes.patch +++ b/patches/server/0011-Purpur-Server-Changes.patch @@ -24824,10 +24824,10 @@ 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 fe1d053a703b6652485b24ba487d8ebfcbabf28b..b16970195d560dba9d0b3a258961857008b3550c 100644 +index dce90b9c38ed5734bc3259c4de4387fa862b9c9f..103571f5aa880b0118e1b946e166c86b1e7bf5b5 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -215,6 +215,8 @@ public class ActivationRange +@@ -216,6 +216,8 @@ public class ActivationRange continue; } @@ -24836,7 +24836,7 @@ index fe1d053a703b6652485b24ba487d8ebfcbabf28b..b16970195d560dba9d0b3a2589618570 // Paper start int worldHeight = world.getHeight(); ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange ); -@@ -413,6 +415,7 @@ public class ActivationRange +@@ -414,6 +416,7 @@ public class ActivationRange */ public static boolean checkIfActive(Entity entity) { diff --git a/patches/server/0015-Remove-Timings.patch b/patches/server/0015-Remove-Timings.patch index 83ebc71bf..d89358d74 100644 --- a/patches/server/0015-Remove-Timings.patch +++ b/patches/server/0015-Remove-Timings.patch @@ -1838,10 +1838,10 @@ index 579c2e69d8f6ce8398eb1297d1d1ead98c9068a5..00000000000000000000000000000000 - -} diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index b16970195d560dba9d0b3a258961857008b3550c..0f8987d1fe6a9e4d8e9d984d242797215993a269 100644 +index 103571f5aa880b0118e1b946e166c86b1e7bf5b5..7182d1e8746d094b5fb1e4aaa5ce3b3cb85ab1b5 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; +@@ -35,7 +35,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity; import net.minecraft.world.entity.projectile.ThrowableProjectile; import net.minecraft.world.entity.projectile.ThrownTrident; import net.minecraft.world.entity.raid.Raider; @@ -1849,7 +1849,7 @@ index b16970195d560dba9d0b3a258961857008b3550c..0f8987d1fe6a9e4d8e9d984d24279721 import net.minecraft.world.entity.schedule.Activity; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; -@@ -181,7 +180,6 @@ public class ActivationRange +@@ -182,7 +181,6 @@ public class ActivationRange */ public static void activateEntities(Level world) { @@ -1857,7 +1857,7 @@ index b16970195d560dba9d0b3a258961857008b3550c..0f8987d1fe6a9e4d8e9d984d24279721 final int miscActivationRange = world.spigotConfig.miscActivationRange; final int raiderActivationRange = world.spigotConfig.raiderActivationRange; final int animalActivationRange = world.spigotConfig.animalActivationRange; -@@ -262,7 +260,6 @@ public class ActivationRange +@@ -263,7 +261,6 @@ public class ActivationRange } // Paper end }