mouahrara / aedenthorn

This fork is based on commit 134e32e from January 8, 2024 of the StardewValleyMods repository originally created by @aedenthorn (aka Erinthe). The purpose of this fork is to maintain unofficial versions of the mods and keep them up to date.
GNU General Public License v3.0
13 stars 5 forks source link

[Advanced Flute Blocks] Issues with using the API #4

Open CyanFireUK opened 1 week ago

CyanFireUK commented 1 week ago

Hey i'm trying to update aedenthorn's Object Import Map mod to go along with my update of the Train Tracks mod since it's an optional dependency. It nearly fully works but i have ran into an issue. Object Import map also uses the API for Advanced Flute Blocks but when i try to use it i am getting this error in-game:

[21:23:41 ERROR game] An error occurred in the base update loop: InvalidProgramException: The JIT compiler encountered invalid IL code or an internal limitation. at From<<aedenthorn.ImportMap>_<IAdvancedFluteBlocksApi>>_To<<aedenthorn.AdvancedFluteBlocks>_<AdvancedFluteBlocksApi>>_1.GetFluteBlockToneFromIndex(Int32 ) at ImportMap.ModEntry.DoImport() in C:\Users\killa\source\repos\aedenthorn\StardewValleyMods\ImportMap\ModEntry.cs:line 177 at ImportMap.ModEntry.ChatBox_runCommand_Prefix(String command) in C:\Users\killa\source\repos\aedenthorn\StardewValleyMods\ImportMap\ModEntry.cs:line 77 at StardewValley.Menus.ChatBox.runCommand_PatchedBy<aedenthorn.ImportMap>(ChatBox this, String command) at StardewValley.Menus.ChatBox.textBoxEnter(String text_to_send) at StardewValley.Menus.ChatBox.textBoxEnter(TextBox sender) at StardewValley.Menus.TextBox.RecieveCommandInput(Char command) at StardewValley.KeyboardDispatcher.Poll() at StardewValley.Game1._update(GameTime gameTime) at StardewValley.Game1.Update(GameTime gameTime) at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate)

I don't think GetFluteBlockToneFromIndex is working correctly with your current unofficial version

CyanFireUK commented 1 week ago

It's because the string in AdvancedFluteBlocksApi is marked as static, removing that fixes the issue. If your able to do that, it would be amazing

mouahrara commented 4 days ago

Thanks for reporting the issue! I’ve removed the static modifier from the method and updated my unofficial version of the mod. Note that I’ve also restored the order of the elements in the default configuration’s ToneList to avoid breaking the indexing of existing maps during import.

See: IAdvancedFluteBlocksApi and Release notes

CyanFireUK commented 4 days ago

Amazing thanks, i’ve already updated Object Import Map to be able to make use of the new tones you’ve added aswell. I can ready it for release