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.
Dieser Commit ist enthalten in:
Ursprung
cebc8cffec
Commit
9f70c1f386
@ -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;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren