mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Trim before parse
This commit is contained in:
parent
0eb8d9998c
commit
e5c3b914dd
2 changed files with 2 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ namespace MinecraftClient
|
|||
/// <returns>Argument array or empty array if no arguments</returns>
|
||||
public static string[] getArgs(string command)
|
||||
{
|
||||
string[] args = getArg(command).Split(' ');
|
||||
string[] args = getArg(command).Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (args.Length == 1 && args[0] == "")
|
||||
{
|
||||
return new string[] { };
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace MinecraftClient.Commands
|
|||
try
|
||||
{
|
||||
Location current = handler.GetCurrentLocation(), currentCenter = new Location(current).ConvertToCenter();
|
||||
|
||||
|
||||
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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue