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 ShortTag : public Tag
5{
6public:
7 short data;
8 ShortTag(const wstring &name) : Tag(name) {}
9 ShortTag(const wstring &name, int data) : Tag(name) {this->data = data; }
10
11 void write(DataOutput *dos) { dos->writeShort(data); }
12 void load(DataInput *dis, int tagDepth) { data = dis->readShort(); }
13
14 byte getId() { return TAG_Short; }
15 wstring toString()
16 {
17 static wchar_t buf[32];
18 swprintf(buf,32,L"%d",data);
19 return wstring( buf );
20 }
21
22 Tag *copy()
23 {
24 return new ShortTag(getName(), data);
25 }
26
27 bool equals(Tag *obj)
28 {
29 if (Tag::equals(obj))
30 {
31 ShortTag *o = (ShortTag *) obj;
32 return data == o->data;
33 }
34 return false;
35 }
36};