summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorBrokkonaut <hannos17@gmx.de>2014-02-20 02:20:32 +0100
committerTravis Watkins <amaranth@ubuntu.com>2014-04-18 12:17:48 -0500
commit0092460086aaa09879ac33195b32229dc9476eb0 (patch)
tree30635fd53ff6c4564514d179e7136b8457897c85 /src/main/java/net/minecraft/server
parent890a4af12fce9c28dcc69aebf14078420293dc00 (diff)
downloadcraftbukkit-0092460086aaa09879ac33195b32229dc9476eb0.tar
craftbukkit-0092460086aaa09879ac33195b32229dc9476eb0.tar.gz
craftbukkit-0092460086aaa09879ac33195b32229dc9476eb0.tar.lz
craftbukkit-0092460086aaa09879ac33195b32229dc9476eb0.tar.xz
craftbukkit-0092460086aaa09879ac33195b32229dc9476eb0.zip
Removing broken chunk caching from World. Fixes BUKKIT-5425
Chunk caching in the World class does not know about outdated cache values. This caused various problems when accessing previously unloaded chunks. The caching also did not improve the performance so it is removed. Synchronization is also not necessary, because all accesses to getChunkAt may only come from the main thread.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/World.java17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0f97f78a..e6bb1d5f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -103,10 +103,6 @@ public abstract class World implements IBlockAccess {
public boolean pvpMode;
public boolean keepSpawnInMemory = true;
public ChunkGenerator generator;
- Chunk lastChunkAccessed;
- int lastXAccessed = Integer.MIN_VALUE;
- int lastZAccessed = Integer.MIN_VALUE;
- final Object chunkLock = new Object();
public CraftWorld getWorld() {
return this.world;
@@ -262,18 +258,7 @@ public abstract class World implements IBlockAccess {
}
public Chunk getChunkAt(int i, int j) {
- // CraftBukkit start
- 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;
- }
- result = this.lastChunkAccessed;
- }
- return result;
- // CraftBukkit end
+ return this.chunkProvider.getOrCreateChunk(i, j);
}
public boolean setTypeAndData(int i, int j, int k, Block block, int l, int i1) {