mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Set last accessed variables after grabbing chunk. Fixes BUKKIT-1033
This fix changes the 'state' of the last accessed variables to be more accurate. Changing the coordinates of the last accessed chunk should never precede actually setting the last accessed chunk, as loading a chunk may at some point call back to getChunkAt with a new set of coordinates before the chunk has actually been loaded. The coordinates would have been set, but the actual chunk would not. With no check for accuracy, this causes fringe case issues such as null block states. Big thanks to @V10lator for finding where the root of the problem was occurring.
This commit is contained in:
parent
cebc8cffec
commit
9f70c1f386
1 changed files with 1 additions and 1 deletions
|
@ -223,9 +223,9 @@ public abstract class World implements IBlockAccess {
|
|||
Chunk result = null;
|
||||
synchronized (this.chunkLock) {
|
||||
if (this.lastChunkAccessed == null || this.lastXAccessed != i || this.lastZAccessed != j) {
|
||||
this.lastChunkAccessed = this.chunkProvider.getOrCreateChunk(i, j);
|
||||
this.lastXAccessed = i;
|
||||
this.lastZAccessed = j;
|
||||
this.lastChunkAccessed = this.chunkProvider.getOrCreateChunk(i, j);
|
||||
}
|
||||
result = this.lastChunkAccessed;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue