Java Code Examples for io.netty.buffer.ByteBuf.readFloat()

The following are Jave code examples for showing how to use readFloat() of the io.netty.buffer.ByteBuf class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: FlexMC   File: MessageS27EntityRelMoveLook.java   Source Code and License Vote up 5 votes
@Override
public void read( ByteBuf buf ) throws IOException {
    entityId = readVarInt( buf );
    deltaX = buf.readShort();
    deltaY = buf.readShort();
    deltaZ = buf.readShort();
    yaw = buf.readFloat();
    pitch = buf.readFloat();
    onGround = buf.readBoolean();
}
 
Example 2
Project: FirstAid   File: MessageAddHealth.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf) {
    this.table = new float[8];
    for (int i = 0; i < 8; i++) {
        this.table[i] = buf.readFloat();
    }
}
 
Example 3
Project: FlexMC   File: MessageC0EPPlayerPosAndLook.java   Source Code and License Vote up 5 votes
@Override
public void read( ByteBuf buf ) throws IOException {
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
    yaw = buf.readFloat();
    pitch = buf.readFloat();
    onGround = buf.readBoolean();
}
 
Example 4
Project: pnc-repressurized   File: PacketPlaySound.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buffer) {
    super.fromBytes(buffer);
    soundEvent = new SoundEvent(new ResourceLocation(ByteBufUtils.readUTF8String(buffer)));
    category = SoundCategory.values()[buffer.readInt()];
    volume = buffer.readFloat();
    pitch = buffer.readFloat();
    bool = buffer.readBoolean();
}
 
Example 5
Project: pnc-repressurized   File: PacketUpdateGui.java   Source Code and License Vote up 5 votes
public static Object readField(ByteBuf buf, int type) {
    switch (type) {
        case 0:
            return buf.readInt();
        case 1:
            return buf.readFloat();
        case 2:
            return buf.readDouble();
        case 3:
            return buf.readBoolean();
        case 4:
            return ByteBufUtils.readUTF8String(buf);
        case 5:
            return buf.readByte();
        case 6:
            return ByteBufUtils.readItemStack(buf);
        case 7:
            if (!buf.readBoolean()) return null;
            return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), ByteBufUtils.readTag(buf));
        case 8:
            try {
                PacketBuffer packetBuffer = new PacketBuffer(buf);
                NBTTagCompound tag = packetBuffer.readCompoundTag();
                if (tag == null) return EmptyHandler.INSTANCE;
                ItemStackHandler handler = new ItemStackHandler();
                handler.deserializeNBT(tag);
                return handler;
            } catch (IOException e) {
                return EmptyHandler.INSTANCE;
            }
    }
    throw new IllegalArgumentException("Invalid sync type! " + type);
}
 
Example 6
Project: harshencastle   File: MessagePacketSpawnBloodParticle.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf) {		
	this.position = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	this.directionSpeed = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	this.scale = buf.readFloat();
	this.disableMoving = buf.readBoolean();

}
 
Example 7
Project: SimpleTubes   File: PacketItemAdd.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());

	World world = SimpleTubes.proxy.getWorld(dim);
	this.tile = world.getTileEntity(pos);

	this.id = buf.readInt();
	this.stack = ByteBufUtils.readItemStack(buf);
	this.progress = buf.readFloat();
	this.direction = buf.readByte();
	this.color = buf.readInt();
}
 
Example 8
Project: Mods   File: TF2Message.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf) {
	this.x=buf.readFloat();
	this.y=buf.readFloat();
	this.z=buf.readFloat();
	this.airborne=buf.readBoolean();
}
 
Example 9
Project: PurificatiMagicae   File: CPacketSpawnSipParticle.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf)
{
    pos = ByteBufTools.readVector3d(buf);
    posTo = ByteBufTools.readVector3d(buf);
    speed = buf.readFloat();
    sipType = ByteBufUtils.readUTF8String(buf);
    amount = buf.readInt();
}
 
Example 10
Project: BetterBeginningsReborn   File: EntityThrownKnife.java   Source Code and License Vote up 5 votes
@Override
public void readSpawnData(ByteBuf additionalData) 
{
	knife = ByteBufUtils.readItemStack(additionalData);
	baseDamage = additionalData.readFloat();
	force = additionalData.readFloat();
}
 
Example 11
Project: Never-Enough-Currency   File: MessageSyncController.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
	this.name = ByteBufUtils.readUTF8String(buf);
	this.pos = new BlockPos(buf.readFloat(), buf.readFloat(), buf.readFloat());
}
 
Example 12
Project: FlexMC   File: MessageC13PlayerAbilities.java   Source Code and License Vote up 4 votes
@Override
public void read( ByteBuf buf ) throws IOException {
    flags = buf.readByte();
    flyingSpeed = buf.readFloat();
    walkingSpeed = buf.readFloat();
}
 
Example 13
Project: Never-Enough-Currency   File: MessageSyncAdd.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
	this.entityId = buf.readInt();
	this.amount = buf.readFloat();
}
 
Example 14
Project: pnc-repressurized   File: PacketUpdatePressureModule.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buffer) {
    super.fromBytes(buffer);
    fieldId = buffer.readInt();
    value = buffer.readFloat();
}
 
Example 15
Project: Past-Client   File: PastFloatOption.java   Source Code and License Vote up 4 votes
@Override
public Float fromByteBuffer(ByteBuf source) {
    return source.readFloat();
}
 
Example 16
Project: reactive-pg-client   File: DataType.java   Source Code and License Vote up 4 votes
@Override
public Float decodeBinary(int len, ByteBuf buff) {
  return buff.readFloat();
}
 
Example 17
Project: FirstAid   File: MessageReceiveDamage.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
    part = EnumPlayerPart.fromID(buf.readByte());
    damageAmount = buf.readFloat();
    minHealth = buf.readFloat();
}
 
Example 18
Project: Etheric   File: MessageStabilityData.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
	stability = buf.readFloat();
}
 
Example 19
Project: PurificatiMagicae   File: CPacketSyncSif.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf)
{
    pos = GlobalChunkPos.readBytes(buf);
    value = buf.readFloat();
}
 
Example 20
Project: Never-Enough-Currency   File: MessageSyncPrice.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
	this.amount = buf.readFloat();
	this.pos = new BlockPos(buf.readFloat(), buf.readFloat(), buf.readFloat());
}