Class TagCompound
java.lang.Object
com.saicone.rtag.tag.TagCompound
Class to invoke CompoundTag methods across versions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the provided CompoundTag tag.static ObjectCopy provided CompoundTag into new one.static ObjectGet Tag value associated with key.static StringGet the provided CompoundTag as Json string.static StringGet the provided CompoundTag as Json string.getValue(RtagMirror mirror, Object tag) Get current tag map with converted values.Get current tag map.static booleanCheck if CompoundTag contains certain key in Map.static booleanisTagCompound(Object object) Check if the provided object is instance of CompoundTag class.static booleanMerge the provided value into CompoundTag.static booleanMerge the provided value into CompoundTag.static ObjectnewTag()Constructs an empty CompoundTag.static ObjectnewTag(RtagMirror mirror, Object object) Constructs an CompoundTag with provided object and requiredRtagMirrorto convert Objects.
This method can convert any supported object to Map of objects using Gson deserializer.static ObjectnewTag(RtagMirror mirror, Map<String, Object> map) Constructs an CompoundTag with provided Map of Objects and requiredRtagMirrorto convert Objects.static ObjectConstructs an CompoundTag with provided NBT string.static ObjectConstructs an CompoundTag with provided Map of tag values.static ObjectnewUncheckedTag(Map<String, Object> map) Constructs an CompoundTag with provided Map of tag values.
This method doesn't provide any safe check and assumes that the provided map is completely usable to create a new CompoundTag.static booleanThe inverse result ofhasKey(Object, String).static ObjectRemove certain key from CompoundTag.static ObjectCopy provided CompoundTag into new one without exceptions.static ObjectPut certain Tag value to CompoundTag.static voidOverride the current map of tag values inside CompoundTag.
-
Field Details
-
DATA
-
-
Method Details
-
newTag
-
newTag
-
newTag
-
newUncheckedTag
Constructs an CompoundTag with provided Map of tag values.
This method doesn't provide any safe check and assumes that the provided map is completely usable to create a new CompoundTag.- Parameters:
map- Map with tags.- Returns:
- New CompoundTag instance.
-
newTag
Constructs an CompoundTag with provided object and requiredRtagMirrorto convert Objects.
This method can convert any supported object to Map of objects using Gson deserializer.- Parameters:
mirror- RtagMirror to convert objects into tags.object- Object that can be converted to CompoundTag.- Returns:
- New CompoundTag instance.
- Throws:
IllegalArgumentException- if the object is not supported.
-
newTag
Constructs an CompoundTag with provided Map of Objects and requiredRtagMirrorto convert Objects.- Parameters:
mirror- RtagMirror to convert objects into tags.map- Map with objects.- Returns:
- New CompoundTag instance.
-
isTagCompound
Check if the provided object is instance of CompoundTag class.- Parameters:
object- the object to check.- Returns:
- true if the object is an instance of CompoundTag class.
-
clone
-
safeClone
-
getValue
-
getValue
Get current tag map with converted values.- Parameters:
mirror- RtagMirror to convert tags.tag- CompoundTag instance.- Returns:
- A Map of Objects.
-
getJson
-
getJson
-
notHasKey
The inverse result ofhasKey(Object, String).- Parameters:
tag- CompoundTag instance.key- Key to find.- Returns:
- True if key exist.
-
hasKey
-
remove
-
set
-
setValue
-
merge
-
merge
Merge the provided value into CompoundTag.- Parameters:
tag- CompoundTag instance.value- The value to merge.replace- True to replace the repeated values inside CompoundTag.deep- True to merge into sub paths instead of main path.- Returns:
- true if the value was merged.
-
get
-
clear
Clear the provided CompoundTag tag.- Parameters:
tag- CompoundTag instance.
-
TStream.COMPOUNDinstead.