当前位置: 首页>>代码示例>>Java>>正文


Java S38PacketPlayerListItem.AddPlayerData方法代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData方法的典型用法代码示例。如果您正苦于以下问题:Java S38PacketPlayerListItem.AddPlayerData方法的具体用法?Java S38PacketPlayerListItem.AddPlayerData怎么用?Java S38PacketPlayerListItem.AddPlayerData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.network.play.server.S38PacketPlayerListItem的用法示例。


在下文中一共展示了S38PacketPlayerListItem.AddPlayerData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NetworkPlayerInfo

import net.minecraft.network.play.server.S38PacketPlayerListItem; //导入方法依赖的package包/类
public NetworkPlayerInfo(S38PacketPlayerListItem.AddPlayerData p_i46295_1_)
{
    this.gameProfile = p_i46295_1_.getProfile();
    this.gameType = p_i46295_1_.getGameMode();
    this.responseTime = p_i46295_1_.getPing();
    this.displayName = p_i46295_1_.getDisplayName();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:NetworkPlayerInfo.java

示例2: handlePlayerListItem

import net.minecraft.network.play.server.S38PacketPlayerListItem; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void handlePlayerListItem(S38PacketPlayerListItem packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

	for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : packetIn.func_179767_a()) {
		if (packetIn.func_179768_b() == S38PacketPlayerListItem.Action.REMOVE_PLAYER) {
			this.playerInfoMap.remove(s38packetplayerlistitem$addplayerdata.getProfile().getId());
		} else {
			NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) this.playerInfoMap
					.get(s38packetplayerlistitem$addplayerdata.getProfile().getId());

			if (packetIn.func_179768_b() == S38PacketPlayerListItem.Action.ADD_PLAYER) {
				networkplayerinfo = new NetworkPlayerInfo(s38packetplayerlistitem$addplayerdata);
				this.playerInfoMap.put(networkplayerinfo.getGameProfile().getId(), networkplayerinfo);
			}

			if (networkplayerinfo != null) {
				switch (packetIn.func_179768_b()) {
				case ADD_PLAYER:
					networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
					networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
					break;

				case UPDATE_GAME_MODE:
					networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
					break;

				case UPDATE_LATENCY:
					networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
					break;

				case UPDATE_DISPLAY_NAME:
					networkplayerinfo.setDisplayName(s38packetplayerlistitem$addplayerdata.getDisplayName());
				}
			}
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:39,代码来源:NetHandlerPlayClient.java

示例3: handlePlayerListItem

import net.minecraft.network.play.server.S38PacketPlayerListItem; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void handlePlayerListItem(S38PacketPlayerListItem packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : packetIn.func_179767_a())
    {
        if (packetIn.func_179768_b() == S38PacketPlayerListItem.Action.REMOVE_PLAYER)
        {
            this.playerInfoMap.remove(s38packetplayerlistitem$addplayerdata.getProfile().getId());
        }
        else
        {
            NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo)this.playerInfoMap.get(s38packetplayerlistitem$addplayerdata.getProfile().getId());

            if (packetIn.func_179768_b() == S38PacketPlayerListItem.Action.ADD_PLAYER)
            {
                networkplayerinfo = new NetworkPlayerInfo(s38packetplayerlistitem$addplayerdata);
                this.playerInfoMap.put(networkplayerinfo.getGameProfile().getId(), networkplayerinfo);
            }

            if (networkplayerinfo != null)
            {
                switch (packetIn.func_179768_b())
                {
                    case ADD_PLAYER:
                        networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
                        networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
                        break;

                    case UPDATE_GAME_MODE:
                        networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
                        break;

                    case UPDATE_LATENCY:
                        networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
                        break;

                    case UPDATE_DISPLAY_NAME:
                        networkplayerinfo.setDisplayName(s38packetplayerlistitem$addplayerdata.getDisplayName());
                }
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:46,代码来源:NetHandlerPlayClient.java


注:本文中的net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。