Class BaseSkinSelector
java.lang.Object
me.deecaad.weaponmechanics.weapon.skin.BaseSkinSelector
- All Implemented Interfaces:
me.deecaad.core.file.Serializer<SkinSelector>,SkinSelector
public class BaseSkinSelector
extends Object
implements SkinSelector, me.deecaad.core.file.Serializer<SkinSelector>
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.deecaad.weaponmechanics.weapon.skin.SkinSelector
SkinSelector.SkinAction -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serializer. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.bukkit.inventory.ItemStack weapon, String skin, SkinSelector.SkinAction action, String[] attachments) Applies the skin if one is present.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).getSkin(String skin, SkinSelector.SkinAction action, String[] attachments) booleanhasAction(String skin, SkinSelector.SkinAction action) Returnstrueif the givenactionexists for the skin.serialize(me.deecaad.core.file.SerializeData data) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, getWikiLink, letPassThrough, shouldSerialize, tryPathTo, useLaterMethods inherited from interface me.deecaad.weaponmechanics.weapon.skin.SkinSelector
applyDefaultSkin
-
Constructor Details
-
BaseSkinSelector
public BaseSkinSelector()Default constructor for serializer. -
BaseSkinSelector
-
-
Method Details
-
getSkin
@Nullable public Skin getSkin(@Nullable String skin, @Nullable SkinSelector.SkinAction action, @Nullable String[] attachments) -
getDefaultSkin
Description copied from interface:SkinSelectorReturns 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.- Specified by:
getDefaultSkinin interfaceSkinSelector- Returns:
- The default skin.
-
getCustomSkins
Description copied from interface:SkinSelectorReturns 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:
getCustomSkinsin interfaceSkinSelector- Returns:
- All configured cosmetic skins.
-
getActions
Description copied from interface:SkinSelectorReturns 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).- Specified by:
getActionsin interfaceSkinSelector- Parameters:
skin- The skin to check, or null for default.- Returns:
- The present actions.
-
getAttachments
Description copied from interface:SkinSelectorReturns 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).- Specified by:
getAttachmentsin interfaceSkinSelector- Parameters:
skin- The skin to check, or null for default.- Returns:
- The present attachments.
-
hasAction
Description copied from interface:SkinSelector- Specified by:
hasActionin interfaceSkinSelector- 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:SkinSelectorApplies the skin if one is present.- Specified by:
applyin interfaceSkinSelector- 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.
-
getKeyword
- Specified by:
getKeywordin interfaceme.deecaad.core.file.Serializer<SkinSelector>
-
serialize
@NotNull public SkinSelector serialize(@NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException - Specified by:
serializein interfaceme.deecaad.core.file.Serializer<SkinSelector>- Throws:
me.deecaad.core.file.SerializerException
-