Esempio n. 1
0
 private void renderBancBord(ItemStack coverBlock, int x, int y, int z) {
   int data = BlockProperties.getMetadata(TE);
   int rotation = BancD.getRotation(data);
   switch (rotation) {
     case BancD.BANC_X_NEG:
       renderBlocks.setRenderBounds(0.2D, 0.0D, 0.2D, 0.3D, 0.4D, 0.8D);
       renderBlock(coverBlock, x, y, z);
       renderBlocks.setRenderBounds(0.15D, 0.4D, 0.15D, 1.0D, 0.5D, 0.85D);
       renderBlock(coverBlock, x, y, z);
       break;
     case BancD.BANC_X_POS:
       renderBlocks.setRenderBounds(0.7D, 0.0D, 0.2D, 0.8D, 0.4D, 0.8D);
       renderBlock(coverBlock, x, y, z);
       renderBlocks.setRenderBounds(0.0D, 0.4D, 0.15D, 0.85D, 0.5D, 0.85D);
       renderBlock(coverBlock, x, y, z);
       break;
     case BancD.BANC_Z_NEG:
       renderBlocks.setRenderBounds(0.2D, 0.0D, 0.2D, 0.8D, 0.4D, 0.3D);
       renderBlock(coverBlock, x, y, z);
       renderBlocks.setRenderBounds(0.15D, 0.4D, 0.15D, 0.85D, 0.5D, 1.0D);
       renderBlock(coverBlock, x, y, z);
       break;
     case BancD.BANC_Z_POS:
       renderBlocks.setRenderBounds(0.2D, 0.0D, 0.7D, 0.8D, 0.4D, 0.8D);
       renderBlock(coverBlock, x, y, z);
       renderBlocks.setRenderBounds(0.15D, 0.4D, 0.0D, 0.85D, 0.5D, 0.85D);
       renderBlock(coverBlock, x, y, z);
   }
 }
Esempio n. 2
0
  /** Sets state (open or closed). */
  public static void setState(TEBase TE, int state, boolean playSound) {
    int temp = BlockProperties.getMetadata(TE) & 0xffbf;
    temp |= state << 6;

    World world = TE.getWorldObj();

    if (!world.isRemote && playSound) {
      world.playAuxSFXAtEntity((EntityPlayer) null, 1003, TE.xCoord, TE.yCoord, TE.zCoord, 0);
    }

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 3
0
  /** Sets facing (faces opening direction). */
  public static void setFacing(TEBase TE, int facing) {
    int temp = BlockProperties.getMetadata(TE) & 0xffcf;
    temp |= facing << 4;

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 4
0
 /** Returns open/closed state. */
 public static int getState(TEBase TE) {
   int temp = BlockProperties.getMetadata(TE) & 0x40;
   return temp >> 6;
 }
Esempio n. 5
0
  /** Sets hinge side (relative to facing). */
  public static void setHingeSide(TEBase TE, int hingeSide) {
    int temp = BlockProperties.getMetadata(TE) & 0xfff7;
    temp |= hingeSide << 3;

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 6
0
 /** Returns facing (faces opening direction). */
 public static int getFacing(TEBase TE) {
   int temp = BlockProperties.getMetadata(TE) & 0x30;
   return temp >> 4;
 }
Esempio n. 7
0
  /** Sets type. */
  public static void setType(TEBase TE, int type) {
    int temp = BlockProperties.getMetadata(TE) & 0xfff8;
    temp |= type;

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 8
0
 /** Returns hinge side (relative to facing). */
 public static int getHinge(TEBase TE) {
   int temp = BlockProperties.getMetadata(TE) & 0x8;
   return temp >> 3;
 }
Esempio n. 9
0
 /** Returns type. */
 public static int getType(TEBase TE) {
   return BlockProperties.getMetadata(TE) & 0x7;
 }
Esempio n. 10
0
  /** Sets door rigidity (requires redstone for activation). */
  public static void setRigidity(TEBase TE, int rigid) {
    int temp = BlockProperties.getMetadata(TE) & 0xfeff;
    temp |= rigid << 8;

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 11
0
 /** Returns door rigidity (requires redstone for activation). */
 public static int getRigidity(TEBase TE) {
   int temp = BlockProperties.getMetadata(TE) & 0x100;
   return temp >> 8;
 }
Esempio n. 12
0
  /** Sets door piece (top or bottom). */
  public static void setPiece(TEBase TE, int piece) {
    int temp = BlockProperties.getMetadata(TE) & 0xff7f;
    temp |= piece << 7;

    BlockProperties.setMetadata(TE, temp);
  }
Esempio n. 13
0
 /** Returns door piece (top or bottom). */
 public static int getPiece(TEBase TE) {
   int temp = BlockProperties.getMetadata(TE) & 0x80;
   return temp >> 7;
 }