Optimize some methods for inlining
Adds final to some methods to improve inlining ability
This commit is contained in:
@@ -64,22 +64,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(int i, int j) {
|
||||
+ // Paper start - optimise this for loaded chunks
|
||||
+ if (Thread.currentThread() == this.serverThread) {
|
||||
+ Chunk ifLoaded = ((WorldServer) this).getChunkProvider().getChunkAtIfLoadedMainThread(i, j);
|
||||
+ if (ifLoaded != null) {
|
||||
+ return ifLoaded;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user