Calulate dig range using eyes location (#1228)

This commit is contained in:
ORelio 2020-08-24 00:06:52 +02:00
parent ee164dfcc2
commit 70c991cd30
3 changed files with 11 additions and 2 deletions

View file

@ -27,7 +27,7 @@ namespace MinecraftClient.Commands
int y = int.Parse(args[1]);
int z = int.Parse(args[2]);
Location blockToBreak = new Location(x, y, z);
if (blockToBreak.DistanceSquared(handler.GetCurrentLocation()) > 25)
if (blockToBreak.DistanceSquared(handler.GetCurrentLocation().EyesLocation()) > 25)
return "You are too far away from this block.";
if (handler.GetWorld().GetBlock(blockToBreak).Type == Material.Air)
return "No block at this location (Air)";