From d142fabfc1d1c894a5f40dd5d516d928628dbade Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Mon, 28 Feb 2011 20:30:33 +0000 Subject: [PATCH] Sped up teleporting even more, + fixed isSneaking --- .../net/minecraft/server/PlayerManager.java | 19 ++++--------------- .../craftbukkit/entity/CraftPlayer.java | 4 +--- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/minecraft/server/PlayerManager.java b/src/main/java/net/minecraft/server/PlayerManager.java index 12f0ddddff..4083dcf640 100644 --- a/src/main/java/net/minecraft/server/PlayerManager.java +++ b/src/main/java/net/minecraft/server/PlayerManager.java @@ -127,27 +127,16 @@ public class PlayerManager { int j1 = j - l; // Craftbukkit start - if (!this.a(i, j, k, l)) { - this.a(i, j, true).a(entityplayer); - } - - if (!this.a(i - i1, j - j1, i, j)) { - PlayerInstance playerinstance = this.a(i - i1, j - j1, false); - - if (playerinstance != null) { - playerinstance.b(entityplayer); - } + if (i1 > 10 || i1 < -10 || j1 > 10 || j1 < -10) { + b(entityplayer); + a(entityplayer); + return; } // Craftbukkit end if (i1 != 0 || j1 != 0) { for (int k1 = i - 10; k1 <= i + 10; ++k1) { for (int l1 = j - 10; l1 <= j + 10; ++l1) { - // Craftbukkit start - if ((k1 == i) && (l1 == j)) { - continue; - } - // Craftbukkit end if (!this.a(k1, l1, k, l)) { this.a(k1, l1, true).a(entityplayer); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 3c5a120203..8a7826ba39 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -170,9 +170,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entity.a.e = newEntity; entity = newEntity; } else { - oldWorld.manager.b(entity); entity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - newWorld.manager.a(entity); } } @@ -181,7 +179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public boolean isSneaking() { - return entity.J(); + return entity.U(); } public void updateInventory() {