Fix crash when instantiating playerposition

This commit is contained in:
zontreck 2025-01-18 14:17:31 -07:00
parent d5dc0d5892
commit d35d888386
2 changed files with 4 additions and 6 deletions

View file

@ -1,15 +1,13 @@
using System;
using System.Collections.Generic;
using System.Runtime.ConstrainedExecution;
using Vintagestory.API.Common;
using Vintagestory.API.Common.Entities;
using Vintagestory.API.MathTools;
using Vintagestory.GameContent;
namespace AriasServerUtils
{
[Serializable]
public class PlayerPosition : ICloneable
public class PlayerPosition
{
public int X { get; set; } = 0;
public int Y { get; set; } = 0;
@ -19,7 +17,7 @@ namespace AriasServerUtils
public float Yaw { get; set; } = 0.0f;
public float Pitch { get; set; } = 0.0f;
public readonly PlayerPosition ZERO = new(0, 0, 0, 0, 0.0f, 0.0f);
public static readonly PlayerPosition ZERO = new(0, 0, 0, 0, 0.0f, 0.0f);
public PlayerPosition() { }
internal PlayerPosition(int x, int y, int z, int dim, float yaw, float pitch)
@ -62,7 +60,7 @@ namespace AriasServerUtils
return pos;
}
public object Clone()
public PlayerPosition Clone()
{
return new PlayerPosition(this.X, this.Y, this.Z, this.Dimension, this.Yaw, this.Pitch);
}