@Override public void readSpawnData(ByteBuf buf) { this.type = Type.values()[buf.readByte()]; this.hangingPosition = BlockPos.fromLong(buf.readLong()); this.updateFacingWithBoundingBox(EnumFacing.getHorizontal(buf.readByte())); }
@Override public IBlockState getStateFromMeta(int meta) { EnumFacing facing = EnumFacing.getHorizontal(meta); return this.getDefaultState().withProperty(PROPERTYFACING, facing); }
static public EnumFacing getPlaceFace( final EntityLivingBase placer ) { return EnumFacing.getHorizontal( MathHelper.floor_double( placer.rotationYaw * 4.0F / 360.0F + 0.5D ) & 3 ).getOpposite(); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); }
@Override public IBlockState getStateFromMeta(int meta) { EnumFacing facing = EnumFacing.getHorizontal(meta); return this.getDefaultState().withProperty(PROPERTYFACING, facing); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); }
/** * Returns the Rotation of a multiblock structure based on the given entity's facing direction. */ private static Rotation getRotation(Entity entity) { return RotationUtil.rotationFromFacing(EnumFacing.getHorizontal(MathHelper.floor((double) (-entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3)); }
@Override public IBlockState getStateFromMeta(int meta) { EnumFacing face = EnumFacing.getHorizontal(meta); return this.getDefaultState().withProperty(FACING, face); }
@Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); }
@Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(POWERED, meta > 3); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(OCCUPIED, meta > 3); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta % 4)).withProperty(OPENED, meta / 4 > 0); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(MOUNTED, meta / 4 > 0); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(BlockBasin.FILLED, meta / 4 > 0); }
@Override public IBlockState getStateFromMeta(int meta) { int dir = meta & 3; int pos = (meta >> 2); return getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(dir)).withProperty(POSITION, pos); }
@Override public IBlockState getStateFromMeta(int meta) { EnumFacing face = EnumFacing.getHorizontal(meta); Type t = Type.fromId(meta >> 2); return this.getDefaultState().withProperty(FACING, face).withProperty(TYPE, t); }
@Override public IBlockState getStateFromMeta(int meta) { EnumFacing facing = EnumFacing.getHorizontal(meta); int colourbits = (meta & 0x0c) >> 2; // 0x0c is hexadecimal, in binary 1100 - the upper two bits, corresponding to the colour EnumColour colour = EnumColour.byMetadata(colourbits); return this.getDefaultState().withProperty(PROPERTYCOLOUR, colour).withProperty(PROPERTYFACING, facing); }
@Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(OPENED, (meta & 4) != 0).withProperty(HINGE, (meta & 8) == 0 ? BlockDoor.EnumHingePosition.LEFT : BlockDoor.EnumHingePosition.RIGHT); }