Interface SkinSelector
- All Known Implementing Classes:
BaseSkinSelector,RelativeSkinSelector
public interface SkinSelector
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classIdentifier for actions, like the default skin, scoping, sprinting, etc. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.bukkit.inventory.ItemStack weapon, String skin, SkinSelector.SkinAction action, String[] attachments) Applies the skin if one is present.default voidapplyDefaultSkin(org.bukkit.inventory.ItemStack weapon) Applies the default skin (getDefaultSkin()) to the given weapon.getActions(String skin) Returns a list of skin actions present for the given skin.getAttachments(String skin) Returns a list of attachments for the given skin.Returns a list of custom skins that were configured.Returns the default skin (The skin used when given by command, and often when just sitting in the inventory).booleanhasAction(String skin, SkinSelector.SkinAction action) Returnstrueif the givenactionexists for the skin.
-
Method Details
-
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, theSkinSelector.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
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
Returns a list of skin actions present for the given skin. If the skin does not exist, this method will returnnull(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
Returns a list of attachments for the given skin. If the skin does not exist, this method will returnnull(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
- 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.
-