Class ItemTagStream
java.lang.Object
com.saicone.rtag.stream.TStream<ItemStack>
com.saicone.rtag.item.ItemTagStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ItemTagStreamItemTagStream public instance adapted for current server version.Fields inherited from class com.saicone.rtag.stream.TStream
COMPOUND -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a simple ItemTagStream instance.ItemTagStream(@NotNull List<ItemMirror> mirror) Constructs an ItemTagStream instance with specified parameters.ItemTagStream(@NotNull List<ItemMirror> mirror, float version, @NotNull String versionKey) Deprecated, for removal: This API element is subject to removal in a future version.ItemTagStream(@NotNull List<ItemMirror> mirror, @NotNull com.saicone.rtag.util.MC targetVersion) Constructs an ItemTagStream instance with specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionfromReadableMap(@NotNull Map<String, Object> map) Get item by read provided Map of objects and also convert display name and lore to component if is required.Get currentItemMirrorlist.@NotNull com.saicone.rtag.util.MCThe target version to convert items.floatDeprecated, for removal: This API element is subject to removal in a future version.getVersion(Object compound) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.listToBase64(List<ItemStack> items) static @NotNull ItemTagStreamofVersion(float minVersion, float currentVersion) Deprecated, for removal: This API element is subject to removal in a future version.static @NotNull ItemTagStreamDeprecated, for removal: This API element is subject to removal in a future version.voidonLoad(@NotNull Object compound, @NotNull com.saicone.rtag.util.MC from, @NotNull com.saicone.rtag.util.MC to) Executed method when CompoundTag used tu build an item.voidExecuted method when CompoundTag used tu build an item.voidDeprecated, for removal: This API element is subject to removal in a future version.voidExecuted method when CompoundTag is extracted from item.toReadableMap(@NotNull ItemStack item) Convert item to readable map, making display name and lore components as colored strings.static @NotNull ItemTagStreamprotected booleanversionMatches(float from, float to) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class com.saicone.rtag.stream.TStream
clone, fromBase, fromBase64, fromBase64, fromBukkitObject, fromBytes, fromBytes, fromCompound, fromCompound, fromFile, fromFile, fromList, fromMap, fromString, listFromBase64, listFromBytes, toBase64, toBytes, toCompound, toFile, toMap, toString
-
Field Details
-
INSTANCE
ItemTagStream public instance adapted for current server version.
-
-
Constructor Details
-
ItemTagStream
public ItemTagStream()Constructs a simple ItemTagStream instance. -
ItemTagStream
Constructs an ItemTagStream instance with specified parameters.- Parameters:
mirror- a list containing item mirrors to apply.
-
ItemTagStream
public ItemTagStream(@NotNull @NotNull List<ItemMirror> mirror, @NotNull @NotNull com.saicone.rtag.util.MC targetVersion) Constructs an ItemTagStream instance with specified parameters.- Parameters:
mirror- a list containing item mirrors to apply.targetVersion- the target version to convert items.
-
ItemTagStream
@Deprecated(since="1.5.14", forRemoval=true) public ItemTagStream(@NotNull @NotNull List<ItemMirror> mirror, float version, @NotNull @NotNull String versionKey) Deprecated, for removal: This API element is subject to removal in a future version.Constructs an ItemTagStream with specifiedItemMirrorlist and additional parameters.- Parameters:
mirror- Mirror list.version- Server version.versionKey- Version key identifier from compound.
-
-
Method Details
-
valueOf
-
getMirror
Get currentItemMirrorlist.- Returns:
- a list of item mirror.
-
getTargetVersion
-
extract
-
build
-
toReadableMap
-
fromReadableMap
Get item by read provided Map of objects and also convert display name and lore to component if is required.- Parameters:
map- Map that represent the object.- Returns:
- An item representation using readable Map as compound.
-
onSave
-
onLoad
-
onLoad
public void onLoad(@NotNull @NotNull Object compound, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to) Executed method when CompoundTag used tu build an item.- Parameters:
compound- CompoundTag with item information.from- Version specified in compound.to- Version to convert.
-
listToBase64
-
ofVersion
@NotNull @Deprecated(since="1.5.14", forRemoval=true) public static @NotNull ItemTagStream ofVersion(float minVersion, float currentVersion) Deprecated, for removal: This API element is subject to removal in a future version.Create an item tag stream for provided version range.- Parameters:
minVersion- The minimum version to support.currentVersion- The current server version.- Returns:
- A newly generated item tag stream.
-
ofVersion
@NotNull @Deprecated(since="1.5.14", forRemoval=true) public static @NotNull ItemTagStream ofVersion(float minVersion, float currentVersion, @Nullable @Nullable String versionKey) Deprecated, for removal: This API element is subject to removal in a future version.Create an item tag stream for provided version range.- Parameters:
minVersion- The minimum version to support.currentVersion- The current server version.versionKey- Version key identifier from compound.- Returns:
- A newly generated item tag stream.
-
getVersion
Deprecated, for removal: This API element is subject to removal in a future version.Get current server version for this instance.- Returns:
- Server version.
-
getVersion
@Nullable @Deprecated(since="1.5.14", forRemoval=true) public @Nullable Float getVersion(Object compound) Deprecated, for removal: This API element is subject to removal in a future version.Get current version number from item compound.- Parameters:
compound- CompoundTag that represent an item.- Returns:
- A valid version number or null.
-
getVersionKey
Deprecated, for removal: This API element is subject to removal in a future version.Get current version key identifier.- Returns:
- Version key identifier.
-
onLoad
@Deprecated(since="1.5.14", forRemoval=true) public void onLoad(Object compound, float from, float to) Deprecated, for removal: This API element is subject to removal in a future version.Executed method when CompoundTag used tu build an item.- Parameters:
compound- CompoundTag with item information.from- Version specified in compound.to- Version to convert.
-
versionMatches
Deprecated, for removal: This API element is subject to removal in a future version.Check if the provided pair of versions matches.- Parameters:
from- Version specified in compound.to- Version to convert.- Returns:
- true if matches.
-