mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add Location.Parse
This commit is contained in:
parent
36d2a2c731
commit
e01eab28a2
2 changed files with 92 additions and 6 deletions
|
|
@ -91,14 +91,11 @@ namespace MinecraftClient.Commands
|
|||
try
|
||||
{
|
||||
Location current = handler.GetCurrentLocation(), currentCenter = current.ToCenter();
|
||||
|
||||
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 goal = new(x, y, z);
|
||||
|
||||
Location goal = Location.Parse(current, args[0], args[1], args[2]);
|
||||
|
||||
if (!Movement.CheckChunkLoading(handler.GetWorld(), current, goal))
|
||||
return Translations.Get("cmd.move.chunk_not_loaded", x, y, z);
|
||||
return Translations.Get("cmd.move.chunk_not_loaded", goal.X, goal.Y, goal.Z);
|
||||
|
||||
if (takeRisk || Movement.PlayerFitsHere(handler.GetWorld(), goal))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue