Java Code Examples for net.minecraftforge.client.model.PerspectiveMapWrapper#getTransforms()
The following examples show how to use
net.minecraftforge.client.model.PerspectiveMapWrapper#getTransforms() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VariantModel.java From OpenModsLib with MIT License | 6 votes |
@Override public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final Map<ResourceLocation, IBakedModel> bakedSubModels = Maps.newHashMap(); for (ResourceLocation subModel : modelData.getAllModels()) { IModel model = ModelLoaderRegistry.getModelOrLogError(subModel, "Couldn't load sub-model dependency: " + subModel); bakedSubModels.put(subModel, model.bake(new ModelStateComposition(state, model.getDefaultState()), format, bakedTextureGetter)); } final IModel baseModel; if (base.isPresent()) { ResourceLocation baseLocation = base.get(); baseModel = ModelLoaderRegistry.getModelOrLogError(baseLocation, "Couldn't load base-model dependency: " + baseLocation); } else { baseModel = ModelLoaderRegistry.getMissingModel(); } final IBakedModel bakedBaseModel = baseModel.bake(new ModelStateComposition(state, baseModel.getDefaultState()), format, bakedTextureGetter); return new BakedModel(bakedBaseModel, modelData, bakedSubModels, PerspectiveMapWrapper.getTransforms(state)); }
Example 2
Source File: MultiLayerModel.java From OpenModsLib with MIT License | 6 votes |
@Override public IBakedModel bake(final IModelState state, final VertexFormat format, final Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final Map<BlockRenderLayer, IBakedModel> bakedModels = Maps.transformValues(models, location -> bakeModel(location, state, format, bakedTextureGetter)); IModel missing = ModelLoaderRegistry.getMissingModel(); IBakedModel bakedMissing = missing.bake(missing.getDefaultState(), format, bakedTextureGetter); final IBakedModel bakedBase; if (base.isPresent()) { bakedBase = bakeModel(base.get(), state, format, bakedTextureGetter); } else { bakedBase = bakedMissing; } return new MultiLayerBakedModel( bakedModels, bakedBase, bakedMissing, PerspectiveMapWrapper.getTransforms(state)); }
Example 3
Source File: PerspectiveAwareModel.java From OpenModsLib with MIT License | 6 votes |
@Override public IBakedModel bake(final IModelState state, final VertexFormat format, final Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final Map<TransformType, IBakedModel> bakedModels = Maps.transformValues(models, location -> bakeModel(location, state, format, bakedTextureGetter)); IModel missing = ModelLoaderRegistry.getMissingModel(); IBakedModel bakedMissing = missing.bake(missing.getDefaultState(), format, bakedTextureGetter); final IBakedModel bakedBase; if (base.isPresent()) { bakedBase = bakeModel(base.get(), state, format, bakedTextureGetter); } else { bakedBase = bakedMissing; } return new PerspectiveAwareBakedModel( bakedModels, bakedBase, PerspectiveMapWrapper.getTransforms(state)); }
Example 4
Source File: ModelNullifierBaked.java From enderutilities with GNU Lesser General Public License v3.0 | 5 votes |
private ModelNullifierBaked(IModel baseModel, IModel lockedModel, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { this.modelState = state; this.modelBase = baseModel.bake(state, format, bakedTextureGetter); this.modelLocked = lockedModel.bake(state, format, bakedTextureGetter); this.format = format; this.bakedTextureGetter = bakedTextureGetter; this.particle = bakedTextureGetter.apply(new ResourceLocation(ModelNullifier.TEX_BASE)); this.transformMap = PerspectiveMapWrapper.getTransforms(state); }
Example 5
Source File: BakedEvalModel.java From OpenModsLib with MIT License | 5 votes |
public BakedEvalModel(IModel model, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, ITransformEvaluator evaluator) { super(model.bake(state, format, bakedTextureGetter), PerspectiveMapWrapper.getTransforms(state)); this.model = model; this.originalState = state; this.format = format; this.bakedTextureGetter = bakedTextureGetter; this.evaluator = evaluator; }
Example 6
Source File: TexturedItemModel.java From OpenModsLib with MIT License | 5 votes |
@Override public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final IModel untexturedModel = getModel(this.untexturedModel); final IBakedModel untexturedBakedModel = untexturedModel.bake(new ModelStateComposition(state, untexturedModel.getDefaultState()), format, bakedTextureGetter); final IModel texturedModel = getModel(this.texturedModel); final IBakedModel texturedBakedModel = texturedModel.bake(new ModelStateComposition(state, texturedModel.getDefaultState()), format, bakedTextureGetter); final ItemOverrideList overrides = new TexturedItemOverrides(untexturedBakedModel, texturedModel, texturedBakedModel.getOverrides().getOverrides(), textures, state, format, bakedTextureGetter); return new BakedModel(untexturedBakedModel, PerspectiveMapWrapper.getTransforms(state), overrides); }
Example 7
Source File: EvalExpandModel.java From OpenModsLib with MIT License | 4 votes |
public BakedEvalExpandModel(IModel model, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, IBlockState defaultBlockState, IVarExpander expander) { super(model.bake(state, format, bakedTextureGetter), PerspectiveMapWrapper.getTransforms(state)); this.expander = expander; this.defaultBlockState = defaultBlockState; }