diff options
author | Evenprime <wilfried.pasquazzo@gmail.com> | 2012-01-30 21:28:04 +0100 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-09 21:30:52 -0500 |
commit | d8ca2401ff07cc2d717a95d36ee4099c447a634e (patch) | |
tree | eb23aba9a810b9a6db40fbacdebff1deecf441ed | |
parent | 80bae060c6823321d039ebe3dcaa8ade567b8b9c (diff) | |
download | craftbukkit-d8ca2401ff07cc2d717a95d36ee4099c447a634e.tar craftbukkit-d8ca2401ff07cc2d717a95d36ee4099c447a634e.tar.gz craftbukkit-d8ca2401ff07cc2d717a95d36ee4099c447a634e.tar.lz craftbukkit-d8ca2401ff07cc2d717a95d36ee4099c447a634e.tar.xz craftbukkit-d8ca2401ff07cc2d717a95d36ee4099c447a634e.zip |
[Bleeding] Send new player location after teleports only to nearby players.
-rw-r--r-- | src/main/java/net/minecraft/server/EntityTrackerEntry.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index 6ccf0189..8eedbfdf 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -1,5 +1,6 @@ package net.minecraft.server; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -73,6 +74,19 @@ public class EntityTrackerEntry { boolean flag = Math.abs(j1) >= 4 || Math.abs(k1) >= 4 || Math.abs(l1) >= 4; boolean flag1 = Math.abs(l - this.g) >= 4 || Math.abs(i1 - this.h) >= 4; + // CraftBukkit start - code moved from below + if (flag) { + this.d = i; + this.e = j; + this.f = k; + } + + if (flag1) { + this.g = l; + this.h = i1; + } + // CraftBukkit end + if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.t <= 400) { if (flag && flag1) { object = new Packet33RelEntityMoveLook(this.tracker.id, (byte) j1, (byte) k1, (byte) l1, (byte) l, (byte) i1); @@ -86,6 +100,11 @@ public class EntityTrackerEntry { this.tracker.locX = (double) i / 32.0D; this.tracker.locY = (double) j / 32.0D; this.tracker.locZ = (double) k / 32.0D; + // CraftBukkit start + if (this.tracker instanceof EntityPlayer) { + this.scanPlayers(new ArrayList(this.trackedPlayers)); + } + // CraftBukkit end object = new Packet34EntityTeleport(this.tracker.id, i, j, k, (byte) l, (byte) i1); } @@ -113,8 +132,8 @@ public class EntityTrackerEntry { if (datawatcher.a()) { this.broadcastIncludingSelf(new Packet40EntityMetadata(this.tracker.id, datawatcher)); } - - if (flag) { + // CraftBukkit start - code moved up + /* if (flag) { this.d = i; this.e = j; this.f = k; @@ -123,7 +142,8 @@ public class EntityTrackerEntry { if (flag1) { this.g = l; this.h = i1; - } + } */ + // CraftBukkit end } this.tracker.ce = false; |