diff --git a/src/Instrument.cs b/src/Instrument.cs index ac1e31c..3572199 100644 --- a/src/Instrument.cs +++ b/src/Instrument.cs @@ -1,4 +1,4 @@ -using System; // Action<> +using System; // Action<> using System.Collections.Generic; using System.Diagnostics; // debug todo remove using System.IO; // Open files @@ -111,7 +111,8 @@ public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, Bl if (GetPlayMode(slot) != PlayMode.abc) { - Vec3d pos = new Vec3d(byEntity.Pos.X, byEntity.Pos.Y, byEntity.Pos.Z); + var epos = byEntity.GetPos(); + Vec3d pos = new Vec3d(epos.X, epos.Y, epos.Z); NoteStart newNote = new NoteStart(); newNote.pitch = currentNote.pitch; newNote.positon = pos; @@ -148,7 +149,8 @@ public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, Entity // Additionally, update the sound packet if (GetPlayMode(slot) != PlayMode.abc) { - Vec3d pos = new Vec3d(byEntity.Pos.X, byEntity.Pos.Y, byEntity.Pos.Z); + var epos = byEntity.GetPos(); + Vec3d pos = new Vec3d(epos.X, epos.Y, epos.Z); NoteUpdate newNote = new NoteUpdate(); newNote.pitch = currentNote.pitch; newNote.positon = pos; @@ -228,13 +230,13 @@ private void Update(ItemSlot slot, EntityAgent byEntity) switch (GetPlayMode(slot)) { case PlayMode.lockedTone: - AngleToPitchLockedTone(byEntity.Pos.Pitch); + AngleToPitchLockedTone(byEntity.GetPos().Pitch); break; case PlayMode.lockedSemiTone: - AngleToPitchLockedSemiTone(byEntity.Pos.Pitch); + AngleToPitchLockedSemiTone(byEntity.GetPos().Pitch); break; case PlayMode.fluid: - AngleToPitch(byEntity.Pos.Pitch); + AngleToPitch(byEntity.GetPos().Pitch); break; case PlayMode.abc: // No logic for this mode; all handled by the server. diff --git a/vsinstruments_base.csproj b/vsinstruments_base.csproj index 3fd8c14..8b7c343 100644 --- a/vsinstruments_base.csproj +++ b/vsinstruments_base.csproj @@ -1,7 +1,7 @@ - + - net8.0 + net10.0 false bin\$(Configuration)\Mods\mod