sisby-folk / switchy

A minecraft mod that allows switching between presets of player data (social profiles, rpg characters, etc) in a completetly modular way.
https://modrinth.com/mod/switchy
GNU Lesser General Public License v3.0
13 stars 8 forks source link

SwitchyFiguraAPI listening functions are permanent #51

Closed Aproxia-dev closed 1 year ago

Aproxia-dev commented 1 year ago

When you load an avatar that uses the SwitchyFiguraAPI, and then reload it or load a different one, the listening functions from the first loaded avatar don't get removed.

This leads to the functions being ran multiple times after a switch, or the functions get ran while the avatar that uses the API isn't loaded anymore.

Octelly commented 1 year ago

Yeah, the previous LUA environment doesn't seem to get "discarded" on Switchy's side when an avatar reload occurs.

Aproxia-dev commented 1 year ago

speaking of the SwitchyFiguraAPI, there's a small mistake in the documentation, where on this line, the oldPreset and newPreset are swapped.

sisby-folk commented 1 year ago

So this is theoretically fixed in 2.6.4 so please give it a try! I have no way of testing myself.