Interface PropertyHolder

All Known Subinterfaces:
Npc

public interface PropertyHolder
Represents classes that have property values attatched to them
  • Method Summary

    Modifier and Type
    Method
    Description
    Method used to get a set of all of the property keys that this holder has a value for
    org.bukkit.inventory.ItemStack
    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
    Method used to get the value of a property from a property holder
    boolean
    Method used to check if a property holder has a value set for a specific property key
    void
    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

      <T> T getProperty(EntityProperty<T> key)
      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

      boolean hasProperty(EntityProperty<?> key)
      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

      <T> void setProperty(EntityProperty<T> key, T value)
      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 property
      value - The value to assign to the property key on this holder
    • setItemProperty

      void 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
      Parameters:
      key - Unique key representing a property
      value - The value to assign to the property key on this holder
    • getItemProperty

      org.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
      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