use of net.minecraft.network.protocol.game.ClientboundPlayerInfoPacket in project Denizen-For-Bukkit by DenizenScript.
the class ProfileEditorImpl method updatePlayerProfiles.
public static void updatePlayerProfiles(ClientboundPlayerInfoPacket packet) {
ClientboundPlayerInfoPacket.Action action = packet.getAction();
if (action != ClientboundPlayerInfoPacket.Action.ADD_PLAYER) {
return;
}
List<ClientboundPlayerInfoPacket.PlayerUpdate> dataList = packet.getEntries();
if (dataList != null) {
try {
for (ClientboundPlayerInfoPacket.PlayerUpdate data : dataList) {
GameProfile gameProfile = data.getProfile();
if (fakeProfiles.containsKey(gameProfile.getId())) {
playerInfoData_gameProfile_Setter.invoke(data, getGameProfile(fakeProfiles.get(gameProfile.getId())));
}
}
} catch (Throwable e) {
Debug.echoError(e);
}
}
}
Aggregations