Exemplo n.º 1
0
        public static CompoundTag ReadTag(byte[] bytes, ByteOrder order = ByteOrder.Little, bool isNetwork = false)
        {
            CompoundTag tag = new CompoundTag();

            using (NBTStream stream = new NBTStream(bytes, order, isNetwork))
            {
                tag.ReadTag(stream);
            }

            return(tag);
        }
Exemplo n.º 2
0
        public static CompoundTag ReadTag(byte[] bytes, NBTEndian endian = NBTEndian.LITTLE_ENDIAN, bool isNetwork = false)
        {
            CompoundTag tag = new CompoundTag();

            using (NBTStream stream = new NBTStream(bytes, endian))
            {
                stream.Network = isNetwork;
                tag.ReadTag(stream);
            }

            return(tag);
        }
Exemplo n.º 3
0
        public static CompoundTag ReadTag(byte[] bytes, out int offset, NBTEndian endian = NBTEndian.LITTLE_ENDIAN,
                                          bool isNetwork = false)
        {
            CompoundTag tag    = new CompoundTag();
            NBTStream   stream = new NBTStream(bytes, endian);

            try
            {
                stream.Network = isNetwork;
                tag.ReadTag(stream);
            }
            catch
            {
            }
            finally
            {
                offset = stream.Offset;
                stream.Dispose();
            }

            return(tag);
        }