summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-05-04 22:16:26 -0400
committerEvilSeph <evilseph@unaligned.org>2011-05-04 22:16:26 -0400
commit54e2254904153ad5fbc071468560c2305e9128a8 (patch)
tree0aab6b244c629f869f647926f3ac69c3cded2166 /src/main/java/net/minecraft
parentef7e3689b35045b4bfeb77071e6ad32bdde5e448 (diff)
downloadcraftbukkit-54e2254904153ad5fbc071468560c2305e9128a8.tar
craftbukkit-54e2254904153ad5fbc071468560c2305e9128a8.tar.gz
craftbukkit-54e2254904153ad5fbc071468560c2305e9128a8.tar.lz
craftbukkit-54e2254904153ad5fbc071468560c2305e9128a8.tar.xz
craftbukkit-54e2254904153ad5fbc071468560c2305e9128a8.zip
Made teleporting between worlds 'smoother'. Thanks Raphfrk!
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/PlayerInstance.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerInstance.java b/src/main/java/net/minecraft/server/PlayerInstance.java
index f867aa86..eb0edeba 100644
--- a/src/main/java/net/minecraft/server/PlayerInstance.java
+++ b/src/main/java/net/minecraft/server/PlayerInstance.java
@@ -37,8 +37,11 @@ class PlayerInstance {
if (this.b.contains(entityplayer)) {
throw new IllegalStateException("Failed to add player. " + entityplayer + " already is in chunk " + this.chunkX + ", " + this.chunkZ);
} else {
- entityplayer.g.add(this.e);
- entityplayer.netServerHandler.sendPacket(new Packet50PreChunk(this.e.x, this.e.z, true));
+ // CraftBukkit start
+ if (entityplayer.g.add(this.e)) {
+ entityplayer.netServerHandler.sendPacket(new Packet50PreChunk(this.e.x, this.e.z, true));
+ }
+ // CraftBukkit end
this.b.add(entityplayer);
entityplayer.f.add(this.e);
}
@@ -63,7 +66,7 @@ class PlayerInstance {
}
entityplayer.f.remove(this.e);
- if (entityplayer.g.contains(this.e)) {
+ if (entityplayer.g.remove(this.e)) { // CraftBukkit - contains -> remove
entityplayer.netServerHandler.sendPacket(new Packet50PreChunk(this.chunkX, this.chunkZ, false));
}
}