Allow digging up to 5 blocks away (#1228)

Current calculation was limiting to >= 4 blocks away, but vanilla Minecraft can dig up to 5 blocks away.
This commit is contained in:
ORelio 2020-08-23 20:35:54 +02:00 committed by GitHub
parent 017d9b1840
commit 676c6a68a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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