Refactoring to asynchronous. (partially completed)

This commit is contained in:
BruceChen 2022-12-20 22:41:14 +08:00
parent 7ee08092d4
commit 096ea0c70c
72 changed files with 6033 additions and 5080 deletions

View file

@ -57,7 +57,7 @@ namespace MinecraftClient.Commands
private static int DoLeaveBed(CmdResult r)
{
McClient handler = CmdResult.currentHandler!;
return r.SetAndReturn(Translations.cmd_bed_leaving, handler.SendEntityAction(Protocol.EntityActionType.LeaveBed));
return r.SetAndReturn(Translations.cmd_bed_leaving, handler.SendEntityAction(Protocol.EntityActionType.LeaveBed).Result);
}
private static int DoSleepBedWithRadius(CmdResult r, double radius)
@ -137,7 +137,7 @@ namespace MinecraftClient.Commands
handler.Log.Info(string.Format(Translations.cmd_bed_moving, bedLocation.X, bedLocation.Y, bedLocation.Z));
bool res = handler.PlaceBlock(bedLocation, Direction.Down);
bool res = handler.PlaceBlock(bedLocation, Direction.Down).Result;
handler.Log.Info(string.Format(
Translations.cmd_bed_trying_to_use,
@ -174,7 +174,7 @@ namespace MinecraftClient.Commands
blockCenter.X,
blockCenter.Y,
blockCenter.Z,
handler.PlaceBlock(block, Direction.Down) ? Translations.cmd_bed_in : Translations.cmd_bed_not_in
handler.PlaceBlock(block, Direction.Down).Result ? Translations.cmd_bed_in : Translations.cmd_bed_not_in
));
}
}