Interface CargoStackAPI


public interface CargoStackAPI
  • Method Details

    • isWeaponStack

      boolean isWeaponStack()
    • isResourceStack

      @Deprecated boolean isResourceStack()
      Deprecated.
      Use isCommodityStack() instead.
      Returns:
    • isCommodityStack

      boolean isCommodityStack()
    • isMarineStack

      boolean isMarineStack()
    • isFuelStack

      boolean isFuelStack()
    • isSupplyStack

      boolean isSupplyStack()
    • isCrewStack

      boolean isCrewStack()
    • isPersonnelStack

      boolean isPersonnelStack()
    • getCommodityId

      String getCommodityId()
      Returns null if it's not a commodity stack.
      Returns:
    • getCargoSpace

      float getCargoSpace()
    • getCargoSpacePerUnit

      float getCargoSpacePerUnit()
    • getSize

      float getSize()
    • getFree

      float getFree()
    • setSize

      void setSize(float size)
    • add

      void add(float quantity)
    • subtract

      void subtract(float quantity)
    • getMaxSize

      float getMaxSize()
    • isFull

      boolean isFull()
    • getType

    • setType

      void setType(CargoAPI.CargoItemType type)
    • isNull

      boolean isNull()
      If true, it's an empty cargo stack. These get created for spacing, a result of the player moving cargo around.
      Returns:
    • getData

      Object getData()
      Usually a String. Its contents (i.e. the resource id) is how you can tell apart different types of resources.
      Returns:
    • getDisplayName

      String getDisplayName()
    • getCargo

      CargoAPI getCargo()
      Returns:
      CargoAPI that contains this stack.
    • getBaseValuePerUnit

      int getBaseValuePerUnit()
    • getWeaponSpecIfWeapon

      WeaponSpecAPI getWeaponSpecIfWeapon()
    • isModSpecStack

      @Deprecated boolean isModSpecStack()
      Deprecated.
      Call isSpecialStack() and check specialData.getId().equals(Items.MODSPEC) instead.
      Returns:
    • isFighterWingStack

      boolean isFighterWingStack()
    • getFighterWingSpecIfWing

      FighterWingSpecAPI getFighterWingSpecIfWing()
    • getHullModSpecIfHullMod

      HullModSpecAPI getHullModSpecIfHullMod()
    • getResourceIfResource

      CommoditySpecAPI getResourceIfResource()
    • isSpecialStack

      boolean isSpecialStack()
    • getSpecialDataIfSpecial

      SpecialItemData getSpecialDataIfSpecial()
    • getSpecialItemSpecIfSpecial

      SpecialItemSpecAPI getSpecialItemSpecIfSpecial()
    • getPlugin

      SpecialItemPlugin getPlugin()
      Returns a new instance of the plugin. The special item plugin is transient and many instances may be in existence at any time - i.e. one for rendering the item in cargo, one for creating the tooltip, one for executing a right-click action, etc.
      Returns:
    • setCargo

      void setCargo(CargoAPI cargo)
    • isInPlayerCargo

      boolean isInPlayerCargo()
    • isPickedUp

      boolean isPickedUp()
    • setPickedUp

      void setPickedUp(boolean isPickedUp)