Interface ItemRewriter<T extends Protocol<?,?,?,?>>

All Superinterfaces:
MappingDataListener, Rewriter<T>

public interface ItemRewriter<T extends Protocol<?,?,?,?>> extends Rewriter<T>
  • Method Details

    • handleItemToClient

      @Nullable Item handleItemToClient(UserConnection connection, @Nullable Item item)
      Returns the rewritten item, which may or may not be the same given Item instance.
      Parameters:
      connection - user connection
      item - item
      Returns:
      rewritten item
    • handleItemToServer

      @Nullable Item handleItemToServer(UserConnection connection, @Nullable Item item)
      Returns the rewritten item, which may or may not be the same given Item instance.
      Parameters:
      connection - user connection
      item - item
      Returns:
      rewritten item
    • itemType

      default @Nullable Type<Item> itemType()
      Returns the item type of the current protocol.
      Returns:
      item type
    • itemArrayType

      default @Nullable Type<Item[]> itemArrayType()
      Returns the item array type of the current protocol.
      Returns:
      item array type
    • mappedItemType

      default @Nullable Type<Item> mappedItemType()
      Returns the mapped item type of the target protocol.
      Returns:
      mapped item type
    • mappedItemArrayType

      default @Nullable Type<Item[]> mappedItemArrayType()
      Returns the mapped item array type of the target protocol.
      Returns:
      mapped item array type
    • nbtTagName

      default String nbtTagName()
      Returns the NBT tag name used for storing original item data.
      Returns:
      NBT tag name
    • nbtTagName

      default String nbtTagName(String nbt)
      Prefixes the NBT tag name with the current protocol's nbtTagName().
      Parameters:
      nbt - NBT tag name
      Returns:
      prefixed NBT tag name