Rename some patches to be more concise. More to come once we can think of better names :p
By: md_5 <md_5@live.com.au>
This commit is contained in:
parent
1b0fe7e2a8
commit
55c6093626
7 changed files with 16 additions and 16 deletions
|
@ -0,0 +1,35 @@
|
|||
From 4776ef04d235ddc17d619f83ef88d920bf7a82fa Mon Sep 17 00:00:00 2001
|
||||
From: Mike Primm <mike@primmhome.com>
|
||||
Date: Wed, 16 Jan 2013 15:27:22 -0600
|
||||
Subject: [PATCH] Sync Free Chunk Reference Cache
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index b05edd1..612ca7d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -299,15 +299,13 @@ public abstract class World implements IBlockAccess {
|
||||
|
||||
// CraftBukkit start
|
||||
public Chunk getChunkAt(int i, int j) {
|
||||
- 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;
|
||||
+ //synchronized (this.chunkLock) {
|
||||
+ Chunk result = this.lastChunkAccessed; // Exploit fact that read is atomic
|
||||
+ if (result == null || result.x != i || result.z != j) {
|
||||
+ result = this.chunkProvider.getOrCreateChunk(i, j);
|
||||
+ this.lastChunkAccessed = result; // Exploit fact that write is atomic
|
||||
}
|
||||
+ //}
|
||||
return result;
|
||||
}
|
||||
// CraftBukkit end
|
||||
--
|
||||
1.8.1.2
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue