use of net.minecraft.client.renderer.block.model.BlockPartFace in project Binnie by ForestryMC.
the class AABBModelBaker method bakeModel.
@Override
public IModelBakerModel bakeModel(boolean flip) {
ModelRotation mr = ModelRotation.X0_Y0;
if (flip) {
mr = ModelRotation.X0_Y180;
}
// Add baked models to the current model.
for (Pair<IBlockState, IBakedModel> bakedModel : bakedModels) {
currentModel.addModelQuads(bakedModel);
}
for (Pair<IBlockState, IBakedModel> bakedModel : bakedModelsPost) {
currentModel.addModelQuadsPost(bakedModel);
}
for (BoundModelBakerFace face : faces) {
final AxisAlignedBB modelBounds = face.modelBounds;
final Vector3f from = new Vector3f((float) modelBounds.minX * 16.0f, (float) modelBounds.minY * 16.0f, (float) modelBounds.minZ * 16.0f);
final Vector3f to = new Vector3f((float) modelBounds.maxX * 16.0f, (float) modelBounds.maxY * 16.0f, (float) modelBounds.maxZ * 16.0f);
final EnumFacing myFace = face.face;
final float[] uvs = getFaceUvs(myFace, to, from);
final BlockFaceUV uv = new BlockFaceUV(uvs, 0);
final BlockPartFace bpf = new BlockPartFace(myFace, face.colorIndex, "", uv);
BakedQuad bf = faceBakery.makeBakedQuad(from, to, bpf, face.spite, myFace, mr, null, true, true);
currentModel.addQuad(myFace, bf);
}
return currentModel;
}
use of net.minecraft.client.renderer.block.model.BlockPartFace in project ForestryMC by ForestryMC.
the class ModelBaker method bakeModel.
@Override
public IModelBakerModel bakeModel(boolean flip) {
ModelRotation modelRotation = ModelRotation.X0_Y0;
if (flip) {
modelRotation = ModelRotation.X0_Y180;
}
// Add baked models to the current model.
for (Pair<IBlockState, IBakedModel> bakedModel : bakedModels) {
currentModel.addModelQuads(bakedModel);
}
for (Pair<IBlockState, IBakedModel> bakedModel : bakedModelsPost) {
currentModel.addModelQuadsPost(bakedModel);
}
for (ModelBakerFace face : faces) {
EnumFacing facing = face.face;
BlockFaceUV uvFace = new BlockFaceUV(UVS, 0);
BlockPartFace partFace = new BlockPartFace(facing, face.colorIndex, "", uvFace);
BakedQuad quad = FACE_BAKERY.makeBakedQuad(POS_FROM, POS_TO, partFace, face.spite, facing, modelRotation, null, true, true);
currentModel.addQuad(facing, quad);
}
return currentModel;
}
Aggregations