Empeld
Empeld plugin documentation.
essentials.Prefabs.Interop.NBTData Class Reference

Public Member Functions

Get< T > (string tagName)
 
Get< T > (params string[] tags)
 

Static Public Member Functions

static NBTData Load (Stream stream)
 
static NBTData Load (BinaryReader reader)
 

Protected Member Functions

 NBTData ()
 

Constructor & Destructor Documentation

◆ NBTData()

essentials.Prefabs.Interop.NBTData.NBTData ( )
protected
15  {
16  }

Member Function Documentation

◆ Get< T >() [1/2]

T essentials.Prefabs.Interop.NBTData.Get< T > ( string  tagName)

Attribute: tagName

;

19  {
20  return (T)_data[tagName];
21  }

◆ Get< T >() [2/2]

T essentials.Prefabs.Interop.NBTData.Get< T > ( params string []  tags)

Attribute: tags[i]

as NBTData;

Attribute: tags[tags.Length-1]

;

24  {
25  NBTData curr = this;
26  for (int i=0; i<tags.Length-1; ++i)
27  {
28  curr = curr._data[tags[i]] as NBTData;
29  }
30  return (T)curr._data[tags[tags.Length-1]];
31  }
NBTData()
Definition: NBTData.cs:14

◆ Load() [1/2]

static NBTData essentials.Prefabs.Interop.NBTData.Load ( Stream  stream)
static
34  {
35  return Load(new BinaryReader(stream));
36  }
static NBTData Load(Stream stream)
Definition: NBTData.cs:33

◆ Load() [2/2]

static NBTData essentials.Prefabs.Interop.NBTData.Load ( BinaryReader  reader)
static

Attribute: name

= LoadCompound(reader);

39  {
40  byte tagId = reader.ReadByte();
41  if (tagId != 0x0a)
42  throw new Exception("Expected compound root tag");
43 
44  short nameLen = reader.ReadInt16BE();
45  string name = new string(reader.ReadChars(nameLen));
46 
47  var root = new NBTData();
48  root._data[name] = LoadCompound(reader);
49  return root;
50  }
NBTData()
Definition: NBTData.cs:14

The documentation for this class was generated from the following file: