use of net.minecraft.client.renderer.block.model.multipart.Multipart in project ForestryMC by ForestryMC.
the class ProxyArboricultureClient method retexturBlockModel.
private void retexturBlockModel(IRegistry<ModelResourceLocation, IBakedModel> registry, ImmutableMap<String, String> textures, IWoodType woodType, WoodBlockKind woodKind, IBlockState blockState, IWoodStateMapper woodMapper) {
ModelResourceLocation defaultModelResourceLocation = woodMapper.getDefaultModelResourceLocation(blockState);
IModel basicModel = ModelLoaderRegistry.getModelOrMissing(defaultModelResourceLocation);
if (basicModel instanceof MultipartModel) {
MultipartModel multipartModel = (MultipartModel) basicModel;
Multipart multipart = multipartModel.getMultipart();
multipart.setStateContainer(blockState.getBlock().getBlockState());
}
ModelResourceLocation basicLocation = woodMapper.getModelLocation(blockState);
IModel retextureModel = woodKind.retextureModel(basicModel, woodType, textures);
registry.putObject(basicLocation, new SimpleRetexturedModel(retextureModel));
}
Aggregations