QuadCollector.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:EnderIO 作者:
/**
 * Adds the baked model(s) of the given block states to the quad lists for the given block layer. The models are expected to behave. The block layer will be
 * NOT set when the models are asked for their quads.
 */
public void addFriendlyBlockStates(BlockRenderLayer pass, List<IBlockState> states) {
  if (states == null || states.isEmpty()) {
    return;
  }

  BlockModelShapes modelShapes = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes();
  for (IBlockState state : states) {
    if (state != null) {
      IBakedModel model = modelShapes.getModelForState(state);
      List<BakedQuad> generalQuads = model.getQuads(state, null, 0);
      if (!generalQuads.isEmpty()) {
        addQuads(null, pass, generalQuads);
      }
      for (EnumFacing face : EnumFacing.values()) {
        List<BakedQuad> faceQuads = model.getQuads(state, face, 0);
        if (!faceQuads.isEmpty()) {
          addQuads(face, pass, faceQuads);
        }
      }
    }
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号