示例#1
0
 @Override
 public int[] getAccessibleSlotsFromSide(int var1) {
   return var1 == ForgeDirection.DOWN.ordinal() ? new int[0] : new int[] {0};
 }
示例#2
0
 @Override
 public boolean canExtractItem(int i, ItemStack itemstack, int j) {
   return j != ForgeDirection.DOWN.ordinal();
 }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess iblockaccess,
      int x,
      int y,
      int z,
      Block block,
      int l,
      RenderBlocks renderblocks) {

    int meta = iblockaccess.getBlockMetadata(x, y, z);

    if (meta == ForgeDirection.EAST.ordinal()) {
      renderblocks.uvRotateEast = 2;
      renderblocks.uvRotateWest = 1;
      renderblocks.uvRotateTop = 1;
      renderblocks.uvRotateBottom = 2;

      block.setBlockBounds(0.0F, 0.0F, 0.0F, 4F / 16F, 1, 1);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, 11F / 16F, 11F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    } else if (meta == ForgeDirection.WEST.ordinal()) {
      renderblocks.uvRotateEast = 1;
      renderblocks.uvRotateWest = 2;
      renderblocks.uvRotateTop = 2;
      renderblocks.uvRotateBottom = 1;

      block.setBlockBounds(1F - 4F / 16F, 0.0F, 0.0F, 1, 1, 1);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, 1F - 4F / 16F, 11F / 16F, 11F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    } else if (meta == ForgeDirection.NORTH.ordinal()) {
      renderblocks.uvRotateSouth = 1;
      renderblocks.uvRotateNorth = 2;

      block.setBlockBounds(0.0F, 0.0F, 1F - 4F / 16F, 1, 1, 1);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, 11F / 16F, 1F - 4F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    } else if (meta == ForgeDirection.SOUTH.ordinal()) {
      renderblocks.uvRotateSouth = 2;
      renderblocks.uvRotateNorth = 1;
      renderblocks.uvRotateTop = 3;
      renderblocks.uvRotateBottom = 3;

      block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 4F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, 11F / 16F, 13F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    } else if (meta == ForgeDirection.DOWN.ordinal()) {
      renderblocks.uvRotateEast = 3;
      renderblocks.uvRotateWest = 3;
      renderblocks.uvRotateSouth = 3;
      renderblocks.uvRotateNorth = 3;

      block.setBlockBounds(0.0F, 1.0F - 4F / 16F, 0.0F, 1.0F, 1.0F, 1.0F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, 1F - 4F / 16F, 11F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    } else if (meta == ForgeDirection.UP.ordinal()) {
      block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);

      block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F);
      renderblocks.setRenderBoundsFromBlock(block);
      renderblocks.renderStandardBlock(block, x, y, z);
    }

    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 1);
    renderblocks.uvRotateEast = 0;
    renderblocks.uvRotateWest = 0;
    renderblocks.uvRotateSouth = 0;
    renderblocks.uvRotateNorth = 0;
    renderblocks.uvRotateTop = 0;
    renderblocks.uvRotateBottom = 0;

    return true;
  }