本文整理汇总了Java中com.google.common.collect.HashMultimap.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java HashMultimap.keySet方法的具体用法?Java HashMultimap.keySet怎么用?Java HashMultimap.keySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.HashMultimap
的用法示例。
在下文中一共展示了HashMultimap.keySet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupModelRegistry
import com.google.common.collect.HashMultimap; //导入方法依赖的package包/类
@Override
public IRegistry<ModelResourceLocation, IBakedModel> setupModelRegistry()
{
isLoading = true;
loadBlocks();
loadVariantItemModels();
missingModel = ModelLoaderRegistry.getMissingModel();
stateModels.put(MODEL_MISSING, missingModel);
final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
textures.remove(TextureMap.LOCATION_MISSING_TEXTURE);
textures.addAll(LOCATIONS_BUILTIN_TEXTURES);
textureMap.loadSprites(resourceManager, new ITextureMapPopulator()
{
public void registerSprites(TextureMap map)
{
for(ResourceLocation t : textures)
{
map.registerSprite(t);
}
}
});
IBakedModel missingBaked = missingModel.bake(missingModel.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE);
Map<IModel, IBakedModel> bakedModels = Maps.newHashMap();
HashMultimap<IModel, ModelResourceLocation> models = HashMultimap.create();
Multimaps.invertFrom(Multimaps.forMap(stateModels), models);
if (firstLoad)
{
firstLoad = false;
for (ModelResourceLocation mrl : stateModels.keySet())
{
bakedRegistry.putObject(mrl, missingBaked);
}
return bakedRegistry;
}
ProgressBar bakeBar = ProgressManager.push("ModelLoader: baking", models.keySet().size());
for(IModel model : models.keySet())
{
bakeBar.step("[" + Joiner.on(", ").join(models.get(model)) + "]");
if(model == getMissingModel())
{
bakedModels.put(model, missingBaked);
}
else
{
bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE));
}
}
ProgressManager.pop(bakeBar);
for (Entry<ModelResourceLocation, IModel> e : stateModels.entrySet())
{
bakedRegistry.putObject(e.getKey(), bakedModels.get(e.getValue()));
}
return bakedRegistry;
}