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


Java PacketBuffer.readEnumValue方法代码示例

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


在下文中一共展示了PacketBuffer.readEnumValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 = (S42PacketCombatEvent.Event)buf.readEnumValue(S42PacketCombatEvent.Event.class);

    if (this.eventType == S42PacketCombatEvent.Event.END_COMBAT)
    {
        this.field_179772_d = buf.readVarIntFromBuffer();
        this.field_179775_c = buf.readInt();
    }
    else if (this.eventType == S42PacketCombatEvent.Event.ENTITY_DIED)
    {
        this.field_179774_b = buf.readVarIntFromBuffer();
        this.field_179775_c = buf.readInt();
        this.deathMessage = buf.readStringFromBuffer(32767);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:S42PacketCombatEvent.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 = (S45PacketTitle.Type)buf.readEnumValue(S45PacketTitle.Type.class);

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

    if (this.type == S45PacketTitle.Type.TIMES)
    {
        this.fadeInTime = buf.readInt();
        this.displayTime = buf.readInt();
        this.fadeOutTime = buf.readInt();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:S45PacketTitle.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.entityId = buf.readVarIntFromBuffer();
    this.action = (C02PacketUseEntity.Action)buf.readEnumValue(C02PacketUseEntity.Action.class);

    if (this.action == C02PacketUseEntity.Action.INTERACT_AT)
    {
        this.hitVec = new Vec3((double)buf.readFloat(), (double)buf.readFloat(), (double)buf.readFloat());
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:C02PacketUseEntity.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.position = buf.readBlockPos();
    this.placedBlockDirection = (EnumFacing)buf.readEnumValue(EnumFacing.class);
    this.hand = (EnumHand)buf.readEnumValue(EnumHand.class);
    this.facingX = buf.readFloat();
    this.facingY = buf.readFloat();
    this.facingZ = buf.readFloat();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:CPacketPlayerTryUseItemOnBlock.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.status = (C07PacketPlayerDigging.Action)buf.readEnumValue(C07PacketPlayerDigging.Action.class);
    this.position = buf.readBlockPos();
    this.facing = EnumFacing.getFront(buf.readUnsignedByte());
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:C07PacketPlayerDigging.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.entityID = buf.readVarIntFromBuffer();
    this.action = (C0BPacketEntityAction.Action)buf.readEnumValue(C0BPacketEntityAction.Action.class);
    this.auxData = buf.readVarIntFromBuffer();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:C0BPacketEntityAction.java

示例7: readPacketData

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

    switch (this.action)
    {
        case SET_SIZE:
            this.targetSize = buf.readDouble();
            break;
        case LERP_SIZE:
            this.diameter = buf.readDouble();
            this.targetSize = buf.readDouble();
            this.timeUntilTarget = buf.readVarLong();
            break;
        case SET_CENTER:
            this.centerX = buf.readDouble();
            this.centerZ = buf.readDouble();
            break;
        case SET_WARNING_BLOCKS:
            this.warningDistance = buf.readVarIntFromBuffer();
            break;
        case SET_WARNING_TIME:
            this.warningTime = buf.readVarIntFromBuffer();
            break;
        case INITIALIZE:
            this.centerX = buf.readDouble();
            this.centerZ = buf.readDouble();
            this.diameter = buf.readDouble();
            this.targetSize = buf.readDouble();
            this.timeUntilTarget = buf.readVarLong();
            this.size = buf.readVarIntFromBuffer();
            this.warningDistance = buf.readVarIntFromBuffer();
            this.warningTime = buf.readVarIntFromBuffer();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:SPacketWorldBorder.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.name = buf.readStringFromBuffer(40);
    this.action = (S3CPacketUpdateScore.Action)buf.readEnumValue(S3CPacketUpdateScore.Action.class);
    this.objective = buf.readStringFromBuffer(16);

    if (this.action != S3CPacketUpdateScore.Action.REMOVE)
    {
        this.value = buf.readVarIntFromBuffer();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:S3CPacketUpdateScore.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.name = buf.readStringFromBuffer(40);
    this.action = (SPacketUpdateScore.Action)buf.readEnumValue(SPacketUpdateScore.Action.class);
    this.objective = buf.readStringFromBuffer(16);

    if (this.action != SPacketUpdateScore.Action.REMOVE)
    {
        this.value = buf.readVarIntFromBuffer();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:SPacketUpdateScore.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.lang = buf.readStringFromBuffer(7);
    this.view = buf.readByte();
    this.chatVisibility = (EntityPlayer.EnumChatVisibility)buf.readEnumValue(EntityPlayer.EnumChatVisibility.class);
    this.enableColors = buf.readBoolean();
    this.modelPartFlags = buf.readUnsignedByte();
    this.mainHand = (EnumHandSide)buf.readEnumValue(EnumHandSide.class);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:CPacketClientSettings.java

示例11: readPacketData

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

示例12: readPacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.hash = buf.readStringFromBuffer(40);
    this.status = (C19PacketResourcePackStatus.Action)buf.readEnumValue(C19PacketResourcePackStatus.Action.class);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:C19PacketResourcePackStatus.java

示例13: read

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

示例14: readPacketData

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

    switch (this.action)
    {
        case SET_SIZE:
            this.targetSize = buf.readDouble();
            break;

        case LERP_SIZE:
            this.diameter = buf.readDouble();
            this.targetSize = buf.readDouble();
            this.timeUntilTarget = buf.readVarLong();
            break;

        case SET_CENTER:
            this.centerX = buf.readDouble();
            this.centerZ = buf.readDouble();
            break;

        case SET_WARNING_BLOCKS:
            this.warningDistance = buf.readVarIntFromBuffer();
            break;

        case SET_WARNING_TIME:
            this.warningTime = buf.readVarIntFromBuffer();
            break;

        case INITIALIZE:
            this.centerX = buf.readDouble();
            this.centerZ = buf.readDouble();
            this.diameter = buf.readDouble();
            this.targetSize = buf.readDouble();
            this.timeUntilTarget = buf.readVarLong();
            this.size = buf.readVarIntFromBuffer();
            this.warningDistance = buf.readVarIntFromBuffer();
            this.warningTime = buf.readVarIntFromBuffer();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:44,代码来源:S44PacketWorldBorder.java


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