public override void Read(PrimitiveReader reader) { Text = reader.ReadStringProto(ProtoConsts.MaxStringChars); AssumeCommand = reader.ReadBool(); var hasPos = reader.ReadBool(); if (hasPos) { LookedAtBlock = reader.ReadBlockPosProto(); } }
public async ValueTask Read(PrimitiveReader primitiveReader, CancellationToken cancellationToken) { BoolValue = await primitiveReader.ReadBool(cancellationToken); ByteValue = await primitiveReader.ReadByte(cancellationToken); SByteValue = await primitiveReader.ReadSByte(cancellationToken); ShortValue = await primitiveReader.ReadInt16(cancellationToken); UShortValue = await primitiveReader.ReadUInt16(cancellationToken); IntValue = await primitiveReader.ReadInt32(cancellationToken); UIntValue = await primitiveReader.ReadUInt32(cancellationToken); LongValue = await primitiveReader.ReadInt64(cancellationToken); ULongValue = await primitiveReader.ReadUInt64(cancellationToken); FloatValue = await primitiveReader.ReadSingle(cancellationToken); DoubleValue = await primitiveReader.ReadDouble(cancellationToken); StringValue = await primitiveReader.ReadString(cancellationToken); deserializationCounter++; }
public override void Read(PrimitiveReader reader) { Position = new Vec3(reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble()); Yaw = reader.ReadFloat(); Pitch = reader.ReadFloat(); OnGround = reader.ReadBool(); }
public override void Read(PrimitiveReader reader) { Type = (TypeEnum)reader.ReadVarint(); switch (Type) { case TypeEnum.DisplayedRecipe: RecipeId = reader.ReadInt(); break; case TypeEnum.CraftingBookStatus: CraftingBookOpen = reader.ReadBool(); CraftingFilter = reader.ReadBool(); break; default: throw new InvalidPacketException(nameof(Type), Type); } }
public override void Read(PrimitiveReader reader) { RightPaddleTurning = reader.ReadBool(); LeftPaddleTurning = reader.ReadBool(); }
public async ValueTask Read(PrimitiveReader primitiveReader, CancellationToken cancellationToken) { _ = await primitiveReader.ReadBool(cancellationToken); }
public override void Read(PrimitiveReader reader) { WindowId = reader.ReadSByte(); ActionNum = reader.ReadShort(); Accepted = reader.ReadBool(); }
public override void Read(PrimitiveReader reader) { OnGround = reader.ReadBool(); }
public override void Read(PrimitiveReader reader) { WindowId = reader.ReadSByte(); RecipeId = reader.ReadVarint(); MakeAll = reader.ReadBool(); }