Class RtagEditor<T, EditorT extends RtagEditor<T,EditorT>>
java.lang.Object
com.saicone.rtag.RtagEditor<T,EditorT>
- Type Parameters:
T- Parent object type.EditorT- Editor object type.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRtagEditor(Rtag rtag, T typeObject) Constructs an NBTEditor.RtagEditor(Rtag rtag, T typeObject, Object literalObject) Constructs an NBTEditor.RtagEditor(Rtag rtag, T typeObject, Object literalObject, Object tag) Constructs an NBTEditor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd value to an ListTag on specified path inside current object tag.
SeeRtag.add(Object, Object, Object...)for more information.booleanAdd Enum ordinals into bit field on specified path.booleanAdd Enum ordinal into bit field on specified path.<E extends Enum<E>>
booleanAdd Enum elements into bit field on specified path.<E extends Enum<E>>
booleanAdd Enum element into bit field on specified path.booleanMerge the provided value into current tag using deep method.booleanMerge the provided value at provided path using deep method.Edit the current RtagEditor instance and return itself.get()Get a converted version of current tag.<V> VGet value from the specified path inside current tag.
SeeRtag.get(Object, Object...)for more information.intgetBitField(Object... path) Get Integer bit field from specified path.protected EditorTGet currentRtagEditorobject.Get exact Tag value without any conversion, from the specified path inside current tag.
SeeRtag.getExact(Object, Object...)for more information.Get current literal object.
In most cases this is a Minecraft server object.abstract ObjectgetLiteralObject(T typeObject) Get type object as literal one.Deprecated.getOptional(Object... path) Same hasget(Object...)but save the value intoOptionalType.getRtag()Get currentRtagparent.getTag()Get current tag.abstract ObjectGet current tag inside type or literal object.Get current type object defined on editor.booleanCheck if current tag has Enum ordinals in defined path.booleanCheck if current tag has Enum ordinal in defined path.<E extends Enum<E>>
booleanCheck if current tag has Enum elements array in defined path.<E extends Enum<E>>
booleanCheck if current tag has Enum element in defined path.booleanhasTag()Check if current object has tag.booleanCheck if current tag contains a object in defined path.abstract Tload()Load changes into object instance.booleanMerge the provided value into current tag.booleanMerge the provided value at provided path.booleanMove tag from specified path to any path.booleanMove tag from specified path to any path.booleanSame hashasTag()but with inverted result.booleanSame hashasTag(Object...)but with inverted result.booleanRemove value to specified path inside current tag.
SeeRtag.set(Object, Object, Object...)for more information.booleanremoveEnum(int[] ordinals, Object... path) Remove Enum ordinals from bit field on specified path.booleanremoveEnum(int ordinal, Object... path) Remove Enum ordinal from bit field on specified path.<E extends Enum<E>>
booleanremoveEnum(E[] elements, Object... path) Remove Enum elements from bit field on specified path.<E extends Enum<E>>
booleanremoveEnum(E element, Object... path) Remove Enum element from bit field on specified path.booleanChange object tag into new one.
Value must be Map<String, Object> or CompoundTag.booleanSet value to specified path inside current tag.
SeeRtag.set(Object, Object, Object...)for more information.booleanSet Enum ordinals has bit field on specified path.booleanSet Enum ordinal has bit field on specified path.<E extends Enum<E>>
booleanSet Enum elements has bit field on specified path.<E extends Enum<E>>
booleanSet Enum element has bit field on specified path.voidupdate()Update the current tag using the original object type.voidUpdate the current tag using the provided object type.
-
Field Details
-
rtag
-
typeObject
-
literalObject
-
tag
-
-
Constructor Details
-
RtagEditor
-
RtagEditor
-
RtagEditor
-
-
Method Details
-
getEditor
-
getRtag
-
getObject
Deprecated.To get current object usegetLiteralObject()instead.Get current object instance.- Returns:
- An object with CompoundTag inside.
- See Also:
-
getTypeObject
Get current type object defined on editor.- Returns:
- An object that can be converted to literal object.
-
getLiteralObject
Get current literal object.
In most cases this is a Minecraft server object.- Returns:
- An object with CompoundTag inside.
-
getLiteralObject
-
getTag
-
getTag
-
load
Load changes into object instance.- Returns:
- The current instance type object.
-
update
public void update()Update the current tag using the original object type. -
update
Update the current tag using the provided object type.- Parameters:
object- Object type according RtagEditor instance.
-
hasTag
public boolean hasTag()Check if current object has tag.- Returns:
- True if tag is not null.
-
hasTag
Check if current tag contains a object in defined path.- Parameters:
path- Final value path to get.- Returns:
- True if final value is not null.
-
notHasTag
public boolean notHasTag()Same hashasTag()but with inverted result.- Returns:
- True if tag is null.
-
notHasTag
Same hashasTag(Object...)but with inverted result.- Parameters:
path- Final value path to get.- Returns:
- True if final value is null.
-
hasEnum
Check if current tag has Enum element in defined path.- Type Parameters:
E- Enum element type.- Parameters:
element- Enum element to check.path- Path with Integer storing enum ordinals.- Returns:
- true if the tag contains a bit field with enum ordinal.
-
hasEnum
Check if current tag has Enum elements array in defined path.- Type Parameters:
E- Enum element type.- Parameters:
elements- Enum elements to check.path- Path with Integer storing enum ordinals.- Returns:
- true if the tag contains a bit field with enum ordinals.
-
hasEnum
Check if current tag has Enum ordinal in defined path.- Parameters:
ordinal- Enum ordinal to check.path- Path with Integer storing enum ordinals.- Returns:
- true if the tag contains a bit field with enum ordinal.
-
hasEnum
Check if current tag has Enum ordinals in defined path.- Parameters:
ordinals- Enum ordinal to check.path- Path with Integer storing enum ordinals.- Returns:
- true if the tag contains a bit field with enum ordinals.
-
add
Add value to an ListTag on specified path inside current object tag.
SeeRtag.add(Object, Object, Object...)for more information.- Parameters:
value- Value to add.path- Final list path to add the specified value.- Returns:
- True if the value was added.
-
addEnum
Add Enum element into bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
element- Enum element to add.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum element was added successfully.
-
addEnum
Add Enum elements into bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
elements- Enum elements to add.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum elements was added successfully.
-
addEnum
Add Enum ordinal into bit field on specified path.- Parameters:
ordinal- Enum ordinal to add.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum ordinal was added successfully.
-
addEnum
Add Enum ordinals into bit field on specified path.- Parameters:
ordinals- Enum ordinals to add.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum ordinals was added successfully.
-
set
Change object tag into new one.
Value must be Map<String, Object> or CompoundTag.- Parameters:
value- Object to replace current tag.- Returns:
- True if tag has replaced.
-
set
Set value to specified path inside current tag.
SeeRtag.set(Object, Object, Object...)for more information.- Parameters:
value- Value to set.path- Final value path to set.- Returns:
- True if the value is set.
-
setEnum
Set Enum element has bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
element- Enum element to set.path- Path to store enum ordinals has integer.- Returns:
- true if the Enum element was set successfully.
-
setEnum
Set Enum elements has bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
elements- Enum elements to set.path- Path to store enum ordinals has integer.- Returns:
- true if the Enum elements was set successfully.
-
setEnum
Set Enum ordinal has bit field on specified path.- Parameters:
ordinal- Enum ordinal to set.path- Path to store enum ordinals has integer.- Returns:
- true if the Enum ordinal was set successfully.
-
setEnum
Set Enum ordinals has bit field on specified path.- Parameters:
ordinals- Enum ordinals to set.path- Path to store enum ordinals has integer.- Returns:
- true if the Enum ordinals was set successfully.
-
merge
Merge the provided value into current tag.- Parameters:
value- The value to merge.replace- True to replace the repeated values inside current tag.- Returns:
- true if the value was merged.
-
merge
-
deepMerge
Merge the provided value into current tag using deep method.- Parameters:
value- The value to merge.replace- True to replace the repeated values inside current tag.- Returns:
- true if the value was merged.
-
deepMerge
Merge the provided value at provided path using deep method.- Parameters:
value- The value to merge.replace- True to replace the repeated values inside CompoundTag.path- Final value path to merge into.- Returns:
- true if the value was merged.
-
move
-
move
-
remove
Remove value to specified path inside current tag.
SeeRtag.set(Object, Object, Object...)for more information.- Parameters:
path- Final value path to remove.- Returns:
- True if the value associated with the path exists and is removed.
-
removeEnum
Remove Enum element from bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
element- Enum element to remove.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum element was removed or the bit field doesn't exist.
-
removeEnum
Remove Enum elements from bit field on specified path.- Type Parameters:
E- Enum element type.- Parameters:
elements- Enum elements to remove.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum elements was removed or the bit field doesn't exist.
-
removeEnum
Remove Enum ordinal from bit field on specified path.- Parameters:
ordinal- Enum ordinal to remove.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum ordinal was removed or the bit field doesn't exist.
-
removeEnum
Remove Enum ordinals from bit field on specified path.- Parameters:
ordinals- Enum ordinals to remove.path- Path with Integer storing enum ordinals.- Returns:
- true if the Enum ordinals was removed or the bit field doesn't exist.
-
get
-
get
Get value from the specified path inside current tag.
SeeRtag.get(Object, Object...)for more information.- Type Parameters:
V- Object type to cast the value.- Parameters:
path- Final value path to get.- Returns:
- The value assigned to specified path, null if not exist or a ClassCastException occurs.
-
getOptional
Same hasget(Object...)but save the value intoOptionalType.- Parameters:
path- Final value path to get.- Returns:
- The value assigned to specified path has
OptionalType.
-
getExact
Get exact Tag value without any conversion, from the specified path inside current tag.
SeeRtag.getExact(Object, Object...)for more information.- Parameters:
path- Final value path to get.- Returns:
- The value assigned to specified path, null if not exist.
-
getBitField
Get Integer bit field from specified path.- Parameters:
path- Final value path to get.- Returns:
- The value assigned to specified path, 0 if not exist.
-
edit
-
getLiteralObject()instead.