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 booleanstatic final booleanstatic 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.Equippableclone(org.bukkit.inventory.EquipmentSlot slot) static io.papermc.paper.registry.set.RegistryKeySet<org.bukkit.entity.EntityType> convertAllowedEntities(Collection<org.bukkit.entity.EntityType> entityTypes) ConvertsentityTypesinto aRegistryKeySetto update the allowed entities of anEquippablecomponent.Collection<org.bukkit.entity.EntityType> static Collection<org.bukkit.entity.EntityType> getAllowedEntities(io.papermc.paper.datacomponent.item.Equippable component) net.kyori.adventure.key.KeyReturns the model/assetIdKeyof thisEquippableWrapper.static net.kyori.adventure.key.KeygetAssetId(io.papermc.paper.datacomponent.item.Equippable component) Returns the model/assetIdKeyofcomponent.protected io.papermc.paper.datacomponent.item.Equippable.BuildergetBuilder(io.papermc.paper.datacomponent.item.Equippable component) Convertcomponentto a builder.protected io.papermc.paper.datacomponent.item.Equippable.BuildergetBuilder(org.bukkit.inventory.ItemStack itemStack) Returns theComponentWrapperbuilder of the component fromitemStack.protected io.papermc.paper.datacomponent.item.EquippablegetComponent(org.bukkit.inventory.ItemStack itemStack) Returns theComponentWrappercomponent fromitemStack.io.papermc.paper.datacomponent.DataComponentType.Valued<io.papermc.paper.datacomponent.item.Equippable> Returns theDataComponentTypeof thisComponentWrapper.io.papermc.paper.datacomponent.item.Equippable.BuilderReturns a new builderComponentWrapper.io.papermc.paper.datacomponent.item.EquippableReturns a new componentComponentWrapper.static EquippableWrapperGet anEquippableWrapperwith a newEquippablecomponent.Returns a newComponentWrapper.static io.papermc.paper.datacomponent.item.Equippable.BuildersetAssetId(io.papermc.paper.datacomponent.item.Equippable.Builder builder, net.kyori.adventure.key.Key key) Updates the model/assetId ofbuilderwithkey.voidsetAssetId(net.kyori.adventure.key.Key key) Updates the model/assetId of thisEquippableWrapperwithkey.protected voidsetComponent(org.bukkit.inventory.ItemStack itemStack, io.papermc.paper.datacomponent.item.Equippable component) Sets theComponentWrappercomponent 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:ComponentWrapperReturns theDataComponentTypeof thisComponentWrapper.- Specified by:
getDataComponentTypein 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:ComponentWrapperReturns theComponentWrappercomponent fromitemStack.- Specified by:
getComponentin 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:ComponentWrapperReturns theComponentWrapperbuilder of the component fromitemStack.- Specified by:
getBuilderin 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:ComponentWrapperSets theComponentWrappercomponent onitemStack.- Specified by:
setComponentin 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:ComponentWrapperConvertcomponentto a builder.- Specified by:
getBuilderin 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:ComponentWrapperReturns a clone of thisComponentWrapper.- Specified by:
clonein 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:ComponentWrapperReturns a new componentComponentWrapper.- Specified by:
newComponentin 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:ComponentWrapperReturns a new builderComponentWrapper.- Specified by:
newBuilderin classComponentWrapper<io.papermc.paper.datacomponent.item.Equippable,io.papermc.paper.datacomponent.item.Equippable.Builder>
-
newWrapper
Description copied from class:ComponentWrapperReturns a newComponentWrapper.- Specified by:
newWrapperin 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 thisEquippableWrapperwithkey.- Parameters:
key- TheKeyto set to.
-
getAssetId
public net.kyori.adventure.key.Key getAssetId()Returns the model/assetIdKeyof thisEquippableWrapper. -
newInstance
Get anEquippableWrapperwith a newEquippablecomponent. -
getAssetId
public static net.kyori.adventure.key.Key getAssetId(io.papermc.paper.datacomponent.item.Equippable component) Returns the model/assetIdKeyofcomponent.Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId
- Parameters:
component- TheEquippablecomponent 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 ofbuilderwithkey.Paper 1.21.2 to 1.21.3 uses #model Paper 1.21.4+ uses #assetId
- Parameters:
builder- TheEquippable.Builderto update.key- TheKeyto set to.- Returns:
builder.
-
getAllowedEntities
public static Collection<org.bukkit.entity.EntityType> getAllowedEntities(io.papermc.paper.datacomponent.item.Equippable component) Returns aCollectionofEntityTypes that are allowed to wear with thiscomponent.Paper originally returns
RegistryKeySetbut has no real modification capabilities.- Parameters:
component- TheEquippablecomponent 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) ConvertsentityTypesinto aRegistryKeySetto update the allowed entities of anEquippablecomponent.- Parameters:
entityTypes- The allowedEntityTypes.- Returns:
RegistryKeySetrepresentation ofentityTypes.
-