Java 类net.minecraft.client.renderer.texture.ITextureMapPopulator 实例源码

项目:Backmemed    文件:ModelBakery.java   
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap textureMapIn)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
项目:CustomWorldGen    文件:ModelBakery.java   
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap textureMapIn)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
项目:ExpandedRailsMod    文件:ModelBakery.java   
private void loadSprites()
{
    final Set<ResourceLocation> set = this.getVariantsTextureLocations();
    set.addAll(this.getItemsTextureLocations());
    set.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    ITextureMapPopulator itexturemappopulator = new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap textureMapIn)
        {
            for (ResourceLocation resourcelocation : set)
            {
                TextureAtlasSprite textureatlassprite = textureMapIn.registerSprite(resourcelocation);
                ModelBakery.this.sprites.put(resourcelocation, textureatlassprite);
            }
        }
    };
    this.textureMap.loadSprites(this.resourceManager, itexturemappopulator);
    this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite());
}
项目:CustomWorldGen    文件:ModelLoader.java   
@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;
}