mirror of
https://github.com/TotalFreedomMC/BukkitTelnet.git
synced 2024-12-28 11:04:22 +00:00
Add display name to player list JSON.
Send a player list update when someone enables enhanced mode.
This commit is contained in:
parent
b355edb37b
commit
c5aa5f813d
2 changed files with 7 additions and 1 deletions
|
@ -40,7 +40,7 @@ public class PlayerEventListener implements Listener
|
|||
|
||||
private static BukkitTask updateTask = null;
|
||||
|
||||
private static void triggerPlayerListUpdates()
|
||||
public static void triggerPlayerListUpdates()
|
||||
{
|
||||
if (updateTask != null)
|
||||
{
|
||||
|
@ -72,6 +72,7 @@ public class PlayerEventListener implements Listener
|
|||
|
||||
info.put("name", player.getName());
|
||||
info.put("ip", player.getAddress().getAddress().getHostAddress());
|
||||
info.put("displayName", player.getDisplayName().trim());
|
||||
|
||||
players.add(info);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import me.StevenLawson.BukkitTelnet.BukkitTelnet;
|
||||
import me.StevenLawson.BukkitTelnet.PlayerEventListener;
|
||||
import me.StevenLawson.BukkitTelnet.TelnetConfig;
|
||||
import me.StevenLawson.BukkitTelnet.TelnetLogAppender;
|
||||
import me.StevenLawson.BukkitTelnet.TelnetLogger;
|
||||
|
@ -460,6 +461,10 @@ public final class ClientSession extends Thread
|
|||
{
|
||||
enhancedMode = !enhancedMode;
|
||||
println((enhancedMode ? "A" : "Dea") + "ctivated enhanced mode.");
|
||||
if (enhancedMode)
|
||||
{
|
||||
PlayerEventListener.triggerPlayerListUpdates();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue