Module gomint.api

Interface Transaction


  • public interface Transaction
    Version:
    1.0
    Author:
    geNAZt
    • Method Detail

      • hasInventory

        boolean hasInventory()
        Does this transaction have a source inventory?
        Returns:
        true if source item has a inventory to base on, false if not
      • getSourceItem

        ItemStack getSourceItem()
        Get the source item from the transaction. Mostly this is the old itemstack from the source inventory. Can also be null when there is no source (like crafting)
        Returns:
        the item source or null if there is none
      • getTargetItem

        ItemStack getTargetItem()
        Get the target (consuming) item of this transaction
        Returns:
        the target of this transaction
      • getInventory

        Inventory getInventory()
        Get the source inventory. This is null when hasInventory() is false
        Returns:
        the source inventory or null
      • getSlot

        int getSlot()
        Get the source slot from the source inventory. This will be -1 if hasInventory() is false
        Returns:
        the slot number or -1