This commit is contained in:
BruceChen 2022-10-09 07:57:28 +08:00
parent 2f5914dd6f
commit f567cadc47
3 changed files with 5 additions and 2 deletions

View file

@ -33,7 +33,7 @@ namespace MinecraftClient.Commands
try
{
Location current = handler.GetCurrentLocation();
Location blockToBreak = Location.Parse(current, args[0], args[1], args[2]);
Location blockToBreak = Location.Parse(current.ToFloor(), args[0], args[1], args[2]);
if (blockToBreak.DistanceSquared(current.EyesLocation()) > 25)
return Translations.Get("cmd.dig.too_far");
Block block = handler.GetWorld().GetBlock(blockToBreak);

View file

@ -18,7 +18,7 @@ namespace MinecraftClient.Commands
string[] args = GetArgs(command);
if (args.Length >= 3)
{
Location block = Location.Parse(handler.GetCurrentLocation(), args[0], args[1], args[2]).ToFloor();
Location block = Location.Parse(handler.GetCurrentLocation().ToFloor(), args[0], args[1], args[2]).ToFloor();
Location blockCenter = block.ToCenter();
bool res = handler.PlaceBlock(block, Direction.Down);
return Translations.Get("cmd.useblock.use", blockCenter.X, blockCenter.Y, blockCenter.Z, res ? "succeeded" : "failed");