本文整理汇总了Java中net.minecraft.network.PacketBuffer.writeChatComponent方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.writeChatComponent方法的具体用法?Java PacketBuffer.writeChatComponent怎么用?Java PacketBuffer.writeChatComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer.writeChatComponent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeEnumValue(this.type);
if (this.type == S45PacketTitle.Type.TITLE || this.type == S45PacketTitle.Type.SUBTITLE)
{
buf.writeChatComponent(this.message);
}
if (this.type == S45PacketTitle.Type.TIMES)
{
buf.writeInt(this.fadeInTime);
buf.writeInt(this.displayTime);
buf.writeInt(this.fadeOutTime);
}
}
示例2: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeBlockPos(this.blockPos);
for (int i = 0; i < 4; ++i)
{
buf.writeChatComponent(this.lines[i]);
}
}
示例3: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeByte(this.windowId);
buf.writeString(this.inventoryType);
buf.writeChatComponent(this.windowTitle);
buf.writeByte(this.slotCount);
if (this.inventoryType.equals("EntityHorse"))
{
buf.writeInt(this.entityId);
}
}
示例4: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeChatComponent(this.reason);
}
示例5: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeChatComponent(this.chatComponent);
buf.writeByte(this.type);
}
示例6: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeEnumValue(this.action);
buf.writeVarIntToBuffer(this.players.size());
for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : this.players)
{
switch (this.action)
{
case ADD_PLAYER:
buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
buf.writeString(s38packetplayerlistitem$addplayerdata.getProfile().getName());
buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getProfile().getProperties().size());
for (Property property : s38packetplayerlistitem$addplayerdata.getProfile().getProperties().values())
{
buf.writeString(property.getName());
buf.writeString(property.getValue());
if (property.hasSignature())
{
buf.writeBoolean(true);
buf.writeString(property.getSignature());
}
else
{
buf.writeBoolean(false);
}
}
buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID());
buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing());
if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName());
}
break;
case UPDATE_GAME_MODE:
buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID());
break;
case UPDATE_LATENCY:
buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing());
break;
case UPDATE_DISPLAY_NAME:
buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName());
}
break;
case REMOVE_PLAYER:
buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId());
}
}
}
示例7: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeChatComponent(this.header);
buf.writeChatComponent(this.footer);
}