From 4f6246addd2db3a6a31c6733385d401d9fc3683d Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 17 Feb 2013 17:31:52 +1100 Subject: [PATCH] Handle vanished players in tab list --- ...7-Infrequently-send-tab-list-updates.patch | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/CraftBukkit-Patches/0027-Infrequently-send-tab-list-updates.patch b/CraftBukkit-Patches/0027-Infrequently-send-tab-list-updates.patch index b2d2d5e..4d8a5f3 100644 --- a/CraftBukkit-Patches/0027-Infrequently-send-tab-list-updates.patch +++ b/CraftBukkit-Patches/0027-Infrequently-send-tab-list-updates.patch @@ -1,19 +1,19 @@ -From e7125d3278b8ad21a2cac6f397ba835c5a76b41d Mon Sep 17 00:00:00 2001 +From 7881af03e717e19de1c71b4b7f30618ebc7b2f54 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 16 Feb 2013 19:05:15 +1100 Subject: [PATCH] Infrequently send tab list updates. --- - src/main/java/net/minecraft/server/PlayerList.java | 6 ++---- - src/main/java/org/bukkit/craftbukkit/Spigot.java | 2 ++ - src/main/resources/configurations/bukkit.yml | 1 + - 3 files changed, 5 insertions(+), 4 deletions(-) + src/main/java/net/minecraft/server/PlayerList.java | 13 ++++++++----- + src/main/java/org/bukkit/craftbukkit/Spigot.java | 2 ++ + src/main/resources/configurations/bukkit.yml | 1 + + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d13fa19..8d07a76 100644 +index d13fa19..3fc66aa 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -655,13 +655,11 @@ public abstract class PlayerList { +@@ -655,13 +655,16 @@ public abstract class PlayerList { this.o = 0; } @@ -21,9 +21,15 @@ index d13fa19..8d07a76 100644 - if (this.o < this.players.size()) { + if (org.bukkit.craftbukkit.Spigot.tabPing && this.o < this.players.size()) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(this.o); - +- - this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.ping)); -+ this.sendAll(new Packet201PlayerInfo(entityplayer.listName, true, entityplayer.ping)); ++ Packet packet = new Packet201PlayerInfo(entityplayer.listName, true, entityplayer.ping); ++ for (int i = 0; i < this.players.size(); ++i) { ++ PlayerConnection con = ((EntityPlayer) this.players.get(i)).playerConnection; ++ if (con.getPlayer().canSee(entityplayer.getBukkitEntity())) { ++ con.sendPacket(packet); ++ } ++ } } - // CraftBukkit end */ }