Class EquippableWrapper
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionEquippableWrapper
(ItemSource<?> itemSource) EquippableWrapper
(io.papermc.paper.datacomponent.item.Equippable component) EquippableWrapper
(io.papermc.paper.datacomponent.item.Equippable.Builder builder) EquippableWrapper
(org.bukkit.inventory.ItemStack itemStack) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of thisComponentWrapper
.io.papermc.paper.datacomponent.item.Equippable
clone
(org.bukkit.inventory.EquipmentSlot slot) static io.papermc.paper.registry.set.RegistryKeySet
<org.bukkit.entity.EntityType> convertAllowedEntities
(Collection<org.bukkit.entity.EntityType> entityTypes) ConvertsentityTypes
into aRegistryKeySet
to update the allowed entities of anEquippable
component.Collection
<org.bukkit.entity.EntityType> static Collection
<org.bukkit.entity.EntityType> getAllowedEntities
(io.papermc.paper.datacomponent.item.Equippable component) net.kyori.adventure.key.Key
Returns the model/assetIdKey
of thisEquippableWrapper
.static net.kyori.adventure.key.Key
getAssetId
(io.papermc.paper.datacomponent.item.Equippable component) Returns the model/assetIdKey
ofcomponent
.protected io.papermc.paper.datacomponent.item.Equippable.Builder
getBuilder
(io.papermc.paper.datacomponent.item.Equippable component) Convertcomponent
to a builder.protected io.papermc.paper.datacomponent.item.Equippable.Builder
getBuilder
(org.bukkit.inventory.ItemStack itemStack) Returns theComponentWrapper
builder of the component fromitemStack
.protected io.papermc.paper.datacomponent.item.Equippable
getComponent
(org.bukkit.inventory.ItemStack itemStack) Returns theComponentWrapper
component fromitemStack
.io.papermc.paper.datacomponent.DataComponentType.Valued
<io.papermc.paper.datacomponent.item.Equippable> Returns theDataComponentType
of thisComponentWrapper
.io.papermc.paper.datacomponent.item.Equippable.Builder
Returns a new builderComponentWrapper
.io.papermc.paper.datacomponent.item.Equippable
Returns a new componentComponentWrapper
.static EquippableWrapper
Get anEquippableWrapper
with a newEquippable
component.Returns a newComponentWrapper
.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 ofbuilder
withkey
.void
setAssetId
(net.kyori.adventure.key.Key key) Updates the model/assetId of thisEquippableWrapper
withkey
.protected void
setComponent
(org.bukkit.inventory.ItemStack itemStack, io.papermc.paper.datacomponent.item.Equippable component) Sets theComponentWrapper
component onitemStack
.Methods inherited from class org.skriptlang.skript.bukkit.itemcomponents.ComponentWrapper
applyBuilder, applyComponent, applyComponent, editBuilder, equals, getBuilder, getComponent, getItemSource, getItemStack, setBuilder, toString
-
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
-
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 theDataComponentType
of thisComponentWrapper
.- Specified by:
getDataComponentType
in classComponentWrapper<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 theComponentWrapper
component fromitemStack
.- Specified by:
getComponent
in classComponentWrapper<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 theComponentWrapper
builder of the component fromitemStack
.- Specified by:
getBuilder
in classComponentWrapper<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 theComponentWrapper
component onitemStack
.- Specified by:
setComponent
in classComponentWrapper<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
Convertcomponent
to a builder.- Specified by:
getBuilder
in classComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,
io.papermc.paper.datacomponent.item.Equippable.Builder> - Parameters:
component
- The component.- Returns:
- The builder.
-
clone
Description copied from class:ComponentWrapper
Returns a clone of thisComponentWrapper
.- Specified by:
clone
in classComponentWrapper<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) -
newComponent
public io.papermc.paper.datacomponent.item.Equippable newComponent()Description copied from class:ComponentWrapper
Returns a new componentComponentWrapper
.- Specified by:
newComponent
in classComponentWrapper<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 builderComponentWrapper
.- Specified by:
newBuilder
in classComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,
io.papermc.paper.datacomponent.item.Equippable.Builder>
-
newWrapper
Description copied from class:ComponentWrapper
Returns a newComponentWrapper
.- Specified by:
newWrapper
in classComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,
io.papermc.paper.datacomponent.item.Equippable.Builder>
-
getAllowedEntities
-
setAssetId
public void setAssetId(net.kyori.adventure.key.Key key) Updates the model/assetId of thisEquippableWrapper
withkey
.- Parameters:
key
- TheKey
to set to.
-
getAssetId
public net.kyori.adventure.key.Key getAssetId()Returns the model/assetIdKey
of thisEquippableWrapper
. -
newInstance
Get anEquippableWrapper
with a newEquippable
component. -
getAssetId
public static net.kyori.adventure.key.Key getAssetId(io.papermc.paper.datacomponent.item.Equippable component) Returns the model/assetIdKey
ofcomponent
.Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId
- Parameters:
component
- TheEquippable
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 ofbuilder
withkey
.Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId
- Parameters:
builder
- TheEquippable.Builder
to update.key
- TheKey
to set to.- Returns:
builder
.
-
getAllowedEntities
public static Collection<org.bukkit.entity.EntityType> getAllowedEntities(io.papermc.paper.datacomponent.item.Equippable component) Returns aCollection
ofEntityType
s that are allowed to wear with thiscomponent
.Paper originally returns
RegistryKeySet
but has no real modification capabilities.- Parameters:
component
- TheEquippable
component to get from.- Returns:
- The allowed
EntityType
s.
-
convertAllowedEntities
public static io.papermc.paper.registry.set.RegistryKeySet<org.bukkit.entity.EntityType> convertAllowedEntities(Collection<org.bukkit.entity.EntityType> entityTypes) ConvertsentityTypes
into aRegistryKeySet
to update the allowed entities of anEquippable
component.- Parameters:
entityTypes
- The allowedEntityType
s.- Returns:
RegistryKeySet
representation ofentityTypes
.
-