AntiCheat fix prevent Block Breaking

This commit is contained in:
Roman Danilov 2024-03-05 18:54:29 +05:00
parent 9a147b57e5
commit fde50c1728
6 changed files with 15 additions and 14 deletions

View file

@ -58,7 +58,7 @@ namespace MinecraftClient.Commands
Block block = handler.GetWorld().GetBlock(blockToBreak);
if (block.Type == Material.Air)
return r.SetAndReturn(Status.Fail, Translations.cmd_dig_no_block);
else if (handler.DigBlock(blockToBreak, duration: duration))
else if (handler.DigBlock(blockToBreak, Direction.Down, duration: duration))
{
blockToBreak = blockToBreak.ToCenter();
return r.SetAndReturn(Status.Done, string.Format(Translations.cmd_dig_dig, blockToBreak.X, blockToBreak.Y, blockToBreak.Z, block.GetTypeString()));
@ -78,7 +78,7 @@ namespace MinecraftClient.Commands
return r.SetAndReturn(Status.Fail, Translations.cmd_dig_too_far);
else if (block.Type == Material.Air)
return r.SetAndReturn(Status.Fail, Translations.cmd_dig_no_block);
else if (handler.DigBlock(blockLoc, lookAtBlock: false, duration: duration))
else if (handler.DigBlock(blockLoc, Direction.Down, lookAtBlock: false, duration: duration))
return r.SetAndReturn(Status.Done, string.Format(Translations.cmd_dig_dig, blockLoc.X, blockLoc.Y, blockLoc.Z, block.GetTypeString()));
else
return r.SetAndReturn(Status.Fail, Translations.cmd_dig_fail);