Search in sources :

Example 6 with ISkinIdentifier

use of riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier in project Armourers-Workshop by RiskyKen.

the class ClientSkinCache method getModelCount.

public int getModelCount() {
    int count = 0;
    synchronized (skinIDMap) {
        Object[] keySet = skinIDMap.getKeySet().toArray();
        for (int i = 0; i < keySet.length; i++) {
            ISkinIdentifier key = (ISkinIdentifier) keySet[i];
            Skin skin = skinIDMap.getQuiet(key);
            if (skin != null) {
                count += skin.getModelCount();
            }
        }
    }
    return count;
}
Also used : ISkinIdentifier(riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier) Skin(riskyken.armourersWorkshop.common.skin.data.Skin) BakedSkin(riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin)

Example 7 with ISkinIdentifier

use of riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier in project Armourers-Workshop by RiskyKen.

the class ClientSkinCache method clearCache.

public void clearCache() {
    synchronized (skinIDMap) {
        Object[] keySet = skinIDMap.getKeySet().toArray();
        for (int i = 0; i < keySet.length; i++) {
            ISkinIdentifier key = (ISkinIdentifier) keySet[i];
            Skin customArmourItemData = skinIDMap.get(key);
            skinIDMap.remove(key);
            customArmourItemData.cleanUpDisplayLists();
        }
    }
    synchronized (requestedSkinIDs) {
        requestedSkinIDs.clear();
    }
}
Also used : ISkinIdentifier(riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier) Skin(riskyken.armourersWorkshop.common.skin.data.Skin) BakedSkin(riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin)

Aggregations

ISkinIdentifier (riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier)7 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)5 BakedSkin (riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin)3 SkinIdentifier (riskyken.armourersWorkshop.common.skin.data.SkinIdentifier)3 ILibraryFile (riskyken.armourersWorkshop.api.common.library.ILibraryFile)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)1