package mcjty.rftools.shapes;

import net.minecraft.util.math.MathHelper;

public class BlockPosHelper {

    private static final int NUM_X_BITS = 1 + MathHelper.log2(MathHelper.smallestEncompassingPowerOfTwo(30000000));
    private static final int NUM_Z_BITS = NUM_X_BITS;
    private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS;
    private static final int Y_SHIFT = 0 + NUM_Z_BITS;
    private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS;
    private static final long X_MASK = (1L << NUM_X_BITS) - 1L;
    private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L;
    private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L;

    public static long toLong(int x, int y, int z) {
        return ((long)x & X_MASK) << X_SHIFT | ((long)y & Y_MASK) << Y_SHIFT | ((long)z & Z_MASK);
    }

}

@@ -719,22 +719,16 @@
 return (
-(long)
 x & X_MA
@@ -745,22 +745,16 @@
 HIFT %7C (
-(long)
 y & Y_MA
@@ -775,14 +775,8 @@
  %7C (
-(long)
 z & 

Remove unnecessary casts