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());
}
}
}
}
Aggregations