Interface ItemRewriter<T extends Protocol<?,?,?,?>>
- All Superinterfaces:
MappingDataListener
,Rewriter<T>
-
Method Summary
Modifier and TypeMethodDescriptionhandleHashedItem
(UserConnection connection, HashedItem item) Returns the rewritten item, which may or may not be the same given HashedItem instance.@Nullable Item
handleItemToClient
(UserConnection connection, @Nullable Item item) Returns the rewritten item, which may or may not be the same given Item instance.@Nullable Item
handleItemToServer
(UserConnection connection, @Nullable Item item) Returns the rewritten item, which may or may not be the same given Item instance.Returns the item array type of the current protocol.itemType()
Returns the item type of the current protocol.Returns the mapped item array type of the target protocol.Returns the mapped item type of the target protocol.default String
Returns the NBT tag name used for storing original item data.default String
nbtTagName
(String nbt) Prefixes the NBT tag name with the current protocol'snbtTagName()
.Methods inherited from interface com.viaversion.viaversion.api.rewriter.MappingDataListener
onMappingDataLoaded
-
Method Details
-
handleItemToClient
Returns the rewritten item, which may or may not be the same given Item instance.- Parameters:
connection
- user connectionitem
- item- Returns:
- rewritten item
-
handleItemToServer
Returns the rewritten item, which may or may not be the same given Item instance.- Parameters:
connection
- user connectionitem
- item- Returns:
- rewritten item
-
handleHashedItem
Returns the rewritten item, which may or may not be the same given HashedItem instance.Used starting with 1.21.6.
- Parameters:
connection
- user connectionitem
- hashed item- Returns:
- rewritten hashed item
-
itemType
Returns the item type of the current protocol.- Returns:
- item type
-
itemArrayType
Returns the item array type of the current protocol.- Returns:
- item array type
-
mappedItemType
Returns the mapped item type of the target protocol.- Returns:
- mapped item type
-
mappedItemArrayType
Returns the mapped item array type of the target protocol.- Returns:
- mapped item array type
-
nbtTagName
Returns the NBT tag name used for storing original item data.- Returns:
- NBT tag name
-
nbtTagName
Prefixes the NBT tag name with the current protocol'snbtTagName()
.- Parameters:
nbt
- NBT tag name- Returns:
- prefixed NBT tag name
-