Skip to content

Commit

Permalink
Cleanup DAB patch
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Nov 10, 2024
1 parent 6dc2f4e commit 6cd19cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions patches/server/0008-Pufferfish-Dynamic-Activation-of-Brain.patch
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..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;
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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 )
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 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
Expand All @@ -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)
{
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 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;
Expand All @@ -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
}
Expand Down

0 comments on commit 6cd19cb

Please sign in to comment.