Fix EntityAction packet ID and tiny improve of sneak command

This commit is contained in:
ReinforceZwei 2020-05-23 21:16:28 +08:00 committed by ORelio
parent cdb217840d
commit d6a3ea0726
2 changed files with 6 additions and 7 deletions

View file

@ -13,18 +13,17 @@ namespace MinecraftClient.Commands
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
{
Console.WriteLine(command);
if (sneaking)
{
var result = handler.sendEntityAction(Protocol.EntityActionType.StopSneaking);
sneaking = false;
return result ? "Success" : "Fail";
return result ? "You aren't sneaking anymore" : "Fail";
}
else
{
var result = handler.sendEntityAction(Protocol.EntityActionType.StartSneaking);
sneaking = true;
return result ? "Success" : "Fail";
return result ? "You are sneaking now" : "Fail";
}
}