internal override bool ReadTag(NbtBinaryReader readStream) { if (readStream.Selector != null && !readStream.Selector(this)) { readStream.ReadInt64(); return false; } Value = readStream.ReadInt64(); return true; }
internal override bool ReadTag(NbtBinaryReader readStream) { if (readStream.Selector != null && !readStream.Selector(this)) { readStream.ReadInt64(); return(false); } Value = readStream.ReadInt64(); return(true); }
void SkipValue() { if (!atValue) { throw new NbtFormatException(NoValueToReadError); } switch (TagType) { case NbtTagType.Byte: reader.ReadByte(); break; case NbtTagType.Short: reader.ReadInt16(); break; case NbtTagType.Float: case NbtTagType.Int: reader.ReadInt32(); break; case NbtTagType.Double: case NbtTagType.Long: reader.ReadInt64(); break; case NbtTagType.ByteArray: reader.Skip(TagLength); break; case NbtTagType.IntArray: reader.Skip(sizeof(int) * TagLength); break; case NbtTagType.String: reader.SkipString(); break; default: throw new InvalidOperationException(NonValueTagError); } atValue = false; valueCache = null; }
void SkipValue() { // Make sure to check for "atValue" before calling this method switch (TagType) { case NbtTagType.Byte: reader.ReadByte(); break; case NbtTagType.Short: reader.ReadInt16(); break; case NbtTagType.Float: case NbtTagType.Int: reader.ReadInt32(); break; case NbtTagType.Double: case NbtTagType.Long: reader.ReadInt64(); break; case NbtTagType.ByteArray: reader.Skip(TagLength); break; case NbtTagType.IntArray: reader.Skip(sizeof(int) * TagLength); break; case NbtTagType.String: reader.SkipString(); break; default: throw new InvalidOperationException(NonValueTagError); } atValue = false; valueCache = null; }
internal override bool ReadTag(NbtBinaryReader readStream) { var length = readStream.ReadInt32(); if (length < 0) { throw new NbtFormatException("Negative length given in TAG_Long_Array"); } if (readStream.Selector != null && !readStream.Selector(this)) { readStream.Skip(length * sizeof(long)); return(false); } Value = new long[length]; for (var i = 0; i < length; i++) { Value[i] = readStream.ReadInt64(); } return(true); }
internal override void SkipTag(NbtBinaryReader readStream) { readStream.ReadInt64(); }
internal override void ReadTag(NbtBinaryReader readStream) { Value = readStream.ReadInt64(); }