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


Java PacketBuffer.writeFloat方法代码示例

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


在下文中一共展示了PacketBuffer.writeFloat方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.writeInt(this.particleType.getParticleID());
    buf.writeBoolean(this.longDistance);
    buf.writeFloat(this.xCoord);
    buf.writeFloat(this.yCoord);
    buf.writeFloat(this.zCoord);
    buf.writeFloat(this.xOffset);
    buf.writeFloat(this.yOffset);
    buf.writeFloat(this.zOffset);
    buf.writeFloat(this.particleSpeed);
    buf.writeInt(this.particleCount);
    int i = this.particleType.getArgumentCount();

    for (int j = 0; j < i; ++j)
    {
        buf.writeVarIntToBuffer(this.particleArguments[j]);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:SPacketParticles.java

示例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.writeVarIntToBuffer(SoundEvent.REGISTRY.getIDForObject(this.sound));
    buf.writeEnumValue(this.category);
    buf.writeInt(this.posX);
    buf.writeInt(this.posY);
    buf.writeInt(this.posZ);
    buf.writeFloat(this.soundVolume);
    buf.writeFloat(this.soundPitch);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:SPacketSoundEffect.java

示例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.writeVarIntToBuffer(this.entityId);
    buf.writeEnumValue(this.action);

    if (this.action == C02PacketUseEntity.Action.INTERACT_AT)
    {
        buf.writeFloat((float)this.hitVec.xCoord);
        buf.writeFloat((float)this.hitVec.yCoord);
        buf.writeFloat((float)this.hitVec.zCoord);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:C02PacketUseEntity.java

示例4: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    byte b0 = 0;

    if (this.isInvulnerable())
    {
        b0 = (byte)(b0 | 1);
    }

    if (this.isFlying())
    {
        b0 = (byte)(b0 | 2);
    }

    if (this.isAllowFlying())
    {
        b0 = (byte)(b0 | 4);
    }

    if (this.isCreativeMode())
    {
        b0 = (byte)(b0 | 8);
    }

    buf.writeByte(b0);
    buf.writeFloat(this.flySpeed);
    buf.writeFloat(this.walkSpeed);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:C13PacketPlayerAbilities.java

示例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.writeFloat(this.health);
    buf.writeVarIntToBuffer(this.foodLevel);
    buf.writeFloat(this.saturationLevel);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:SPacketUpdateHealth.java

示例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.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);
    buf.writeByte(S08PacketPlayerPosLook.EnumFlags.func_180056_a(this.field_179835_f));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:S08PacketPlayerPosLook.java

示例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.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);
    super.writePacketData(buf);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:CPacketPlayer.java

示例8: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes the raw packet data to the data stream.
 */
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);
    buf.writeByte(SPacketPlayerPosLook.EnumFlags.pack(this.flags));
    buf.writeVarIntToBuffer(this.teleportId);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:SPacketPlayerPosLook.java

示例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.writeString(this.soundName);
    buf.writeInt(this.posX);
    buf.writeInt(this.posY);
    buf.writeInt(this.posZ);
    buf.writeFloat(this.soundVolume);
    buf.writeByte(this.soundPitch);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:S29PacketSoundEffect.java

示例10: writeWatchableObjectToPacketBuffer

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
 * Writes a watchable object (entity attribute of type {byte, short, int, float, string, ItemStack,
 * ChunkCoordinates}) to the specified PacketBuffer
 */
private static void writeWatchableObjectToPacketBuffer(PacketBuffer buffer, DataWatcher.WatchableObject object) throws IOException
{
    int i = (object.getObjectType() << 5 | object.getDataValueId() & 31) & 255;
    buffer.writeByte(i);

    switch (object.getObjectType())
    {
        case 0:
            buffer.writeByte(((Byte)object.getObject()).byteValue());
            break;

        case 1:
            buffer.writeShort(((Short)object.getObject()).shortValue());
            break;

        case 2:
            buffer.writeInt(((Integer)object.getObject()).intValue());
            break;

        case 3:
            buffer.writeFloat(((Float)object.getObject()).floatValue());
            break;

        case 4:
            buffer.writeString((String)object.getObject());
            break;

        case 5:
            ItemStack itemstack = (ItemStack)object.getObject();
            buffer.writeItemStackToBuffer(itemstack);
            break;

        case 6:
            BlockPos blockpos = (BlockPos)object.getObject();
            buffer.writeInt(blockpos.getX());
            buffer.writeInt(blockpos.getY());
            buffer.writeInt(blockpos.getZ());
            break;

        case 7:
            Rotations rotations = (Rotations)object.getObject();
            buffer.writeFloat(rotations.getX());
            buffer.writeFloat(rotations.getY());
            buffer.writeFloat(rotations.getZ());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:51,代码来源:DataWatcher.java

示例11: writePacketData

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void writePacketData(PacketBuffer buf) throws IOException
{
    buf.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);
    super.writePacketData(buf);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:CPacketPlayer.java

示例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.writeByte(this.state);
    buf.writeFloat(this.value);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketChangeGameState.java

示例13: write

import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void write(PacketBuffer buf, Rotations value)
{
    buf.writeFloat(value.getX());
    buf.writeFloat(value.getY());
    buf.writeFloat(value.getZ());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:DataSerializers.java


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