mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Add a proper callback for clearing the skin cache
This commit is contained in:
parent
be263eec85
commit
f61090d9c9
2 changed files with 3 additions and 3 deletions
|
@ -6,6 +6,7 @@ import com.minelittlepony.client.hdskins.gui.DummyPony;
|
|||
import com.minelittlepony.client.hdskins.gui.GuiSkinsMineLP;
|
||||
import com.minelittlepony.client.hdskins.gui.RenderDummyPony;
|
||||
import com.minelittlepony.common.event.ClientReadyCallback;
|
||||
import com.minelittlepony.hdskins.SkinCacheClearCallback;
|
||||
import net.fabricmc.fabric.api.client.render.EntityRendererRegistry;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
|
@ -31,7 +32,7 @@ class MineLPHDSkins {
|
|||
|
||||
// Clear ponies when skins are cleared
|
||||
PonyManager ponyManager = (PonyManager) MineLittlePony.getInstance().getManager();
|
||||
manager.addClearListener(ponyManager::onSkinCacheCleared);
|
||||
SkinCacheClearCallback.EVENT.register(ponyManager::onSkinCacheCleared);
|
||||
|
||||
// Ponify the skins GUI.
|
||||
manager.getSkinServerList().setSkinsGui(GuiSkinsMineLP::new);
|
||||
|
|
|
@ -265,9 +265,8 @@ public class PonyManager implements IPonyManager, IdentifiableResourceReloadList
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onSkinCacheCleared() {
|
||||
public void onSkinCacheCleared() {
|
||||
MineLittlePony.logger.info("Flushed {} cached ponies.", poniesCache.size());
|
||||
poniesCache.invalidateAll();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue