mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-24 10:11:24 +01:00
Add a random text delay default setting of 20-40ticks
This commit is contained in:
parent
402095c946
commit
433121979c
@ -110,6 +110,8 @@ public class Settings {
|
||||
value = list;
|
||||
}
|
||||
},
|
||||
DEFAULT_TEXT_DELAY_MAX("npc.text.default-random-text-delay-max", 40),
|
||||
DEFAULT_TEXT_DELAY_MIN("npc.text.default-random-text-delay-min", 20),
|
||||
DEFAULT_TEXT_SPEECH_BUBBLE_TICKS("npc.text.speech-bubble-ticks", 50),
|
||||
DISABLE_LOOKCLOSE_WHILE_NAVIGATING("npc.default.look-close.disable-while-navigating", true),
|
||||
DISABLE_MC_NAVIGATION_FALLBACK("npc.pathfinding.disable-mc-fallback-navigation", true),
|
||||
|
@ -278,6 +278,10 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
|
||||
sendText(player);
|
||||
|
||||
int delay = this.delay == -1
|
||||
? Util.getFastRandom().nextInt(Setting.DEFAULT_TEXT_DELAY_MIN.asInt(),
|
||||
Setting.DEFAULT_TEXT_DELAY_MAX.asInt())
|
||||
: this.delay;
|
||||
if (delay <= 0)
|
||||
return;
|
||||
cooldowns.put(player.getUniqueId(), System.currentTimeMillis() + (delay * 50));
|
||||
|
Loading…
Reference in New Issue
Block a user