Package lol.pyr.znpcsplus.api.entity
Interface PropertyHolder
- All Known Subinterfaces:
Npc
public interface PropertyHolder
Represents classes that have property values attatched to them
-
Method Summary
Modifier and TypeMethodDescriptionSet<EntityProperty<?>>
Method used to get a set of all of the property keys that this holder has a value fororg.bukkit.inventory.ItemStack
getItemProperty
(EntityProperty<?> key) Weird fix which is sadly required in order to not decrease performance when using item properties, read https://github.com/Pyrbu/ZNPCsPlus/pull/129#issuecomment-1948777764<T> T
getProperty
(EntityProperty<T> key) Method used to get the value of a property from a property holderboolean
hasProperty
(EntityProperty<?> key) Method used to check if a property holder has a value set for a specific property keyvoid
setItemProperty
(EntityProperty<?> key, org.bukkit.inventory.ItemStack value) Weird fix which is sadly required in order to not decrease performance when using item properties, read https://github.com/Pyrbu/ZNPCsPlus/pull/129#issuecomment-1948777764<T> void
setProperty
(EntityProperty<T> key, T value) Method used to set a value for the provided key on this property holder
-
Method Details
-
getProperty
Method used to get the value of a property from a property holder- Type Parameters:
T
- The type of the property value- Parameters:
key
- Unique key representing a property- Returns:
- The value associated with the provided property key and this holder
-
hasProperty
Method used to check if a property holder has a value set for a specific property key- Parameters:
key
- Unique key representing a property- Returns:
- Whether this holder has a value set for the provided key
-
setProperty
Method used to set a value for the provided key on this property holder- Type Parameters:
T
- The type of the property value- Parameters:
key
- Unique key representing a propertyvalue
- The value to assign to the property key on this holder
-
setItemProperty
Weird fix which is sadly required in order to not decrease performance when using item properties, read https://github.com/Pyrbu/ZNPCsPlus/pull/129#issuecomment-1948777764- Parameters:
key
- Unique key representing a propertyvalue
- The value to assign to the property key on this holder
-
getItemProperty
Weird fix which is sadly required in order to not decrease performance when using item properties, read https://github.com/Pyrbu/ZNPCsPlus/pull/129#issuecomment-1948777764- Parameters:
key
- Unique key representing a property- Returns:
- the
ItemStack
associated with the provided property key and this holder
-
getAppliedProperties
Set<EntityProperty<?>> getAppliedProperties()Method used to get a set of all of the property keys that this holder has a value for- Returns:
- Set of property keys
-