mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Rename optimize isOutsideRange patch
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||||
Date: Tue, 5 May 2020 20:40:53 -0700
|
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
|
Use a distance map to find the players in range quickly
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- if (event == null || event.isCancelled()) return false;
|
- if (event == null || event.isCancelled()) return false;
|
||||||
- blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4));
|
- blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4));
|
||||||
+ // don't check spectator and whatnot, already handled by mob spawn map update
|
+ // 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
|
+ return true; // in range
|
||||||
}
|
}
|
||||||
- // Paper end
|
- // Paper end
|
||||||
@@ -198,7 +198,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ // don't check spectator and whatnot, already handled by mob spawn map update
|
+ // 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
|
+ return true; // in range
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
1
todo.txt
1
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?
|
Use Vanilla Minecart Speeds: is this needed?
|
||||||
Handle Oversized Tile Entities: make sure impl is correct
|
Handle Oversized Tile Entities: make sure impl is correct
|
||||||
0467-Optimize-WorldBorder-collision-checks-and-air check first hunk that has been removed
|
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
|
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
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
|
Reference in New Issue
Block a user