mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Merge AutoRelog's configs
This commit is contained in:
parent
e0678ea7a5
commit
a118dc96e9
4 changed files with 18 additions and 40 deletions
|
|
@ -31,6 +31,11 @@ namespace MinecraftClient.ChatBots
|
|||
{
|
||||
foreach (TaskConfig task in TaskList)
|
||||
{
|
||||
task.Trigger_On_Interval.MinTime = Math.Max(1, task.Trigger_On_Interval.MinTime);
|
||||
task.Trigger_On_Interval.MaxTime = Math.Max(1, task.Trigger_On_Interval.MaxTime);
|
||||
if (task.Trigger_On_Interval.MinTime > task.Trigger_On_Interval.MaxTime)
|
||||
(task.Trigger_On_Interval.MinTime, task.Trigger_On_Interval.MaxTime) = (task.Trigger_On_Interval.MaxTime, task.Trigger_On_Interval.MinTime);
|
||||
|
||||
//Look for a valid action
|
||||
if (!String.IsNullOrWhiteSpace(task.Action))
|
||||
{
|
||||
|
|
@ -106,21 +111,17 @@ namespace MinecraftClient.ChatBots
|
|||
public TriggerOnIntervalConfig(int value)
|
||||
{
|
||||
this.Enable = true;
|
||||
value = Math.Max(value, 10);
|
||||
MinTime = MaxTime = value;
|
||||
}
|
||||
|
||||
public TriggerOnIntervalConfig(bool Enable, int value)
|
||||
{
|
||||
this.Enable = Enable;
|
||||
value = Math.Max(value, 10);
|
||||
MinTime = MaxTime = value;
|
||||
}
|
||||
|
||||
public TriggerOnIntervalConfig(int min, int max)
|
||||
{
|
||||
min = Math.Max(min, 10);
|
||||
max = Math.Max(max, 10);
|
||||
this.MinTime = min;
|
||||
this.MaxTime = max;
|
||||
}
|
||||
|
|
@ -128,8 +129,6 @@ namespace MinecraftClient.ChatBots
|
|||
public TriggerOnIntervalConfig(bool Enable, int min, int max)
|
||||
{
|
||||
this.Enable = Enable;
|
||||
min = Math.Max(min, 10);
|
||||
max = Math.Max(max, 10);
|
||||
this.MinTime = min;
|
||||
this.MaxTime = max;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue