Player Data gets overwritten on plugin load

I'm making a plugin where i need to save coordinates on a per player basis

 "id": 76561############,
      "currentJump": 0,
      "Jumps": [
        {
          "x": -2100.028,
          "y": 46.1595078,
          "z": -1464.76868
        },
        {
          "x": -2100.028,
          "y": 46.1595078,
          "z": -1464.76868
        }
      ]
    }

this is what the data looks like before i reload the plugin ^^^^

"id": 0,
      "currentJump": 0,
      "Jumps": [
        {
          "x": -2100.028,
          "y": 46.1595078,
          "z": -1464.76868
        },
        {
          "x": -2100.028,
          "y": 46.1595078,
          "z": -1464.76868
        }
      ]
    }

for some reason the id is set to 0 on load of the plugin but the array of Vector3 coordinates is not (neither should be set to 0)

heres the code 

StoredData storedData;
        class StoredData
        {
            public List<jplayer> playerList = new List<jplayer>();
        }

        void Loaded()
        {
            storedData = Interface.Oxide.DataFileSystem.ReadObject<StoredData>("RustJumper");
            Interface.Oxide.DataFileSystem.WriteObject("RustJumper", storedData);
        }

        void SaveData()
        {
            Interface.Oxide.DataFileSystem.WriteObject("RustJumper", storedData);
        }

heres the jplayer class 

class jplayer
        {
            public jplayer(ulong id)
            {
                this.id = id;
                this.currentJump = 0;
                List<Vector3> jumps = new List<Vector3>();
                this.Jumps = jumps;
            }

            public jplayer (ulong id, List<Vector3> jumps)
            {
                this.id= id;
                this.currentJump = 0;
                this.Jumps = jumps;
            }

            public ulong id { get; }
            public int currentJump { get; set; }
            public List<Vector3> Jumps { get; set; }
            public String toString()
            {
                return "id: " + id + "\nCurrent Jump: " + currentJump;
            }
        }

why is the id of all jplayers being set to 0 on the Loaded() hook 

You appear to only be loading the data, not saving it. You'd need to save in a hook such as Unload(). SaveData is only the name of your method, it is not a hook.

Go0ePa8S2poB3OZ.jpg Wulf

You appear to only be loading the data, not saving it. You'd need to save in a hook such as Unload(). SaveData is only the name of your method, it is not a hook.

I have a OnPlayerCommand Hook that saves it 

void OnPlayerCommand(BasePlayer player, string command, string[] args)
        {
            validatePlayer(player);
        }

void validatePlayer(BasePlayer player)
        {
            bool isCreated = false;
            for (int i = 0; i < storedData.playerList.Count; i++)
            {
                if (player.userID == storedData.playerList[i].id)
                    isCreated = true;
            }

            if (!isCreated)
                storedData.playerList.Add(new jplayer(player.userID));
            SaveData();
        }​

I can also see inside the oxide > data > {plugin-name}.json file that there is data like i posted above 

Are you still having the issue? I'd have to test it myself, but not able to at the moment. I would assume there's an issue with it being unable to read the data based on the class, just unsure why.