Support for using relative coordinates in /move

This commit is contained in:
BruceChen 2022-09-05 22:03:47 +08:00
parent 8f6b962607
commit 0eb8d9998c
4 changed files with 58 additions and 27 deletions

View file

@ -47,6 +47,16 @@ namespace MinecraftClient.Mapping
Z = z;
}
/// <summary>
/// Create a new location
/// </summary>
public Location(Location loc)
{
X = loc.X;
Y = loc.Y;
Z = loc.Z;
}
/// <summary>
/// Create a new location
/// </summary>
@ -67,7 +77,7 @@ namespace MinecraftClient.Mapping
/// Round coordinates
/// </summary>
/// <returns>itself</returns>
public Location ToFloor()
public Location ConvertToFloor()
{
this.X = Math.Floor(this.X);
this.Y = Math.Floor(this.Y);
@ -79,7 +89,7 @@ namespace MinecraftClient.Mapping
/// Get the center coordinates
/// </summary>
/// <returns>itself</returns>
public Location ToCenter()
public Location ConvertToCenter()
{
this.X = Math.Floor(this.X) + 0.5;
this.Z = Math.Floor(this.Z) + 0.5;