Package com.gtnewhorizons.horizonqa.api
Class NBTPathAccessor
java.lang.Object
com.gtnewhorizons.horizonqa.api.NBTPathAccessor
Traverses
NBTTagCompound structures using dotted-path notation.
Paths are dot-separated keys; numeric segments index into NBTTagList entries.
Escape a literal dot in a key with \\..
Examples:
"mInventory.0.id"— first element of the "mInventory" list, then its "id" tag"CustomName"— top-level string tag"ForgeCaps.mymod:cap\\.subkey"key containing a literal dot
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck whether a path exists in the given compound.static net.minecraft.nbt.NBTBaseResolve a dotted path against a root compound, returning the terminalNBTBaseornullif any segment is missing.static StringresolveAsString(net.minecraft.nbt.NBTTagCompound root, String path) Resolve a dotted path and return the tag's SNBT serialization, ornullif missing.
-
Method Details
-
resolve
Resolve a dotted path against a root compound, returning the terminalNBTBaseornullif any segment is missing. -
resolveAsString
Resolve a dotted path and return the tag's SNBT serialization, ornullif missing. Format is type-specific: strings quoted ("\"foo\""), longs suffixed ("5L"), ints bare. -
exists
Check whether a path exists in the given compound.
-