Interface NbtVisitor
public interface NbtVisitor
A visitor that can enumerate a NBT tree structure.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanVisit a leaf node, which is a NBT tag with a primitive or String value.booleanvisitEnter(NbtCompound compound) Begin visiting a compound node that contains multiple child nodes of different types.booleanvisitEnter(NbtList<?> list) Begin visiting a list node that contains multiple child nodes of the same type.booleanvisitLeave(NbtCompound compound) Stop visiting a compound node.booleanvisitLeave(NbtList<?> list) Stop visiting a list node.
-
Method Details
-
visit
Visit a leaf node, which is a NBT tag with a primitive or String value.- Parameters:
node- - the visited leaf node.- Returns:
- TRUE to continue visiting children at this level, FALSE otherwise.
-
visitEnter
Begin visiting a list node that contains multiple child nodes of the same type.- Parameters:
list- - the NBT tag to process.- Returns:
- TRUE to visit the child nodes of this list, FALSE otherwise.
-
visitEnter
Begin visiting a compound node that contains multiple child nodes of different types.- Parameters:
compound- - the NBT tag to process.- Returns:
- TRUE to visit the child nodes of this compound, FALSE otherwise.
-
visitLeave
Stop visiting a list node.- Parameters:
list- - the list we're done visiting.- Returns:
- TRUE for the parent to visit any subsequent sibling nodes, FALSE otherwise.
-
visitLeave
Stop visiting a compound node.- Parameters:
compound- - the compound we're done visting.- Returns:
- TRUE for the parent to visit any subsequent sibling nodes, FALSE otherwise
-