boomboompower / SkinChanger

The SkinChanger mod, a simple forge mod designed to implement in-game dynamic skin and cape switching
https://no.boomy.wtf/?name=SkinChanger
Other
15 stars 3 forks source link

Provide automatic Skin and Cape caching #6

Open boomboompower opened 4 years ago

boomboompower commented 4 years ago

Skins in the cache should not stay forever. SkinChanger V2 introduced a skin cache which never automatically clears, V3 can feature one that does.

The implementation of manual clearing should stay, however automatic cache cleaning is definitely something which would benefit users. Users should be able to choose caching times, or disable the cache clearing method completely.


General implementation


Recommended steps

And also when a resource is queried

boomboompower commented 4 years ago

Implemented in https://github.com/boomboompower/SkinChanger/commit/861c85b4db280808e912b9afa0a284ebb6024326

Needs testing. The mod only checks each cache file if it's needed, some files may remain in the cache for a long time if they are not scanned. I might add something to check the cache on startup?

boomboompower commented 4 years ago

Ok so https://github.com/boomboompower/SkinChanger/commit/82e174cfb68ef34f4d41653229a22fb795f984a0 solves an issue where cached files were being created, however the code didn't actually retrieve them if it could. So https://github.com/boomboompower/SkinChanger/commit/82e174cfb68ef34f4d41653229a22fb795f984a0 is just a fix for that crappy implementation (the current codebase will currently bypass the fix if it uses the old method).

Should make the mod work a bit better offline now.