本文整理汇总了Java中net.minecraft.network.PacketBuffer.writeTextComponent方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.writeTextComponent方法的具体用法?Java PacketBuffer.writeTextComponent怎么用?Java PacketBuffer.writeTextComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer.writeTextComponent方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.eventType);
if (this.eventType == SPacketCombatEvent.Event.END_COMBAT)
{
buf.writeVarIntToBuffer(this.duration);
buf.writeInt(this.entityId);
}
else if (this.eventType == SPacketCombatEvent.Event.ENTITY_DIED)
{
buf.writeVarIntToBuffer(this.playerId);
buf.writeInt(this.entityId);
buf.writeTextComponent(this.deathMessage);
}
}
示例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.writeEnumValue(this.type);
if (this.type == SPacketTitle.Type.TITLE || this.type == SPacketTitle.Type.SUBTITLE || this.type == SPacketTitle.Type.ACTIONBAR)
{
buf.writeTextComponent(this.message);
}
if (this.type == SPacketTitle.Type.TIMES)
{
buf.writeInt(this.fadeInTime);
buf.writeInt(this.displayTime);
buf.writeInt(this.fadeOutTime);
}
}
示例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.writeEnumValue(this.type);
if (this.type == SPacketTitle.Type.TITLE || this.type == SPacketTitle.Type.SUBTITLE)
{
buf.writeTextComponent(this.message);
}
if (this.type == SPacketTitle.Type.TIMES)
{
buf.writeInt(this.fadeInTime);
buf.writeInt(this.displayTime);
buf.writeInt(this.fadeOutTime);
}
}
示例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.writeByte(this.windowId);
buf.writeString(this.inventoryType);
buf.writeTextComponent(this.windowTitle);
buf.writeByte(this.slotCount);
if (this.inventoryType.equals("EntityHorse"))
{
buf.writeInt(this.entityId);
}
}
示例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.writeUuid(this.uniqueId);
buf.writeEnumValue(this.operation);
switch (this.operation)
{
case ADD:
buf.writeTextComponent(this.name);
buf.writeFloat(this.percent);
buf.writeEnumValue(this.color);
buf.writeEnumValue(this.overlay);
buf.writeByte(this.getFlags());
case REMOVE:
default:
break;
case UPDATE_PCT:
buf.writeFloat(this.percent);
break;
case UPDATE_NAME:
buf.writeTextComponent(this.name);
break;
case UPDATE_STYLE:
buf.writeEnumValue(this.color);
buf.writeEnumValue(this.overlay);
break;
case UPDATE_PROPERTIES:
buf.writeByte(this.getFlags());
}
}
示例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.writeUuid(this.uniqueId);
buf.writeEnumValue(this.operation);
switch (this.operation)
{
case ADD:
buf.writeTextComponent(this.name);
buf.writeFloat(this.percent);
buf.writeEnumValue(this.color);
buf.writeEnumValue(this.overlay);
buf.writeByte(this.getFlags());
case REMOVE:
default:
break;
case UPDATE_PCT:
buf.writeFloat(this.percent);
break;
case UPDATE_NAME:
buf.writeTextComponent(this.name);
break;
case UPDATE_STYLE:
buf.writeEnumValue(this.color);
buf.writeEnumValue(this.overlay);
break;
case UPDATE_PROPERTIES:
buf.writeByte(this.getFlags());
}
}
示例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.writeTextComponent(this.reason);
}
示例8: write
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void write(PacketBuffer buf, ITextComponent value)
{
buf.writeTextComponent(value);
}
示例9: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeTextComponent(this.header);
buf.writeTextComponent(this.footer);
}
示例10: 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 (SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : this.players)
{
switch (this.action)
{
case ADD_PLAYER:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeString(spacketplayerlistitem$addplayerdata.getProfile().getName());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getProfile().getProperties().size());
for (Property property : spacketplayerlistitem$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(spacketplayerlistitem$addplayerdata.getGameMode().getID());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
}
break;
case UPDATE_GAME_MODE:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
break;
case UPDATE_LATENCY:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
break;
case UPDATE_DISPLAY_NAME:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
}
break;
case REMOVE_PLAYER:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
}
}
}
示例11: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeTextComponent(this.chatComponent);
buf.writeByte(this.type);
}
示例12: 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 (SPacketPlayerListItem.AddPlayerData spacketplayerlistitem$addplayerdata : this.players)
{
switch (this.action)
{
case ADD_PLAYER:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeString(spacketplayerlistitem$addplayerdata.getProfile().getName());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getProfile().getProperties().size());
for (Property property : spacketplayerlistitem$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(spacketplayerlistitem$addplayerdata.getGameMode().getID());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
}
break;
case UPDATE_GAME_MODE:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getGameMode().getID());
break;
case UPDATE_LATENCY:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
buf.writeVarIntToBuffer(spacketplayerlistitem$addplayerdata.getPing());
break;
case UPDATE_DISPLAY_NAME:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
if (spacketplayerlistitem$addplayerdata.getDisplayName() == null)
{
buf.writeBoolean(false);
}
else
{
buf.writeBoolean(true);
buf.writeTextComponent(spacketplayerlistitem$addplayerdata.getDisplayName());
}
break;
case REMOVE_PLAYER:
buf.writeUuid(spacketplayerlistitem$addplayerdata.getProfile().getId());
}
}
}