use of net.minecraft.client.renderer.block.model.multipart.Selector in project ForestryMC by ForestryMC.
the class MultipartModel method bake.
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
MultipartBakedModel.Builder builder = new MultipartBakedModel.Builder();
for (Selector selector : multipart.getSelectors()) {
IModel model = partModels.get(selector);
IBakedModel bakedModel = model.bake(model.getDefaultState(), format, bakedTextureGetter);
builder.putModel(selector.getPredicate(multipart.getStateContainer()), bakedModel);
}
return builder.makeMultipartModel();
}
use of net.minecraft.client.renderer.block.model.multipart.Selector in project ForestryMC by ForestryMC.
the class MultipartModel method retexture.
@Override
public IModel retexture(ImmutableMap<String, String> textures) {
try {
ImmutableMap.Builder<Selector, IModel> builder = ImmutableMap.builder();
for (Selector selector : multipart.getSelectors()) {
IModel model = new SimpleModel(location, selector.getVariantList());
model = model.retexture(textures);
builder.put(selector, model);
}
return new MultipartModel(location, multipart, builder.build());
} catch (Exception e) {
return this;
}
}
Aggregations