diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-09-20 23:00:34 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-09-20 23:00:34 -0500 |
commit | 9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0 (patch) | |
tree | c4d7ae7326c012182a38d20fe07040908499bbc3 /src/main/java | |
parent | cebc8cffec0b088d2bcb117a97dedb60ff5c5e82 (diff) | |
download | craftbukkit-9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0.tar craftbukkit-9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0.tar.gz craftbukkit-9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0.tar.lz craftbukkit-9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0.tar.xz craftbukkit-9f70c1f3864632b90a4c4edfbde7f6fc2c10b9b0.zip |
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.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/World.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 7b97740c..da8fffd4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -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; } |