Merge Unseak and sneak into one function

This commit is contained in:
CarbonNeuron 2020-05-03 10:51:50 -05:00
parent c5a19f4b8b
commit add1dd2dcd

View file

@ -672,16 +672,9 @@ namespace MinecraftClient
/// <summary> /// <summary>
/// start Sneaking /// start Sneaking
/// </summary> /// </summary>
protected bool Sneak() protected bool Sneak(bool on)
{ {
return SendAction(Protocol.ActionType.StartSneaking); return SendAction(on ? Protocol.ActionType.StartSneaking : Protocol.ActionType.StopSneaking);
}
/// <summary>
/// Sends UnSneak
/// </summary>
protected bool UnSneak()
{
return SendAction(Protocol.ActionType.StopSneaking);
} }
/// <summary> /// <summary>
/// Send Entity Action /// Send Entity Action