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) if (sneaking)
{ {
var result = handler.sendEntityAction(Protocol.EntityActionType.StopSneaking); var result = handler.sendEntityAction(Protocol.EntityActionType.StopSneaking);
sneaking = false; if (result)
sneaking = false;
return result ? "You aren't sneaking anymore" : "Fail"; return result ? "You aren't sneaking anymore" : "Fail";
} }
else else
{ {
var result = handler.sendEntityAction(Protocol.EntityActionType.StartSneaking); var result = handler.sendEntityAction(Protocol.EntityActionType.StartSneaking);
sneaking = true; if (result)
sneaking = true;
return result ? "You are sneaking now" : "Fail"; return result ? "You are sneaking now" : "Fail";
} }