99import com .comphenix .protocol .wrappers .PlayerInfoData ;
1010import com .comphenix .protocol .wrappers .WrappedChatComponent ;
1111import com .comphenix .protocol .wrappers .WrappedGameProfile ;
12+ import com .comphenix .protocol .wrappers .WrappedSignedProperty ;
1213import java .util .List ;
1314import java .util .Map ;
1415import java .util .Objects ;
1920import org .bukkit .plugin .Plugin ;
2021import tc .oc .pgm .platform .modern .packets .PacketSender ;
2122import tc .oc .pgm .platform .modern .util .Packets ;
23+ import tc .oc .pgm .util .skin .Skin ;
2224
2325public class PacketManipulations implements PacketSender {
2426
@@ -47,7 +49,7 @@ private void handlePlayerInfo(PacketEvent event) {
4749 .write (
4850 0 ,
4951 infoList .stream ()
50- .map (( playerInfoData -> {
52+ .map (playerInfoData -> {
5153 UUID playerId = playerInfoData .getProfileId ();
5254 Player player = Bukkit .getPlayer (playerId );
5355 if (player == null || player .equals (viewer ) || !player .isOnline ()) {
@@ -63,11 +65,13 @@ private void handlePlayerInfo(PacketEvent event) {
6365
6466 WrappedGameProfile playerProfile =
6567 playerInfoData .getProfile ().withName (playerName );
66- playerInfoData
67- . getProfile ()
68+ Skin skin = PLAYER_UTILS . getPlayerSkin ( player , viewer );
69+ playerProfile
6870 .getProperties ()
69- .forEach (
70- (key , property ) -> playerProfile .getProperties ().put (key , property ));
71+ .put (
72+ "textures" ,
73+ new WrappedSignedProperty (
74+ "textures" , skin .getData (), skin .getSignature ()));
7175
7276 return new PlayerInfoData (
7377 playerId ,
@@ -76,7 +80,7 @@ private void handlePlayerInfo(PacketEvent event) {
7680 playerInfoData .getGameMode (),
7781 playerProfile ,
7882 WrappedChatComponent .fromLegacyText (playerDisplayName ));
79- }))
83+ })
8084 .toList ());
8185 }
8286 }
0 commit comments