From 6cd19cb9cf8a4eba448f8e30f898c3637850710d Mon Sep 17 00:00:00 2001 From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:24:14 +0800 Subject: [PATCH] Cleanup DAB patch --- .../0008-Pufferfish-Dynamic-Activation-of-Brain.patch | 11 ++++------- patches/server/0011-Purpur-Server-Changes.patch | 4 ++-- patches/server/0015-Remove-Timings.patch | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch index 218fcb57f..b9006e0bf 100644 --- a/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch +++ b/patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch @@ -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..e469b2782932275caa4bb760eefff82916c47d3a 100644 +index 5242f861834737876f639195dc259666705411e4..e6ef67125f59195104b013de8f69669a8e059a1f 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; @@ -382,7 +382,7 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..e469b2782932275caa4bb760eefff829 import org.galemc.gale.configuration.GaleWorldConfiguration; public class ActivationRange -@@ -238,6 +237,26 @@ public class ActivationRange +@@ -238,6 +237,23 @@ public class ActivationRange } // Paper end - Configurable marker ticking ActivationRange.activateEntity(entity); @@ -394,10 +394,7 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..e469b2782932275caa4bb760eefff829 + entity.activatedPriorityReset = true; + entity.activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio; + } -+ net.minecraft.world.phys.Vec3 playerVec = player.position(); -+ net.minecraft.world.phys.Vec3 entityVec = entity.position(); -+ double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z; -+ int squaredDistance = (int) (diffX * diffX + diffY * diffY + diffZ * diffZ); ++ int squaredDistance = (int) player.distanceToSqr(entity); + entity.activatedPriority = squaredDistance > org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.startDistanceSquared ? + Math.max(1, Math.min(squaredDistance >> org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.activationDistanceMod, entity.activatedPriority)) : + 1; @@ -409,7 +406,7 @@ index 0b2f2fbe462ed628ef3d640824d4162e79279089..e469b2782932275caa4bb760eefff829 } // Paper end } -@@ -254,12 +273,12 @@ public class ActivationRange +@@ -254,12 +270,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 e32934e86..d0426423c 100644 --- a/patches/server/0011-Purpur-Server-Changes.patch +++ b/patches/server/0011-Purpur-Server-Changes.patch @@ -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 17fe0c5661671a5d7ba7627c41f8e3f6662878b7..5e00b8bfd99680b6a6d48d85e272f62bb61811eb 100644 +index e6ef67125f59195104b013de8f69669a8e059a1f..275ccdf6cd322430ae29b606fdf6af510a62c480 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -215,6 +215,8 @@ public class ActivationRange @@ -24836,7 +24836,7 @@ index 17fe0c5661671a5d7ba7627c41f8e3f6662878b7..5e00b8bfd99680b6a6d48d85e272f62b // Paper start int worldHeight = world.getHeight(); ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange ); -@@ -413,6 +415,7 @@ public class ActivationRange +@@ -410,6 +412,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 edaf59304..96040fef3 100644 --- a/patches/server/0015-Remove-Timings.patch +++ b/patches/server/0015-Remove-Timings.patch @@ -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 5e00b8bfd99680b6a6d48d85e272f62bb61811eb..ebcecc78c475ba9436b894be971c3771ffc80caf 100644 +index 275ccdf6cd322430ae29b606fdf6af510a62c480..4894b7b006e20a383e509b69b6642593478d78c1 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; @@ -1857,7 +1857,7 @@ index 5e00b8bfd99680b6a6d48d85e272f62bb61811eb..ebcecc78c475ba9436b894be971c3771 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 +@@ -259,7 +257,6 @@ public class ActivationRange } // Paper end }