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); } }
/** 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); }
/** 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); }
/** Returns open/closed state. */ public static int getState(TEBase TE) { int temp = BlockProperties.getMetadata(TE) & 0x40; return temp >> 6; }
/** 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); }
/** Returns facing (faces opening direction). */ public static int getFacing(TEBase TE) { int temp = BlockProperties.getMetadata(TE) & 0x30; return temp >> 4; }
/** Sets type. */ public static void setType(TEBase TE, int type) { int temp = BlockProperties.getMetadata(TE) & 0xfff8; temp |= type; BlockProperties.setMetadata(TE, temp); }
/** Returns hinge side (relative to facing). */ public static int getHinge(TEBase TE) { int temp = BlockProperties.getMetadata(TE) & 0x8; return temp >> 3; }
/** Returns type. */ public static int getType(TEBase TE) { return BlockProperties.getMetadata(TE) & 0x7; }
/** 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); }
/** Returns door rigidity (requires redstone for activation). */ public static int getRigidity(TEBase TE) { int temp = BlockProperties.getMetadata(TE) & 0x100; return temp >> 8; }
/** 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); }
/** Returns door piece (top or bottom). */ public static int getPiece(TEBase TE) { int temp = BlockProperties.getMetadata(TE) & 0x80; return temp >> 7; }