Class RelativeSkinSelector

java.lang.Object
me.deecaad.weaponmechanics.weapon.skin.RelativeSkinSelector
All Implemented Interfaces:
me.deecaad.core.file.Serializer<RelativeSkinSelector>, SkinSelector

public class RelativeSkinSelector extends Object implements SkinSelector, me.deecaad.core.file.Serializer<RelativeSkinSelector>
  • Constructor Details

  • Method Details

    • getSkins

      public Map<String,RelativeSkin> getSkins()
    • getActions

    • getAttachments

      public Map<String,RelativeSkin> getAttachments()
    • getDefaultSkin

      @NotNull public BaseSkin getDefaultSkin()
      Description copied from interface: SkinSelector
      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.
      Specified by:
      getDefaultSkin in interface SkinSelector
      Returns:
      The default skin.
    • getCustomSkins

      @NotNull public Set<String> getCustomSkins()
      Description copied from interface: SkinSelector
      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.
      Specified by:
      getCustomSkins in interface SkinSelector
      Returns:
      All configured cosmetic skins.
    • getActions

      @NotNull public Set<SkinSelector.SkinAction> getActions(@Nullable String skin)
      Description copied from interface: SkinSelector
      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).
      Specified by:
      getActions in interface SkinSelector
      Parameters:
      skin - The skin to check, or null for default.
      Returns:
      The present actions.
    • getAttachments

      @Nullable public Set<String> getAttachments(@Nullable String skin)
      Description copied from interface: SkinSelector
      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).
      Specified by:
      getAttachments in interface SkinSelector
      Parameters:
      skin - The skin to check, or null for default.
      Returns:
      The present attachments.
    • hasAction

      public boolean hasAction(@Nullable String skin, @Nullable SkinSelector.SkinAction action)
      Description copied from interface: SkinSelector
      Returns true if the given action exists for the skin. Used by the SkinHandler.
      Specified by:
      hasAction in interface SkinSelector
      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

      public void apply(@NotNull org.bukkit.inventory.ItemStack weapon, @Nullable String skin, @Nullable SkinSelector.SkinAction action, @Nullable String[] attachments)
      Description copied from interface: SkinSelector
      Applies the skin if one is present.
      Specified by:
      apply in interface SkinSelector
      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.
    • serialize

      @NotNull public RelativeSkinSelector serialize(@NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Specified by:
      serialize in interface me.deecaad.core.file.Serializer<RelativeSkinSelector>
      Throws:
      me.deecaad.core.file.SerializerException