2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2021-06-16 06:53:50 +02:00
|
|
|
index 70c583827f6b947d57b477f6fc416857c70336c1..30ccb9c0ffabfe5536c89d1dafb97afb467371a7 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
2021-06-14 08:41:01 +02:00
|
|
|
@@ -284,6 +284,14 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
2021-06-13 21:29:58 +02:00
|
|
|
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
|
2021-06-11 14:02:28 +02:00
|
|
|
// Paper end
|
|
|
|
|
|
|
|
+ // Paper start - optimise getPlayerByUUID
|
|
|
|
+ @Nullable
|
|
|
|
+ @Override
|
|
|
|
+ public Player getPlayerByUUID(UUID uuid) {
|
2021-06-13 21:29:58 +02:00
|
|
|
+ return this.getServer().getPlayerList().getPlayer(uuid);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// Add env and gen to constructor, WorldData -> WorldDataServer
|
|
|
|
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<net.minecraft.world.level.Level> resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
|
2021-06-13 21:29:58 +02:00
|
|
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|