-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Speech.java
45 lines (38 loc) · 1.18 KB
/
Speech.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package net.citizensnpcs.api.trait.trait;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.ai.speech.VocalChord;
import net.citizensnpcs.api.persistence.Persist;
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.TraitName;
/**
* Represents the default speech settings of an NPC.
*/
@TraitName("speech")
public class Speech extends Trait {
@Persist("")
private String defaultVocalChord = DEFAULT_VOCAL_CHORD;
public Speech() {
super("speech");
}
/**
* Gets the name of the default {@link VocalChord} for this NPC.
*
* @return The name of the VocalChord
*/
public String getDefaultVocalChord() {
return defaultVocalChord;
}
/**
* Sets the name of the default {@link VocalChord} for this NPC.
*
* @return The name of the VocalChord
*/
public void setDefaultVocalChord(Class<VocalChord> clazz) {
defaultVocalChord = CitizensAPI.getSpeechFactory().getVocalChordName(clazz);
}
@Override
public String toString() {
return "DefaultVocalChord{" + defaultVocalChord + "}";
}
public static final String DEFAULT_VOCAL_CHORD = "chat";
}