From 5c92a46cfab3f502b9fbcb5499fdaa93d71e3182 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Wed, 1 Jan 2014 17:16:14 +0100 Subject: [PATCH] Correctly clone WrappedServerPing when the player count is hidden. --- .../comphenix/protocol/wrappers/WrappedServerPing.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java index dc076137..7dd83966 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/WrappedServerPing.java @@ -312,10 +312,15 @@ public class WrappedServerPing extends AbstractWrapper { copy.setPlayers(getPlayers()); copy.setFavicon(getFavicon()); copy.setMotD(motd != null ? motd.deepClone() : null); - copy.setPlayersMaximum(getPlayersMaximum()); - copy.setPlayersOnline(getPlayersOnline()); copy.setVersionName(getVersionName()); copy.setVersionProtocol(getVersionProtocol()); + + if (isPlayersVisible()) { + copy.setPlayersMaximum(getPlayersMaximum()); + copy.setPlayersOnline(getPlayersOnline()); + } else { + copy.setPlayersVisible(false); + } return copy; }