2018-10-06 06:56:20 +02:00
|
|
|
From 8fd650d43ab3b4f17957a91e7cd42997898a7c63 Mon Sep 17 00:00:00 2001
|
2018-08-29 03:36:42 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 28 Aug 2018 21:35:05 -0400
|
|
|
|
Subject: [PATCH] Optimize Chunk#getPos
|
|
|
|
|
|
|
|
Don't create an object just to get chunk coords.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
2018-10-06 06:56:20 +02:00
|
|
|
index 7857d871f4..6abbbc057f 100644
|
2018-08-29 03:36:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
@@ -169,8 +169,9 @@ public class Chunk implements IChunkAccess {
|
|
|
|
// CraftBukkit start
|
|
|
|
this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
|
|
|
|
this.chunkKey = ChunkCoordIntPair.a(this.locX, this.locZ);
|
|
|
|
+ this.chunkCoords = new ChunkCoordIntPair(this.locX, this.locZ); // Paper
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+ private final ChunkCoordIntPair chunkCoords; // Paper
|
|
|
|
public org.bukkit.Chunk bukkitChunk;
|
|
|
|
public boolean mustSave;
|
2018-09-29 01:31:59 +02:00
|
|
|
private boolean needsDecoration;
|
2018-10-06 06:56:20 +02:00
|
|
|
@@ -1191,7 +1192,7 @@ public class Chunk implements IChunkAccess {
|
2018-08-29 03:36:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public ChunkCoordIntPair getPos() {
|
|
|
|
- return new ChunkCoordIntPair(this.locX, this.locZ);
|
|
|
|
+ return this.chunkCoords; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean b(int i, int j) {
|
|
|
|
--
|
2018-09-27 04:35:42 +02:00
|
|
|
2.19.0
|
2018-08-29 03:36:42 +02:00
|
|
|
|