コード例 #1
0
  @Override
  public AxisAlignedBB getBoundingBox(ForgeDirection side) {
    float[][] bounds = new float[3][2];
    // X START - END
    bounds[0][0] = 0.25F - 0.0625F;
    bounds[0][1] = 0.75F + 0.0625F;
    // Y START - END
    bounds[1][0] = 0.000F;
    bounds[1][1] = 0.125F;
    // Z START - END
    bounds[2][0] = 0.25F - 0.0625F;
    bounds[2][1] = 0.75F + 0.0625F;

    MatrixTranformations.transform(bounds, side);
    return AxisAlignedBB.getBoundingBox(
        bounds[0][0], bounds[1][0], bounds[2][0], bounds[0][1], bounds[1][1], bounds[2][1]);
  }
コード例 #2
0
    @Override
    public void renderPluggable(
        RenderBlocks renderblocks,
        IPipe pipe,
        ForgeDirection side,
        PipePluggable pipePluggable,
        ITextureStates blockStateMachine,
        int renderPass,
        int x,
        int y,
        int z) {
      float[][] zeroState = new float[3][2];

      // X START - END
      zeroState[0][0] = 0.1875F;
      zeroState[0][1] = 0.8125F;
      // Y START - END
      zeroState[1][0] = 0.000F;
      zeroState[1][1] = 0.125F;
      // Z START - END
      zeroState[2][0] = 0.1875F;
      zeroState[2][1] = 0.8125F;

      if (renderPass == 1) {
        blockStateMachine.setRenderMask(1 << side.ordinal() | (1 << (side.ordinal() ^ 1)));

        for (int i = 0; i < 3; i++) {
          zeroState[i][0] += zFightOffset;
          zeroState[i][1] -= zFightOffset;
        }
        blockStateMachine
            .getTextureState()
            .set(
                BuildCraftTransport.instance.pipeIconProvider.getIcon(
                    PipeIconProvider.TYPE.PipeLensOverlay.ordinal()));
        ((FakeBlock) blockStateMachine)
            .setColor(ColorUtils.getRGBColor(15 - ((LensPluggable) pipePluggable).color));

        blockStateMachine.setRenderAllSides();
      } else {
        if (((LensPluggable) pipePluggable).isFilter) {
          blockStateMachine
              .getTextureState()
              .set(
                  BuildCraftTransport.instance.pipeIconProvider.getIcon(
                      PipeIconProvider.TYPE.PipeFilter.ordinal()));
        } else {
          blockStateMachine
              .getTextureState()
              .set(
                  BuildCraftTransport.instance.pipeIconProvider.getIcon(
                      PipeIconProvider.TYPE.PipeLens.ordinal()));
        }
      }

      float[][] rotated = MatrixTranformations.deepClone(zeroState);
      MatrixTranformations.transform(rotated, side);

      renderblocks.setRenderBounds(
          rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
      renderblocks.renderStandardBlock(blockStateMachine.getBlock(), x, y, z);

      ((FakeBlock) blockStateMachine).setColor(0xFFFFFF);
    }