forked from Upstream/Velocitab
set minimal update rate (#52)
This commit is contained in:
parent
c5b09590c7
commit
3c1a980e25
@ -111,7 +111,8 @@ public class Settings {
|
||||
@Getter
|
||||
@YamlKey("update_rate")
|
||||
@YamlComment("How often in milliseconds to periodically update the TAB list, including header and footer, for all users.\n" +
|
||||
"If set to 0, TAB will be updated on player join/leave instead. (1s = 1000ms)")
|
||||
"If set to 0, TAB will be updated on player join/leave instead. (1s = 1000ms)\n" +
|
||||
"The minimal update rate is 200ms, anything lower will automatically be set to 200ms.")
|
||||
private int updateRate = 0;
|
||||
|
||||
public Settings(@NotNull Velocitab plugin) {
|
||||
|
@ -224,7 +224,7 @@ public class PlayerTabList {
|
||||
player.sendHeaderAndFooter(this);
|
||||
});
|
||||
})
|
||||
.repeat(updateRate, TimeUnit.MILLISECONDS)
|
||||
.repeat(Math.max(200, updateRate), TimeUnit.MILLISECONDS)
|
||||
.schedule();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user