BlockPaintedTrapDoor.java 文件源码

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

项目:EnderIO 作者:
@SideOnly(Side.CLIENT)
private IBakedModel mapRender(IBlockState state, @Nullable IBlockState paint) {
  EnumFacing facing = state.getValue(FACING);
  Boolean open = state.getValue(OPEN);
  DoorHalf half = state.getValue(HALF);

  String model;
  ModelRotation modelState;

  if (open) {
    model = "trapdoor_open";
    switch (facing) {
    case EAST:
      modelState = ModelRotation.X0_Y90;
      break;
    case SOUTH:
      modelState = ModelRotation.X0_Y180;
      break;
    case WEST:
      modelState = ModelRotation.X0_Y270;
      break;
    default:
      modelState = null;
    }
  } else if (half == DoorHalf.TOP) {
    model = "trapdoor_top";
    modelState = null;
  } else {
    model = "trapdoor_bottom";
    modelState = null;
  }

  return PaintRegistry.getModel(IBakedModel.class, model, paint, modelState);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号