From 421d1c1c1f80a7ad255f7dd0539b491e4b195c2b Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Mon, 7 Feb 2011 09:43:51 +0100 Subject: [PATCH] Fixing missing mandatory comments. --- src/main/java/net/minecraft/server/Chunk.java | 2 +- .../minecraft/server/ChunkProviderServer.java | 19 ++++++++++++------- src/main/java/net/minecraft/server/World.java | 12 +++--------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 43532135cc..e37db53fe0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -395,7 +395,7 @@ public class Chunk { if (i != this.j || j != this.k) { System.out.println("Wrong location! " + entity); - System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.j + "," + this.k); + System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.j + "," + this.k); // CraftBukkit Thread.dumpStack(); } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index c2a6cca202..7e530d389e 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -17,11 +17,11 @@ import org.bukkit.event.world.ChunkLoadEvent; public class ChunkProviderServer implements IChunkProvider { - private LongHashset a = new LongHashset(); + private LongHashset a = new LongHashset(); // CraftBukkit private Chunk b; private IChunkProvider c; private IChunkLoader d; - private LongHashtable e = new LongHashtable(); + private LongHashtable e = new LongHashtable(); // CraftBukkit private List f = new ArrayList(); private WorldServer g; @@ -43,11 +43,11 @@ public class ChunkProviderServer implements IChunkProvider { return craftChunks; } - // CraftBukkit end public boolean a(int i, int j) { return this.e.containsKey(i, j); } + // CraftBukkit end public void c(int i, int j) { int k = i * 16 + 8 - this.g.spawnX; @@ -55,13 +55,15 @@ public class ChunkProviderServer implements IChunkProvider { short short1 = 128; if (k < -short1 || k > short1 || l < -short1 || l > short1) { - this.a.add(i, j); + this.a.add(i, j); // CraftBukkit } } public Chunk d(int i, int j) { + // CraftBukkit start this.a.remove(i, j); Chunk chunk = (Chunk) this.e.get(i, j); + // CraftBukkit end if (chunk == null) { chunk = this.e(i, j); @@ -73,7 +75,7 @@ public class ChunkProviderServer implements IChunkProvider { } } - this.e.put(i, j, chunk); + this.e.put(i, j, chunk); // CraftBukkit this.f.add(chunk); if (chunk != null) { chunk.c(); @@ -113,7 +115,7 @@ public class ChunkProviderServer implements IChunkProvider { } public Chunk b(int i, int j) { - Chunk chunk = (Chunk) this.e.get(i, j); + Chunk chunk = (Chunk) this.e.get(i, j); // CraftBukkit return chunk == null ? (this.g.x ? this.d(i, j) : this.b) : chunk; } @@ -205,12 +207,15 @@ public class ChunkProviderServer implements IChunkProvider { if (!this.g.C) { for (int i = 0; i < 100; ++i) { if (!this.a.isEmpty()) { + // CraftBukkit start long chunkcoordinates = this.a.popFirst(); Chunk chunk = e.get(chunkcoordinates); - if(chunk == null) continue; + if (chunk == null) continue; + // CraftBukkit end chunk.e(); this.b(chunk); this.a(chunk); + // this.a.remove(chunkcoordinates); // CraftBukkit this.e.remove(chunkcoordinates); this.f.remove(chunk); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 3a24d16d7a..3fb680b9da 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -273,7 +273,7 @@ public class World implements IBlockAccess { return this.c(i >> 4, j >> 4); } - //start craftbukkit + // CraftBukkit start Chunk lastChunkAccessed; int lastXAccessed = Integer.MIN_VALUE; int lastZAccessed = Integer.MIN_VALUE; @@ -285,7 +285,7 @@ public class World implements IBlockAccess { } return lastChunkAccessed; } - //end craftbukkit + // CraftBukkit end public boolean setTypeIdAndData(int i, int j, int k, int l, int i1) { if (i >= -32000000 && k >= -32000000 && i < 32000000 && k <= 32000000) { @@ -1367,12 +1367,7 @@ public class World implements IBlockAccess { if (!this.f(k1, 64, l1)) { --y; - } else { - Chunk chunk = this.b(k1, l1); - if(chunk == null) { - System.out.println(k1 + "," + l1); - } - if (!chunk.g()) { + } else if (!this.b(k1, l1).g()) { int i2 = this.A.size(); int j2; @@ -1401,7 +1396,6 @@ public class World implements IBlockAccess { --y; } - } } } }