use of com.lowdragmc.lowdraglib.client.model.custommodel.CustomBakedModel in project Multiblocked by Low-Drag-MC.
the class GTRenderer method renderModel.
@Override
@OnlyIn(Dist.CLIENT)
public List<BakedQuad> renderModel(IBlockDisplayReader level, BlockPos pos, BlockState state, Direction side, Random rand, IModelData modelData) {
TileEntity te = level.getBlockEntity(pos);
if (formedAsController && te instanceof IPartComponent) {
IPartComponent part = (IPartComponent) te;
for (IControllerComponent controller : part.getControllers()) {
if (controller.isFormed() && controller.getRenderer() instanceof GTRenderer) {
IBakedModel model = getModel(((GTRenderer) controller.getRenderer()).baseTexture).bake(ModelLoader.instance(), ModelLoader.defaultTextureGetter(), ModelFactory.getRotation(part.getFrontFacing()), modelLocation);
if (model == null)
return Collections.emptyList();
model = new CustomBakedModel(model);
if (!((CustomBakedModel) model).shouldRenderInLayer(state, rand))
return Collections.emptyList();
return model.getQuads(state, side, rand, modelData);
}
}
}
return super.renderModel(level, pos, state, side, rand, modelData);
}
Aggregations