mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Changed the bed command to be able to sleep. Added relative coordinates to /dig command.
This commit is contained in:
parent
6a266c68c3
commit
cd3adfa14c
5 changed files with 94 additions and 13 deletions
|
|
@ -24,9 +24,11 @@ namespace MinecraftClient.Commands
|
|||
{
|
||||
try
|
||||
{
|
||||
int x = int.Parse(args[0]);
|
||||
int y = int.Parse(args[1]);
|
||||
int z = int.Parse(args[2]);
|
||||
Location current = handler.GetCurrentLocation();
|
||||
double x = args[0].StartsWith('~') ? current.X + (args[0].Length > 1 ? double.Parse(args[0][1..]) : 0) : double.Parse(args[0]);
|
||||
double y = args[1].StartsWith('~') ? current.Y + (args[1].Length > 1 ? double.Parse(args[1][1..]) : 0) : double.Parse(args[1]);
|
||||
double z = args[2].StartsWith('~') ? current.Z + (args[2].Length > 1 ? double.Parse(args[2][1..]) : 0) : double.Parse(args[2]);
|
||||
|
||||
Location blockToBreak = new Location(x, y, z);
|
||||
if (blockToBreak.DistanceSquared(handler.GetCurrentLocation().EyesLocation()) > 25)
|
||||
return Translations.Get("cmd.dig.too_far");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue