Class CitizensSpeechFactory

java.lang.Object
net.citizensnpcs.npc.ai.speech.CitizensSpeechFactory
All Implemented Interfaces:
SpeechFactory

public class CitizensSpeechFactory extends Object implements SpeechFactory
  • Constructor Details

    • CitizensSpeechFactory

      public CitizensSpeechFactory()
  • Method Details

    • getVocalChord

      public VocalChord getVocalChord(Class<? extends VocalChord> clazz)
      Description copied from interface: SpeechFactory
      Creates a new instance of a VocalChord
      Specified by:
      getVocalChord in interface SpeechFactory
      Parameters:
      clazz - The class of the desired VocalChord
      Returns:
      a new instance of this VocalChord
    • getVocalChord

      public VocalChord getVocalChord(String name)
      Description copied from interface: SpeechFactory
      Creates a new instance of a VocalChord
      Specified by:
      getVocalChord in interface SpeechFactory
      Parameters:
      name - The name of the desired VocalChord
      Returns:
      a new instance of this VocalChord, ornull if a VocalChord is not registered with this name
    • getVocalChordName

      public String getVocalChordName(Class<? extends VocalChord> clazz)
      Description copied from interface: SpeechFactory
      Returns the registered name of a VocalChord class
      Specified by:
      getVocalChordName in interface SpeechFactory
      Parameters:
      clazz - The VocalChord class
      Returns:
      the registered name, null if not registered
    • isRegistered

      public boolean isRegistered(String name)
      Description copied from interface: SpeechFactory
      Checks whether the supplied VocalChord name is registered.
      Specified by:
      isRegistered in interface SpeechFactory
      Parameters:
      name - The name of the VocalChord to check
      Returns:
      true if the VocalChord name is registered
    • newTalkableEntity

      public Talkable newTalkableEntity(Entity entity)
      Description copied from interface: SpeechFactory
      Creates a new Talkable entity and returns it
      Specified by:
      newTalkableEntity in interface SpeechFactory
      Parameters:
      entity - the entity to use
      Returns:
      a Talkable entity
    • newTalkableEntity

      public Talkable newTalkableEntity(LivingEntity entity)
      Description copied from interface: SpeechFactory
      Creates a new Talkable entity and returns it
      Specified by:
      newTalkableEntity in interface SpeechFactory
      Parameters:
      entity - the livingEntity to use
      Returns:
      a Talkable entity
    • register

      public void register(Class<? extends VocalChord> clazz, String name)
      Description copied from interface: SpeechFactory
      Registers a VocalChord class with the SpeechController, making it available for use within. Requires a 'name', which should generally describe the intent of the VocalChord.
      Specified by:
      register in interface SpeechFactory
      Parameters:
      clazz - The VocalChord class
      name - The name of the VocalChord