the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "Tag.h"
3
4class ByteTag : public Tag
5{
6public:
7 byte data;
8 ByteTag(const wstring &name) : Tag(name) {}
9 ByteTag(const wstring &name, byte data) : Tag(name) {this->data = data; }
10
11 void write(DataOutput *dos) { dos->writeByte(data); }
12 void load(DataInput *dis, int tagDepth) { data = dis->readByte(); }
13
14 byte getId() { return TAG_Byte; }
15 wstring toString()
16 {
17 static wchar_t buf[32];
18 swprintf(buf,32,L"%d",data);
19 return wstring( buf );
20 }
21
22 bool equals(Tag *obj)
23 {
24 if (Tag::equals(obj))
25 {
26 ByteTag *o = (ByteTag *) obj;
27 return data == o->data;
28 }
29 return false;
30 }
31
32 Tag *copy()
33 {
34 return new ByteTag(getName(), data);
35 }
36};