@Override
public IBakedModel bake(IModelState state, VertexFormat format,
Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
IBakedModel[] connections = new IBakedModel[6];
IBakedModel[] endings = new IBakedModel[6];
IBakedModel[] nodeSides = new IBakedModel[6];
//IBakedModel node = null;
// d u n s w e
ModelRotation[] rotations = new ModelRotation[] { ModelRotation.X90_Y0, ModelRotation.X270_Y0,
ModelRotation.X0_Y0, ModelRotation.X0_Y180, ModelRotation.X0_Y270, ModelRotation.X0_Y90 };
try {
IModel nodeSideModel = ModelLoaderRegistry.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_node_side"));
IModel connectionModel = ModelLoaderRegistry
.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_connection"));
IModel endingModel = ModelLoaderRegistry.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_end"));
//node = nodeModel.bake(new TRSRTransformation(ModelRotation.X0_Y0), DefaultVertexFormats.BLOCK,
// ModelLoader.defaultTextureGetter());
for (int i = 0; i < connections.length; i++) {
connections[i] = connectionModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
endings[i] = endingModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
nodeSides[i] = nodeSideModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
}
} catch (Exception e) {
Etheric.logger.warn(e.getMessage());
}
if (connections[0] == null) {
return ModelLoaderRegistry.getMissingModel().bake(state, format, bakedTextureGetter);
}
return new BakedPipeModel(nodeSides, connections, endings);
}
PipeModel.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:Etheric
作者:
评论列表
文章目录