本文整理汇总了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();
}
示例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());
}
}
}
}
}
示例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());
}
}
}
}
}