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


Java PacketBuffer.readTextComponent方法代码示例

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


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

示例1: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.eventType = (SPacketCombatEvent.Event)buf.readEnumValue(SPacketCombatEvent.Event.class);

    if (this.eventType == SPacketCombatEvent.Event.END_COMBAT)
    {
        this.duration = buf.readVarIntFromBuffer();
        this.entityId = buf.readInt();
    }
    else if (this.eventType == SPacketCombatEvent.Event.ENTITY_DIED)
    {
        this.playerId = buf.readVarIntFromBuffer();
        this.entityId = buf.readInt();
        this.deathMessage = buf.readTextComponent();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:SPacketCombatEvent.java

示例2: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.type = (SPacketTitle.Type)buf.readEnumValue(SPacketTitle.Type.class);

    if (this.type == SPacketTitle.Type.TITLE || this.type == SPacketTitle.Type.SUBTITLE || this.type == SPacketTitle.Type.ACTIONBAR)
    {
        this.message = buf.readTextComponent();
    }

    if (this.type == SPacketTitle.Type.TIMES)
    {
        this.fadeInTime = buf.readInt();
        this.displayTime = buf.readInt();
        this.fadeOutTime = buf.readInt();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:SPacketTitle.java

示例3: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.type = (SPacketTitle.Type)buf.readEnumValue(SPacketTitle.Type.class);

    if (this.type == SPacketTitle.Type.TITLE || this.type == SPacketTitle.Type.SUBTITLE)
    {
        this.message = buf.readTextComponent();
    }

    if (this.type == SPacketTitle.Type.TIMES)
    {
        this.fadeInTime = buf.readInt();
        this.displayTime = buf.readInt();
        this.fadeOutTime = buf.readInt();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:SPacketTitle.java

示例4: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.windowId = buf.readUnsignedByte();
    this.inventoryType = buf.readStringFromBuffer(32);
    this.windowTitle = buf.readTextComponent();
    this.slotCount = buf.readUnsignedByte();

    if (this.inventoryType.equals("EntityHorse"))
    {
        this.entityId = buf.readInt();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:SPacketOpenWindow.java

示例5: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.uniqueId = buf.readUuid();
    this.operation = (SPacketUpdateBossInfo.Operation)buf.readEnumValue(SPacketUpdateBossInfo.Operation.class);

    switch (this.operation)
    {
        case ADD:
            this.name = buf.readTextComponent();
            this.percent = buf.readFloat();
            this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
            this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
            this.setFlags(buf.readUnsignedByte());

        case REMOVE:
        default:
            break;

        case UPDATE_PCT:
            this.percent = buf.readFloat();
            break;

        case UPDATE_NAME:
            this.name = buf.readTextComponent();
            break;

        case UPDATE_STYLE:
            this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
            this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
            break;

        case UPDATE_PROPERTIES:
            this.setFlags(buf.readUnsignedByte());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:SPacketUpdateBossInfo.java

示例6: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.uniqueId = buf.readUuid();
    this.operation = (SPacketUpdateBossInfo.Operation)buf.readEnumValue(SPacketUpdateBossInfo.Operation.class);

    switch (this.operation)
    {
        case ADD:
            this.name = buf.readTextComponent();
            this.percent = buf.readFloat();
            this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
            this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
            this.setFlags(buf.readUnsignedByte());
        case REMOVE:
        default:
            break;
        case UPDATE_PCT:
            this.percent = buf.readFloat();
            break;
        case UPDATE_NAME:
            this.name = buf.readTextComponent();
            break;
        case UPDATE_STYLE:
            this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
            this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
            break;
        case UPDATE_PROPERTIES:
            this.setFlags(buf.readUnsignedByte());
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:SPacketUpdateBossInfo.java

示例7: read

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public ITextComponent read(PacketBuffer buf) throws IOException
{
    return buf.readTextComponent();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:DataSerializers.java

示例8: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.header = buf.readTextComponent();
    this.footer = buf.readTextComponent();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketPlayerListHeaderFooter.java

示例9: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.reason = buf.readTextComponent();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:SPacketDisconnect.java

示例10: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.chatComponent = buf.readTextComponent();
    this.type = buf.readByte();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketChat.java

示例11: read

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public ITextComponent read(PacketBuffer buf) throws java.io.IOException
{
    return buf.readTextComponent();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:DataSerializers.java


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