Implement pull request #982

LookAtLocation and AutoLook
This commit is contained in:
ORelio 2020-05-01 14:02:23 +02:00
parent c2dc483d36
commit 9dae40153c
3 changed files with 82 additions and 0 deletions

View file

@ -168,8 +168,17 @@ namespace MinecraftClient
/// <param name="entity">Entity wich has just disappeared</param>
public virtual void OnEntityDespawn(Mapping.Entity entity) { }
/// <summary>
/// Called when the player held item has changed
/// </summary>
/// <param name="slot">New slot ID</param>
public virtual void OnHeldItemChange(byte slot) { }
/// <summary>
/// Called when the player health has been updated
/// </summary>
/// <param name="health">New player health</param>
/// <param name="food">New food level</param>
public virtual void OnHealthUpdate(float health, int food) { }
/* =================================================================== */
@ -685,6 +694,15 @@ namespace MinecraftClient
return Handler.MoveTo(location, allowUnsafe);
}
/// <summary>
/// Look at the specified location
/// </summary>
/// <param name="location">Location to look at</param>
protected void LookAtLocation(Mapping.Location location)
{
Handler.UpdateLocation(Handler.GetCurrentLocation(), location);
}
/// <summary>
/// Get a Y-M-D h:m:s timestamp representing the current system date and time
/// </summary>