    001package net.minecraft.util;
    002
    003public enum EnumFacing
    004{
    005    DOWN(0, 1, 0, -1, 0),
    006    UP(1, 0, 0, 1, 0),
    007    NORTH(2, 3, 0, 0, -1),
    008    SOUTH(3, 2, 0, 0, 1),
    009    EAST(4, 5, -1, 0, 0),
    010    WEST(5, 4, 1, 0, 0);
    011
    012    /** Face order for D-U-N-S-E-W. */
    013    private final int order_a;
    014
    015    /** Face order for U-D-S-N-W-E. */
    016    private final int order_b;
    017    private final int frontOffsetX;
    018    private final int frontOffsetY;
    019    private final int frontOffsetZ;
    020
    021    /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */
    022    private static final EnumFacing[] faceList = new EnumFacing[6];
    023
    024    private EnumFacing(int par3, int par4, int par5, int par6, int par7)
    025    {
    026        this.order_a = par3;
    027        this.order_b = par4;
    028        this.frontOffsetX = par5;
    029        this.frontOffsetY = par6;
    030        this.frontOffsetZ = par7;
    031    }
    032
    033    /**
    034     * Returns a offset that addresses the block in front of this facing.
    035     */
    036    public int getFrontOffsetX()
    037    {
    038        return this.frontOffsetX;
    039    }
    040
    041    public int func_96559_d()
    042    {
    043        return this.frontOffsetY;
    044    }
    045
    046    /**
    047     * Returns a offset that addresses the block in front of this facing.
    048     */
    049    public int getFrontOffsetZ()
    050    {
    051        return this.frontOffsetZ;
    052    }
    053
    054    /**
    055     * Returns the facing that represents the block in front of it.
    056     */
    057    public static EnumFacing getFront(int par0)
    058    {
    059        return faceList[par0 % faceList.length];
    060    }
    061
    062    static {
    063        EnumFacing[] var0 = values();
    064        int var1 = var0.length;
    065
    066        for (int var2 = 0; var2 < var1; ++var2)
    067        {
    068            EnumFacing var3 = var0[var2];
    069            faceList[var3.order_a] = var3;
    070        }
    071    }
    072}