add a function for checking whether a tag is primitive or not

mainly for niche uses
This commit is contained in:
2025-07-23 12:18:55 +02:00
parent 5d7c244c8f
commit 65ee7c5b55
2 changed files with 19 additions and 0 deletions

View File

@@ -98,3 +98,17 @@ int nbt_prim_tagsize(u8 tag) {
default: return -1;
}
}
int nbt_isprim(u8 tag) {
switch (tag) {
case NBT_I8:
case NBT_I16:
case NBT_I32:
case NBT_F32:
case NBT_I64:
case NBT_F64:
return 1;
default:
return 0;
}
}