diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-05 18:15:04 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-07 01:44:43 +0000 |
commit | 2be5181b0c721baf520a372350693377c261dd37 (patch) | |
tree | 790918614919ce0dd2801ceffadc43ebf9c7a141 /src/main/java/net/minecraft/server/PlayerManager.java | |
parent | 9e7991ab528cfc195200e342cd022ab3f63de3f6 (diff) | |
download | craftbukkit-2be5181b0c721baf520a372350693377c261dd37.tar craftbukkit-2be5181b0c721baf520a372350693377c261dd37.tar.gz craftbukkit-2be5181b0c721baf520a372350693377c261dd37.tar.lz craftbukkit-2be5181b0c721baf520a372350693377c261dd37.tar.xz craftbukkit-2be5181b0c721baf520a372350693377c261dd37.zip |
Added internal MC support for multiple worlds
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerManager.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerManager.java b/src/main/java/net/minecraft/server/PlayerManager.java index f2ace21e..3837635b 100644 --- a/src/main/java/net/minecraft/server/PlayerManager.java +++ b/src/main/java/net/minecraft/server/PlayerManager.java @@ -22,22 +22,24 @@ public class PlayerManager { this.c.clear(); } - private PlayerInstance a(int i, int j, boolean flag) { + // Craftbukkit - method signature changed! + private PlayerInstance a(int i, int j, boolean flag, WorldServer world) { long k = (long) i + 2147483647L | (long) j + 2147483647L << 32; PlayerInstance playerinstance = (PlayerInstance) this.b.a(k); if (playerinstance == null && flag) { - playerinstance = new PlayerInstance(this, i, j); + playerinstance = new PlayerInstance(this, i, j, world); this.b.a(k, playerinstance); } return playerinstance; } - public void a(int i, int j, int k) { + // Craftbukkit - method signature changed! + public void a(int i, int j, int k, WorldServer world) { int l = i >> 4; int i1 = k >> 4; - PlayerInstance playerinstance = this.a(l, i1, false); + PlayerInstance playerinstance = this.a(l, i1, false, world); if (playerinstance != null) { playerinstance.a(i & 15, j, k & 15); @@ -67,7 +69,7 @@ public class PlayerManager { int dz = 0; // Origin - this.a(i, j, true).a(entityplayer); + this.a(i, j, true, ((WorldServer)entityplayer.world)).a(entityplayer); // All but the last leg for (int legSize = 1; legSize <= size * 2; legSize++) { @@ -77,7 +79,7 @@ public class PlayerManager { for (int k = 0; k < legSize; k++ ) { dx += dir[0]; dz += dir[1]; - this.a(i + dx, j + dz, true).a(entityplayer); + this.a(i + dx, j + dz, true, ((WorldServer)entityplayer.world)).a(entityplayer); // Craftbukkit } } } @@ -87,7 +89,7 @@ public class PlayerManager { for (int k = 0; k < size * 2; k++) { dx += direction[facing][0]; dz += direction[facing][1]; - this.a(i + dx, j + dz, true).a(entityplayer); + this.a(i + dx, j + dz, true, ((WorldServer)entityplayer.world)).a(entityplayer); } // CraftBukkit end @@ -100,7 +102,7 @@ public class PlayerManager { for (int k = i - 10; k <= i + 10; ++k) { for (int l = j - 10; l <= j + 10; ++l) { - PlayerInstance playerinstance = this.a(k, l, false); + PlayerInstance playerinstance = this.a(k, l, false, ((WorldServer)entityplayer.world)); if (playerinstance != null) { playerinstance.b(entityplayer); @@ -135,11 +137,11 @@ public class PlayerManager { for (int k1 = i - 10; k1 <= i + 10; ++k1) { for (int l1 = j - 10; l1 <= j + 10; ++l1) { if (!this.a(k1, l1, k, l)) { - this.a(k1, l1, true).a(entityplayer); + this.a(k1, l1, true, ((WorldServer)entityplayer.world)).a(entityplayer); } if (!this.a(k1 - i1, l1 - j1, i, j)) { - PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false); + PlayerInstance playerinstance = this.a(k1 - i1, l1 - j1, false, ((WorldServer)entityplayer.world)); if (playerinstance != null) { playerinstance.b(entityplayer); |