mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add OnTimeUpdate() and OnRespawn() to ChatBot API
This commit is contained in:
parent
2034729f74
commit
ccc364df34
2 changed files with 14 additions and 0 deletions
|
|
@ -153,6 +153,13 @@ namespace MinecraftClient
|
||||||
/// <param name="tps">New estimated server TPS (between 0 and 20)</param>
|
/// <param name="tps">New estimated server TPS (between 0 and 20)</param>
|
||||||
public virtual void OnServerTpsUpdate(Double tps) { }
|
public virtual void OnServerTpsUpdate(Double tps) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when a time changed
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="WorldAge">World age</param>
|
||||||
|
/// <param name="TimeOfDay">Time</param>
|
||||||
|
public virtual void OnTimeUpdate(long WorldAge, long TimeOfDay) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when an entity moved nearby
|
/// Called when an entity moved nearby
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -313,6 +320,11 @@ namespace MinecraftClient
|
||||||
/// <param name="name">Name of the player</param>
|
/// <param name="name">Name of the player</param>
|
||||||
public virtual void OnPlayerLeave(Guid uuid, string name) { }
|
public virtual void OnPlayerLeave(Guid uuid, string name) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the player respawns
|
||||||
|
/// </summary>
|
||||||
|
public virtual void OnRespawn() { }
|
||||||
|
|
||||||
/* =================================================================== */
|
/* =================================================================== */
|
||||||
/* ToolBox - Methods below might be useful while creating your bot. */
|
/* ToolBox - Methods below might be useful while creating your bot. */
|
||||||
/* You should not need to interact with other classes of the program. */
|
/* You should not need to interact with other classes of the program. */
|
||||||
|
|
|
||||||
|
|
@ -1522,6 +1522,7 @@ namespace MinecraftClient
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearInventories();
|
ClearInventories();
|
||||||
|
DispatchBotEvent(bot => bot.OnRespawn());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1978,6 +1979,7 @@ namespace MinecraftClient
|
||||||
lastAge = WorldAge;
|
lastAge = WorldAge;
|
||||||
lastTime = DateTime.Now;
|
lastTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
DispatchBotEvent(bot => bot.OnTimeUpdate(WorldAge, TimeOfDay));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue