use of forestry.core.models.SimpleRetexturedModel in project ForestryMC by ForestryMC.
the class ProxyArboricultureClient method retextureItemModel.
private void retextureItemModel(IRegistry<ModelResourceLocation, IBakedModel> registry, ImmutableMap<String, String> textures, IWoodType woodType, WoodBlockKind woodKind, ItemStack itemStack, IWoodItemMeshDefinition woodDefinition) {
if (woodKind != WoodBlockKind.DOOR) {
ResourceLocation defaultModelLocation = woodDefinition.getDefaultModelLocation(itemStack);
IModel basicItemModel = ModelLoaderRegistry.getModelOrMissing(defaultModelLocation);
ModelResourceLocation basicItemLocation = woodDefinition.getModelLocation(itemStack);
IModel retextureModel = woodKind.retextureModel(basicItemModel, woodType, textures);
registry.putObject(basicItemLocation, new SimpleRetexturedModel(retextureModel));
}
}
use of forestry.core.models.SimpleRetexturedModel 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