Class WoolColor

java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.WoolColor
All Implemented Interfaces:
Runnable, Listener

public class WoolColor extends Trait
Persists Sheep wool color metadata.
See Also:
  • Constructor Details

    • WoolColor

      public WoolColor()
  • Method Details

    • getColor

      public DyeColor getColor()
    • load

      public void load(DataKey key) throws NPCLoadException
      Description copied from class: Trait
      Loads a trait.
      Overrides:
      load in class Trait
      Parameters:
      key - DataKey to load from
      Throws:
      NPCLoadException - Thrown if this trait failed to load properly
    • onSpawn

      public void onSpawn()
      Description copied from class: Trait
      Called when an NPC is spawned. NPC.getEntity() will return null until this is called. This is also called onAttach when the NPC is already spawned.
      Overrides:
      onSpawn in class Trait
    • save

      public void save(DataKey key)
      Description copied from class: Trait
      Saves a trait.
      Overrides:
      save in class Trait
      Parameters:
      key - DataKey to save to
    • setColor

      public void setColor(DyeColor color)
    • toString

      public String toString()
      Overrides:
      toString in class Object