tiny improve of sneak command

This commit is contained in:
ReinforceZwei 2020-05-23 21:20:33 +08:00 committed by ORelio
parent d6a3ea0726
commit 5da55a2f9a

View file

@ -16,13 +16,15 @@ namespace MinecraftClient.Commands
if (sneaking)
{
var result = handler.sendEntityAction(Protocol.EntityActionType.StopSneaking);
sneaking = false;
if (result)
sneaking = false;
return result ? "You aren't sneaking anymore" : "Fail";
}
else
{
var result = handler.sendEntityAction(Protocol.EntityActionType.StartSneaking);
sneaking = true;
if (result)
sneaking = true;
return result ? "You are sneaking now" : "Fail";
}