forked from jaquadro/NBTExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUIHelper.cs
More file actions
28 lines (24 loc) · 697 Bytes
/
Copy pathUIHelper.cs
File metadata and controls
28 lines (24 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Substrate;
using Substrate.Nbt;
namespace NBTExplorer
{
public class UIHelper
{
internal static ItemInfo TryGetItemName(int id)
{
return Substrate.ItemInfo.ItemTable[id];
}
internal static ItemInfo TryGetItemName(TagNode tag)
{
var tagc = tag as TagNodeCompound;
if (tagc.ContainsKey("id") == false)
return null;
int id;
if (int.TryParse(tagc["id"].ToString(), out id))
{
return TryGetItemName(id);
}
return null;
}
}
}