java.lang.Object
org.skriptlang.skript.bukkit.itemcomponents.ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
org.skriptlang.skript.bukkit.itemcomponents.equippable.EquippableWrapper
All Implemented Interfaces:
Cloneable

public class EquippableWrapper extends ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
A ComponentWrapper for getting and setting data on an Equippable component.
  • Field Details

    • HAS_EQUIP_ON_INTERACT

      public static final boolean HAS_EQUIP_ON_INTERACT
    • HAS_CAN_BE_SHEARED

      public static final boolean HAS_CAN_BE_SHEARED
    • HAS_SHEAR_SOUND

      public static final boolean HAS_SHEAR_SOUND
  • Constructor Details

    • EquippableWrapper

      public EquippableWrapper(org.bukkit.inventory.ItemStack itemStack)
    • EquippableWrapper

      public EquippableWrapper(ItemSource<?> itemSource)
    • EquippableWrapper

      public EquippableWrapper(io.papermc.paper.datacomponent.item.Equippable component)
    • EquippableWrapper

      public EquippableWrapper(io.papermc.paper.datacomponent.item.Equippable.Builder builder)
  • Method Details

    • getDataComponentType

      public io.papermc.paper.datacomponent.DataComponentType.Valued<io.papermc.paper.datacomponent.item.Equippable> getDataComponentType()
      Description copied from class: ComponentWrapper
      Returns the DataComponentType of this ComponentWrapper.
      Specified by:
      getDataComponentType in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • getComponent

      protected io.papermc.paper.datacomponent.item.Equippable getComponent(org.bukkit.inventory.ItemStack itemStack)
      Description copied from class: ComponentWrapper
      Returns the ComponentWrapper component from itemStack.
      Specified by:
      getComponent in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • getBuilder

      protected io.papermc.paper.datacomponent.item.Equippable.Builder getBuilder(org.bukkit.inventory.ItemStack itemStack)
      Description copied from class: ComponentWrapper
      Returns the ComponentWrapper builder of the component from itemStack.
      Specified by:
      getBuilder in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • setComponent

      protected void setComponent(org.bukkit.inventory.ItemStack itemStack, io.papermc.paper.datacomponent.item.Equippable component)
      Description copied from class: ComponentWrapper
      Sets the ComponentWrapper component on itemStack.
      Specified by:
      setComponent in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • getBuilder

      protected io.papermc.paper.datacomponent.item.Equippable.Builder getBuilder(io.papermc.paper.datacomponent.item.Equippable component)
      Description copied from class: ComponentWrapper
      Convert component to a builder.
      Specified by:
      getBuilder in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
      Parameters:
      component - The component.
      Returns:
      The builder.
    • clone

      public EquippableWrapper clone()
      Description copied from class: ComponentWrapper
      Returns a clone of this ComponentWrapper.
      Specified by:
      clone in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • clone

      public io.papermc.paper.datacomponent.item.Equippable clone(org.bukkit.inventory.EquipmentSlot slot)
      Returns a cloned Equippable of this EquippableWrapper with a new EquipmentSlot.
    • newComponent

      public io.papermc.paper.datacomponent.item.Equippable newComponent()
      Description copied from class: ComponentWrapper
      Returns a new component ComponentWrapper.
      Specified by:
      newComponent in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • newBuilder

      public io.papermc.paper.datacomponent.item.Equippable.Builder newBuilder()
      Description copied from class: ComponentWrapper
      Returns a new builder ComponentWrapper.
      Specified by:
      newBuilder in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • newWrapper

      public EquippableWrapper newWrapper()
      Description copied from class: ComponentWrapper
      Returns a new ComponentWrapper.
      Specified by:
      newWrapper in class ComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
    • getAllowedEntities

      public Collection<org.bukkit.entity.EntityType> getAllowedEntities()
      Returns a Collection of EntityTypes that are allowed to wear with this EquippableWrapper.
    • setAssetId

      public void setAssetId(net.kyori.adventure.key.Key key)
      Updates the model/assetId of this EquippableWrapper with key.
      Parameters:
      key - The Key to set to.
    • getAssetId

      public net.kyori.adventure.key.Key getAssetId()
      Returns the model/assetId Key of this EquippableWrapper.
    • newInstance

      public static EquippableWrapper newInstance()
      Get an EquippableWrapper with a new Equippable component.
    • getAssetId

      public static net.kyori.adventure.key.Key getAssetId(io.papermc.paper.datacomponent.item.Equippable component)
      Returns the model/assetId Key of component.

      Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId

      Parameters:
      component - The Equippable component to retrieve.
      Returns:
      The Key.
    • setAssetId

      public static io.papermc.paper.datacomponent.item.Equippable.Builder setAssetId(io.papermc.paper.datacomponent.item.Equippable.Builder builder, net.kyori.adventure.key.Key key)
      Updates the model/assetId of builder with key.

      Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId

      Parameters:
      builder - The Equippable.Builder to update.
      key - The Key to set to.
      Returns:
      builder.
    • getAllowedEntities

      public static Collection<org.bukkit.entity.EntityType> getAllowedEntities(io.papermc.paper.datacomponent.item.Equippable component)
      Returns a Collection of EntityTypes that are allowed to wear with this component.

      Paper originally returns RegistryKeySet but has no real modification capabilities.

      Parameters:
      component - The Equippable component to get from.
      Returns:
      The allowed EntityTypes.
    • convertAllowedEntities

      public static io.papermc.paper.registry.set.RegistryKeySet<org.bukkit.entity.EntityType> convertAllowedEntities(Collection<org.bukkit.entity.EntityType> entityTypes)
      Converts entityTypes into a RegistryKeySet to update the allowed entities of an Equippable component.
      Parameters:
      entityTypes - The allowed EntityTypes.
      Returns:
      RegistryKeySet representation of entityTypes.