Search in sources :

Example 1 with BakedSkin

use of riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin in project Armourers-Workshop by RiskyKen.

the class ClientSkinCache method receivedModelFromBakery.

public void receivedModelFromBakery(BakedSkin bakedSkin) {
    SkinIdentifier identifierRequested = bakedSkin.getSkinIdentifierRequested();
    synchronized (requestedSkinIDs) {
        synchronized (skinIDMap) {
            if (skinIDMap.containsKey(identifierRequested)) {
                // We already have this skin, remove the old one before adding the new one.
                Skin oldSkin = skinIDMap.get(identifierRequested);
                skinIDMap.remove(identifierRequested);
                oldSkin.cleanUpDisplayLists();
                ModLogger.log("removing skin");
            }
            if (requestedSkinIDs.contains(identifierRequested)) {
                skinIDMap.put(identifierRequested, bakedSkin.getSkin());
                requestedSkinIDs.remove(identifierRequested);
            } else {
                // We did not request this skin.
                skinIDMap.put(bakedSkin.getSkinIdentifierUpdated(), bakedSkin.getSkin());
                ModLogger.log(Level.WARN, "Got an unknown skin - Identifier: " + bakedSkin.getSkinIdentifierUpdated().toString());
            }
        }
    }
}
Also used : Skin(riskyken.armourersWorkshop.common.skin.data.Skin) BakedSkin(riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin) ISkinIdentifier(riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier) SkinIdentifier(riskyken.armourersWorkshop.common.skin.data.SkinIdentifier)

Aggregations

ISkinIdentifier (riskyken.armourersWorkshop.api.common.skin.data.ISkinIdentifier)1 BakedSkin (riskyken.armourersWorkshop.client.model.bake.ModelBakery.BakedSkin)1 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)1 SkinIdentifier (riskyken.armourersWorkshop.common.skin.data.SkinIdentifier)1