For anyone having trouble with getting this mod to work in multiplayer, attached is a version of the mod that has a minor patch so that it will work. The problem was that it was trying to load textures on the dedicated server and that that apparently does not work. I have fixed this by applying some common C# design patterns, most notably the code now only tries to load the texture the very first time they are requested (subsequent access just takes the copy in memory, as before). If you don't trust my changes, you can simply access the code by opening the .tapi file in something like .7z and looking at the source files.
I have not tested this extensively, but I can confirm everything now loads and the sorting looks like it works.
I have based this patch on 1.1.2b+tr14a - if you need a different version (eg 1.1.2) patched to work, you can diff this code and the original 1.1.2b to see the changes. As far as I can tell they would be the same.
Edit:
Multiplayer has a few bugs:
- A chest that you sort automatically does not remain sorted (it is unsorted again upon re-opening it).
- If you automatically sort a chest, pick up a stack of items and put it back immediately (eg a stack of mushrooms) and this stack was split before automatically sorting, you will duplicate some of them. Upon closing and opening the chest the full stack will be where it was before, as well as all the other little stacks.
Edit 3 (Edit 2 is irrelevant now):
I seem to have solved the issue of sorted chests not staying sorted on the server. I have updated the attached file and incremented the version number a bit (1.1.2 -> 1.1.3) to indicate that this is a different version from the one on the thread cover. While this seems to fix that specific issue, I do have some minor concerns about optimisation (it updates the whole chest every time you sort).
I'm trying to avoid changing too much here as I'd like to also work on my own mods and also because I'd probably be tempted to refactor all the code in there. That might be annoying for the original author if he decides to incorporate these changes into the mod.
Edit 4:
I figured out a way to do it using a delegate (it's been a while since I C#-ed), and it now sends only updates for changed chests. Performance should be better and it should work on every action. I think there might still be some multiple syncing going on (there's various calls to sendmessage elsewhere as well and I'm almost certain they are not necessary now), but at least it's sure about the syncs. I've attached the working version here - comments welcome.
Edit 5:
I broke it on singleplayer in 1.1.4, so I made a tiny fix and added it as 1.1.5.