Interface ItemComposition

  • All Superinterfaces:
    ParamHolder

    public interface ItemComposition
    extends ParamHolder
    Represents the template of a specific item type.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getAmbient()
      Get the ambient light value
      short[] getColorToReplace()
      Get the colors to be replaced on this item's model for this item.
      short[] getColorToReplaceWith()
      Get the colors applied to this item's model for this item.
      int getContrast()
      Get the contrast light value
      int getHaPrice()
      Get the high alchemy price for this item.
      int getId()
      Gets the items ID.
      String[] getInventoryActions()
      Gets an array of possible right-click menu actions the item has in a player inventory.
      int getInventoryModel()
      Gets the model ID of the inventory item.
      int getLinkedNoteId()
      Gets the item ID of the noted or unnoted variant of this item.
      String getMembersName()
      Gets the real item name, even if the player is on a F2P server.
      String getName()
      Gets the item's name as it appears in game.
      int getNote()
      Gets a value specifying whether the item is noted.
      int getPlaceholderId()
      Gets the item ID of the normal or placeholder variant of this item.
      int getPlaceholderTemplateId()
      Gets a value specifying whether the item is a placeholder.
      int getPrice()
      Gets the store price of the item.
      int getShiftClickActionIndex()
      Gets the menu action index of the shift-click action.
      short[] getTextureToReplace()
      Get the textures to be replaced on this item's model for this item.
      short[] getTextureToReplaceWith()
      Get the textures applied to this item's model for this item.
      int getXan2d()
      Get the x angle for 2d item sprites used in the inventory.
      int getYan2d()
      Get the y angle for 2d item sprites used in the inventory.
      int getZan2d()
      Get the z angle for 2d item sprites used in the inventory.
      boolean isMembers()
      Checks whether the item is members only.
      boolean isStackable()
      Checks whether the item is able to stack in a players inventory.
      boolean isTradeable()
      Returns whether or not the item can be sold on the grand exchange.
      void setColorToReplace​(short[] colorsToReplace)
      Set the colors to be replaced on this item's model for this item.
      void setColorToReplaceWith​(short[] colorToReplaceWith)
      Set the colors applied to this item's model for this item.
      void setInventoryModel​(int model)
      Set the model ID of the inventory item.
      void setName​(String name)
      Sets the item's name.
      void setShiftClickActionIndex​(int shiftClickActionIndex)
      Sets the menu action index of the shift-click action.
      void setTextureToReplace​(short[] textureToFind)
      Set the textures to be replaced on this item's model for this item.
      void setTextureToReplaceWith​(short[] textureToReplaceWith)
      Set the textures applied to this item's model for this item.
      void setXan2d​(int angle)
      Set the x angle for 2d item sprites used in the inventory.
      void setYan2d​(int angle)
      Set the y angle for 2d item sprites used in the inventory.
      void setZan2d​(int angle)
      Set the z angle for 2d item sprites used in the inventory.
    • Method Detail

      • getName

        String getName()
        Gets the item's name as it appears in game. On a members server, this is always the item's actual name. On a free server, this will be the actual name, with " (Members)" appended to it, e.g. Twisted bow (Members)
        Returns:
        the name of the item as it appears in game
      • getMembersName

        String getMembersName()
        Gets the real item name, even if the player is on a F2P server. Unlike getName(), this will not have " (Members)" at the end on F2P servers.
        Returns:
        the real name of the item
      • setName

        void setName​(String name)
        Sets the item's name.
        Parameters:
        name - the new name
      • getId

        int getId()
        Gets the items ID.
        Returns:
        the items ID
        See Also:
        ItemID
      • getNote

        int getNote()
        Gets a value specifying whether the item is noted.
        Returns:
        799 if noted, -1 otherwise
      • getLinkedNoteId

        int getLinkedNoteId()
        Gets the item ID of the noted or unnoted variant of this item.

        Calling this method on a noted item will result in the ID of itself in unnoted form, and on an unnoted item its noted variant.

        Returns:
        the noted or unnoted variant of this item
      • getPlaceholderId

        int getPlaceholderId()
        Gets the item ID of the normal or placeholder variant of this item.

        Calling this method on a normal item will result in the ID of itself in placeholder form, and on a placeholder item its normal variant.

        Returns:
        the normal or placeholder variant of this item
      • getPlaceholderTemplateId

        int getPlaceholderTemplateId()
        Gets a value specifying whether the item is a placeholder.
        Returns:
        14401 if placeholder, -1 otherwise
      • getPrice

        int getPrice()
        Gets the store price of the item.

        Although not all items can be found in a store, they have a store price which can be used to calculate high and low alchemy values. Multiplying the price by 0.6 and 0.4 gives these high and low alchemy values, respectively.

        Returns:
        the general store value of the item
        See Also:
        Constants.HIGH_ALCHEMY_MULTIPLIER, getHaPrice()
      • getHaPrice

        int getHaPrice()
        Get the high alchemy price for this item. All items have a high alchemy price, but not all items can be alched.
        Returns:
        the high alch price
      • isMembers

        boolean isMembers()
        Checks whether the item is members only.
        Returns:
        true if members only, false otherwise.
      • isStackable

        boolean isStackable()
        Checks whether the item is able to stack in a players inventory.
        Returns:
        true if stackable, false otherwise
      • isTradeable

        boolean isTradeable()
        Returns whether or not the item can be sold on the grand exchange.
      • getInventoryActions

        String[] getInventoryActions()
        Gets an array of possible right-click menu actions the item has in a player inventory.
        Returns:
        the inventory menu actions
      • getShiftClickActionIndex

        int getShiftClickActionIndex()
        Gets the menu action index of the shift-click action.
        Returns:
        the index of the shift-click action
      • setShiftClickActionIndex

        void setShiftClickActionIndex​(int shiftClickActionIndex)
        Sets the menu action index of the shift-click action.
        Parameters:
        shiftClickActionIndex - the new index of the shift-click action
      • getInventoryModel

        int getInventoryModel()
        Gets the model ID of the inventory item.
        Returns:
        the model ID
      • setInventoryModel

        void setInventoryModel​(int model)
        Set the model ID of the inventory item. You will also need to flush the item model cache and the item sprite cache to have the changes fully propagated after changing this value.
        See Also:
        Client.getItemModelCache(), Client.getItemSpriteCache()
      • getColorToReplace

        @Nullable
        short[] getColorToReplace()
        Get the colors to be replaced on this item's model for this item.
        Returns:
        the colors to be replaced
        See Also:
        JagexColor, getColorToReplaceWith()
      • getColorToReplaceWith

        @Nullable
        short[] getColorToReplaceWith()
        Get the colors applied to this item's model for this item.
        Returns:
        the colors to replace with
        See Also:
        JagexColor, getColorToReplace()
      • setColorToReplaceWith

        void setColorToReplaceWith​(short[] colorToReplaceWith)
        Set the colors applied to this item's model for this item.
        See Also:
        JagexColor, setColorToReplace(short[])
      • getTextureToReplace

        @Nullable
        short[] getTextureToReplace()
        Get the textures to be replaced on this item's model for this item.
        Returns:
        the textures to be replaced
        See Also:
        getTextureToReplaceWith()
      • setTextureToReplace

        void setTextureToReplace​(short[] textureToFind)
        Set the textures to be replaced on this item's model for this item.
        See Also:
        setTextureToReplaceWith(short[])
      • getTextureToReplaceWith

        @Nullable
        short[] getTextureToReplaceWith()
        Get the textures applied to this item's model for this item.
        Returns:
        the textures to replace with
        See Also:
        getTextureToReplace()
      • setTextureToReplaceWith

        void setTextureToReplaceWith​(short[] textureToReplaceWith)
        Set the textures applied to this item's model for this item.
        See Also:
        setTextureToReplace(short[])
      • getXan2d

        int getXan2d()
        Get the x angle for 2d item sprites used in the inventory.
        Returns:
        See Also:
        Angle
      • getYan2d

        int getYan2d()
        Get the y angle for 2d item sprites used in the inventory.
        Returns:
        See Also:
        Angle
      • getZan2d

        int getZan2d()
        Get the z angle for 2d item sprites used in the inventory.
        Returns:
        See Also:
        Angle
      • setXan2d

        void setXan2d​(int angle)
        Set the x angle for 2d item sprites used in the inventory.
        See Also:
        Angle
      • setYan2d

        void setYan2d​(int angle)
        Set the y angle for 2d item sprites used in the inventory.
        See Also:
        Angle
      • setZan2d

        void setZan2d​(int angle)
        Set the z angle for 2d item sprites used in the inventory.
        See Also:
        Angle
      • getAmbient

        int getAmbient()
        Get the ambient light value
        Returns:
      • getContrast

        int getContrast()
        Get the contrast light value
        Returns: