Interface SkinSelector

All Known Implementing Classes:
BaseSkinSelector, RelativeSkinSelector

public interface SkinSelector
  • Method Details

    • getDefaultSkin

      @NotNull BaseSkin getDefaultSkin()
      Returns the default skin (The skin used when given by command, and often when just sitting in the inventory). This method ignores player preference, the SkinSelector.SkinAction, and any attachments, this method simply returns the default skin.
      Returns:
      The default skin.
    • applyDefaultSkin

      default void applyDefaultSkin(@NotNull org.bukkit.inventory.ItemStack weapon)
      Applies the default skin (getDefaultSkin()) to the given weapon.
      Parameters:
      weapon - The item to apply the skin to.
    • getCustomSkins

      @NotNull Set<String> getCustomSkins()
      Returns a list of custom skins that were configured. May return an empty set if no skins are configured. This method will still return the full list of skins, even if WeaponMechanicsCosmetics is not installed.
      Returns:
      All configured cosmetic skins.
    • getActions

      @Nullable Set<SkinSelector.SkinAction> getActions(@Nullable String skin)
      Returns a list of skin actions present for the given skin. If the skin does not exist, this method will return null (Except for relative skins, which will always return the full set of actions regardless of input).
      Parameters:
      skin - The skin to check, or null for default.
      Returns:
      The present actions.
    • getAttachments

      @Nullable Set<String> getAttachments(@Nullable String skin)
      Returns a list of attachments for the given skin. If the skin does not exist, this method will return null (Except for relative skins, which will always return the full set of attachments, else an empty set).
      Parameters:
      skin - The skin to check, or null for default.
      Returns:
      The present attachments.
    • hasAction

      boolean hasAction(@Nullable String skin, @Nullable SkinSelector.SkinAction action)
      Returns true if the given action exists for the skin. Used by the SkinHandler.
      Parameters:
      skin - Which skin to check, or null for default.
      action - Which action to check (Using null is allowed... but why would you use it???).
      Returns:
      true if the action exists.
    • apply

      void apply(@NotNull org.bukkit.inventory.ItemStack weapon, @Nullable String skin, @Nullable SkinSelector.SkinAction action, @Nullable String[] attachments)
      Applies the skin if one is present.
      Parameters:
      weapon - The weapon to apply the skin to.
      skin - The skin color to use, usually player's preference. Use null for default.
      action - The current action (scope/sprint/reload...). Use null for default.
      attachments - All attachments on the weapon, use null (or empty) for none.