diff --git a/FurnitureDisplayFramework/FurnitureDisplayFramework.csproj b/FurnitureDisplayFramework/FurnitureDisplayFramework.csproj index 43fdb8e5..7e6c022c 100644 --- a/FurnitureDisplayFramework/FurnitureDisplayFramework.csproj +++ b/FurnitureDisplayFramework/FurnitureDisplayFramework.csproj @@ -1,7 +1,7 @@  1.0.0 - net5.0 + net6.0 true AnyCPU;x64 diff --git a/FurnitureDisplayFramework/FurnitureDisplayFrameworkAPI.cs b/FurnitureDisplayFramework/FurnitureDisplayFrameworkAPI.cs index 21d9e279..995958b9 100644 --- a/FurnitureDisplayFramework/FurnitureDisplayFrameworkAPI.cs +++ b/FurnitureDisplayFramework/FurnitureDisplayFrameworkAPI.cs @@ -31,10 +31,7 @@ public List GetSlotObjects(Furniture f) List list = new List(); for(int i = 0; i < data.slots.Length; i++) { - if(f.modData.TryGetValue("aedenthorn.FurnitureDisplayFramework/" + i, out string slotString)) - { - list.Add(ModEntry.GetObjectFromSlot(slotString)); - } + list.Add(ModEntry.GetObjectFromSlot(f.modData.TryGetValue("aedenthorn.FurnitureDisplayFramework/" + i, out string slotString) ? slotString : null)); } return list; } diff --git a/FurnitureDisplayFramework/Methods.cs b/FurnitureDisplayFramework/Methods.cs index afd8c5b0..63e1f842 100644 --- a/FurnitureDisplayFramework/Methods.cs +++ b/FurnitureDisplayFramework/Methods.cs @@ -1,5 +1,7 @@ using Newtonsoft.Json.Serialization; using StardewValley; +using System; +using Object = StardewValley.Object; namespace FurnitureDisplayFramework { @@ -22,17 +24,7 @@ private static void HandleSerializationError(object sender, ErrorEventArgs e) private static Object GetObjectFromID(string id, int amount, int quality) { - if (int.TryParse(id, out int index)) - { - //SMonitor.Log($"Spawning object with index {id}"); - return new Object(index, amount, false, -1, quality); - } - foreach (var kvp in Game1.objectInformation) - { - if (kvp.Value.StartsWith(id + "/")) - return new Object(kvp.Key, amount, false, -1, quality); - } - return null; + return new Object(id, amount, false, -1, quality); /* //SMonitor.Log($"Trying to get object {id}, DGA {apiDGA != null}, JA {apiJA != null}"); diff --git a/FurnitureDisplayFramework/ModEntry.cs b/FurnitureDisplayFramework/ModEntry.cs index 2b350d56..a1c6e34d 100644 --- a/FurnitureDisplayFramework/ModEntry.cs +++ b/FurnitureDisplayFramework/ModEntry.cs @@ -21,7 +21,6 @@ public partial class ModEntry : Mod public static ModConfig Config; public static ModEntry context; - private static IDynamicGameAssetsApi apiDGA; private static IJsonAssetsApi apiJA; public static Dictionary furnitureDisplayDict = new Dictionary(); public static readonly string frameworkPath = "Mods/aedenthorn.FurnitureDisplayFramework/dictionary"; diff --git a/FurnitureDisplayFramework/manifest.json b/FurnitureDisplayFramework/manifest.json index 931616e5..fc85fe87 100644 --- a/FurnitureDisplayFramework/manifest.json +++ b/FurnitureDisplayFramework/manifest.json @@ -1,7 +1,7 @@ { "Name": "Furniture Display Framework", "Author": "aedenthorn", - "Version": "0.4.0", + "Version": "0.5.0", "Description": "FurnitureDisplayFramework.", "UniqueID": "aedenthorn.FurnitureDisplayFramework", "EntryDll": "FurnitureDisplayFramework.dll",