From e8f01f89d2d1c0fd47927954debc05b30d7ae8c5 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 25 Nov 2021 18:18:57 +0100 Subject: [PATCH] Rename optimize isOutsideRange patch --- ...ayerCloseEnoughForSpawning-to-use-distance-maps.patch} | 8 ++++---- todo.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) rename patches/server/{0432-Optimize-isOutsideRange-to-use-distance-maps.patch => 0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch} (98%) diff --git a/patches/server/0432-Optimize-isOutsideRange-to-use-distance-maps.patch b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch similarity index 98% rename from patches/server/0432-Optimize-isOutsideRange-to-use-distance-maps.patch rename to patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch index bc8faac338..344e0dff3d 100644 --- a/patches/server/0432-Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 5 May 2020 20:40:53 -0700 -Subject: [PATCH] Optimize isOutsideRange to use distance maps +Subject: [PATCH] Optimize anyPlayerCloseEnoughForSpawning to use distance maps Use a distance map to find the players in range quickly @@ -37,7 +37,7 @@ index 51175994b37e966af8983df1f15a0fc5a638a0b5..347cf5d00d986ae8ad60af7f6eabde9f // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..4aad2cee76f4368f607475425c5bf516f51f830d 100644 +index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..344d18b91a9a5d1c0d55d3a0a12073246de24046 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -176,21 +176,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -181,7 +181,7 @@ index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..4aad2cee76f4368f607475425c5bf516 - if (event == null || event.isCancelled()) return false; - blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); + // don't check spectator and whatnot, already handled by mob spawn map update -+ if (this.playerIsCloseEnoughForSpawning(player, chunkcoordintpair, player.lastEntitySpawnRadiusSquared)) { ++ if (euclideanDistanceSquared(chunkcoordintpair, player) < player.lastEntitySpawnRadiusSquared) { + return true; // in range } - // Paper end @@ -198,7 +198,7 @@ index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..4aad2cee76f4368f607475425c5bf516 + continue; + } + // don't check spectator and whatnot, already handled by mob spawn map update -+ if (this.playerIsCloseEnoughForSpawning(player, chunkcoordintpair, range)) { ++ if (euclideanDistanceSquared(chunkcoordintpair, player) < range) { + return true; // in range + } + } diff --git a/todo.txt b/todo.txt index a563b5f0e2..3b6115f7d1 100644 --- a/todo.txt +++ b/todo.txt @@ -6,6 +6,7 @@ Improve Server Thread Pool and Thread Priorities: mojang added a max thread coun Use Vanilla Minecart Speeds: is this needed? Handle Oversized Tile Entities: make sure impl is correct 0467-Optimize-WorldBorder-collision-checks-and-air check first hunk that has been removed +Double check if seed based feature search is still needed, since Vanilla is fast as fuck, boiiiii Not sure where this needs to go, if anywhere diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java