aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2022-09-01 09:51:59 -0700
committerGitHub <[email protected]>2022-09-01 09:51:59 -0700
commit046466f3ba72d6bdaa0213cde64676dd0024ace0 (patch)
tree717d69c8521cac0e4881c009e636891e116c2378 /patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch
parenteff22eb0541559f05cf9a8c370d70c3b346f80f6 (diff)
downloadPaper-046466f3ba72d6bdaa0213cde64676dd0024ace0.tar.gz
Paper-046466f3ba72d6bdaa0213cde64676dd0024ace0.zip
Re-arrange most chunk system patches to front (#8338)
* Re-arrange most chunk system patches to front Co-authored-by: Spottedleaf <[email protected]>
Diffstat (limited to 'patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch')
-rw-r--r--patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch b/patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch
new file mode 100644
index 0000000000..3a47472ec8
--- /dev/null
+++ b/patches/server/0348-Optimise-IEntityAccess-getPlayerByUUID.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Sat, 11 Jan 2020 21:50:56 -0800
+Subject: [PATCH] Optimise IEntityAccess#getPlayerByUUID
+
+Use the world entity map instead of iterating over all players
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
+index 67a17a0fad369c412a943bb21b574c9cd5031fb8..3cf5ad6a77659073b740a2be3946a39c110dd4b8 100644
+--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
+@@ -394,6 +394,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
+ // Paper end
+
++ // Paper start - optimise getPlayerByUUID
++ @Nullable
++ @Override
++ public Player getPlayerByUUID(UUID uuid) {
++ return this.getServer().getPlayerList().getPlayer(uuid);
++ }
++ // Paper end
++
+ // Add env and gen to constructor, IWorldDataServer -> WorldDataServer
+ public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
+ // Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error