--- a/net/minecraft/core/BlockPos.java
+++ b/net/minecraft/core/BlockPos.java
@@ -30,15 +30,16 @@
     }).stable();
     private static final Logger LOGGER = LogUtils.getLogger();
     public static final BlockPos ZERO = new BlockPos(0, 0, 0);
-    private static final int PACKED_X_LENGTH = 1 + Mth.log2(Mth.smallestEncompassingPowerOfTwo(30000000));
-    private static final int PACKED_Z_LENGTH = PACKED_X_LENGTH;
-    public static final int PACKED_Y_LENGTH = 64 - PACKED_X_LENGTH - PACKED_Z_LENGTH;
-    private static final long PACKED_X_MASK = (1L << PACKED_X_LENGTH) - 1L;
-    private static final long PACKED_Y_MASK = (1L << PACKED_Y_LENGTH) - 1L;
-    private static final long PACKED_Z_MASK = (1L << PACKED_Z_LENGTH) - 1L;
-    private static final int Y_OFFSET = 0;
-    private static final int Z_OFFSET = PACKED_Y_LENGTH;
-    private static final int X_OFFSET = PACKED_Y_LENGTH + PACKED_Z_LENGTH;
+    // Paper start - static constants
+    private static final int PACKED_X_LENGTH = 26;
+    private static final int PACKED_Z_LENGTH = 26;
+    public static final int PACKED_Y_LENGTH = 12;
+    private static final long PACKED_X_MASK = 67108863;
+    private static final long PACKED_Y_MASK = 4095;
+    private static final long PACKED_Z_MASK = 67108863;
+    private static final int Z_OFFSET = 12;
+    private static final int X_OFFSET = 38;
+    // Paper end
 
     public BlockPos(int x, int y, int z) {
         super(x, y, z);
@@ -60,28 +61,29 @@
         this(pos.getX(), pos.getY(), pos.getZ());
     }
 
+    public static long getAdjacent(int baseX, int baseY, int baseZ, Direction enumdirection) { return asLong(baseX + enumdirection.getStepX(), baseY + enumdirection.getStepY(), baseZ + enumdirection.getStepZ()); } // Paper
     public static long offset(long value, Direction direction) {
         return offset(value, direction.getStepX(), direction.getStepY(), direction.getStepZ());
     }
 
     public static long offset(long value, int x, int y, int z) {
-        return asLong(getX(value) + x, getY(value) + y, getZ(value) + z);
+        return asLong((int) (value >> 38) + x, (int) ((value << 52) >> 52) + y, (int) ((value << 26) >> 38) + z); // Paper - simplify/inline
     }
 
     public static int getX(long packedPos) {
-        return (int)(packedPos << 64 - X_OFFSET - PACKED_X_LENGTH >> 64 - PACKED_X_LENGTH);
+        return (int) (packedPos >> 38); // Paper - simplify/inline
     }
 
     public static int getY(long packedPos) {
-        return (int)(packedPos << 64 - PACKED_Y_LENGTH >> 64 - PACKED_Y_LENGTH);
+        return (int) ((packedPos << 52) >> 52); // Paper - simplify/inline
     }
 
     public static int getZ(long packedPos) {
-        return (int)(packedPos << 64 - Z_OFFSET - PACKED_Z_LENGTH >> 64 - PACKED_Z_LENGTH);
+        return (int) ((packedPos << 26) >> 38);  // Paper - simplify/inline
     }
 
     public static BlockPos of(long packedPos) {
-        return new BlockPos(getX(packedPos), getY(packedPos), getZ(packedPos));
+        return new BlockPos((int) (packedPos >> 38), (int) ((packedPos << 52) >> 52), (int) ((packedPos << 26) >> 38)); // Paper - simplify/inline
     }
 
     public long asLong() {
@@ -89,10 +91,7 @@
     }
 
     public static long asLong(int x, int y, int z) {
-        long l = 0L;
-        l |= ((long)x & PACKED_X_MASK) << X_OFFSET;
-        l |= ((long)y & PACKED_Y_MASK) << 0;
-        return l | ((long)z & PACKED_Z_MASK) << Z_OFFSET;
+        return (((long) x & (long) 67108863) << 38) | (((long) y & (long) 4095)) | (((long) z & (long) 67108863) << 12); // Paper - inline constants and simplify
     }
 
     public static long getFlatIndex(long y) {
@@ -134,67 +133,84 @@
 
     @Override
     public BlockPos above() {
-        return this.relative(Direction.UP);
+        return new BlockPos(this.getX(), this.getY() + 1, this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos above(int distance) {
-        return this.relative(Direction.UP, distance);
+        return distance == 0 ? this : new BlockPos(this.getX(), this.getY() + distance, this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos below() {
-        return this.relative(Direction.DOWN);
+        return new BlockPos(this.getX(), this.getY() - 1, this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos below(int i) {
-        return this.relative(Direction.DOWN, i);
+        return i == 0 ? this : new BlockPos(this.getX(), this.getY() - i, this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos north() {
-        return this.relative(Direction.NORTH);
+        return new BlockPos(this.getX(), this.getY(), this.getZ() - 1); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos north(int distance) {
-        return this.relative(Direction.NORTH, distance);
+        return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() - distance); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos south() {
-        return this.relative(Direction.SOUTH);
+        return new BlockPos(this.getX(), this.getY(), this.getZ() + 1); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos south(int distance) {
-        return this.relative(Direction.SOUTH, distance);
+        return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() + distance); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos west() {
-        return this.relative(Direction.WEST);
+        return new BlockPos(this.getX() - 1, this.getY(), this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos west(int distance) {
-        return this.relative(Direction.WEST, distance);
+        return distance == 0 ? this : new BlockPos(this.getX() - distance, this.getY(), this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos east() {
-        return this.relative(Direction.EAST);
+        return new BlockPos(this.getX() + 1, this.getY(), this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos east(int distance) {
-        return this.relative(Direction.EAST, distance);
+        return distance == 0 ? this : new BlockPos(this.getX() + distance, this.getY(), this.getZ()); // Paper - Optimize BlockPosition
     }
 
     @Override
     public BlockPos relative(Direction direction) {
+        // Paper Start - Optimize BlockPosition
+        switch(direction) {
+            case UP:
+                return new BlockPos(this.getX(), this.getY() + 1, this.getZ());
+            case DOWN:
+                return new BlockPos(this.getX(), this.getY() - 1, this.getZ());
+            case NORTH:
+                return new BlockPos(this.getX(), this.getY(), this.getZ() - 1);
+            case SOUTH:
+                return new BlockPos(this.getX(), this.getY(), this.getZ() + 1);
+            case WEST:
+                return new BlockPos(this.getX() - 1, this.getY(), this.getZ());
+            case EAST:
+                return new BlockPos(this.getX() + 1, this.getY(), this.getZ());
+            default:
         return new BlockPos(this.getX() + direction.getStepX(), this.getY() + direction.getStepY(), this.getZ() + direction.getStepZ());
+        }
+        // Paper End
     }
 
     @Override
@@ -274,9 +290,11 @@
 
     public static Iterable<BlockPos> withinManhattan(BlockPos center, int rangeX, int rangeY, int rangeZ) {
         int i = rangeX + rangeY + rangeZ;
-        int j = center.getX();
-        int k = center.getY();
-        int l = center.getZ();
+        // Paper start - rename variables to fix conflict with anonymous class (remap fix)
+        int centerX = center.getX();
+        int centerY = center.getY();
+        int centerZ = center.getZ();
+        // Paper end
         return () -> {
             return new AbstractIterator<BlockPos>() {
                 private final BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos();
@@ -291,7 +309,7 @@
                 protected BlockPos computeNext() {
                     if (this.zMirror) {
                         this.zMirror = false;
-                        this.cursor.setZ(l - (this.cursor.getZ() - l));
+                        this.cursor.setZ(centerZ - (this.cursor.getZ() - centerZ)); // Paper - remap fix
                         return this.cursor;
                     } else {
                         BlockPos blockPos;
@@ -317,7 +335,7 @@
                             int k = this.currentDepth - Math.abs(i) - Math.abs(j);
                             if (k <= rangeZ) {
                                 this.zMirror = k != 0;
-                                blockPos = this.cursor.set(j + i, k + j, l + k);
+                                blockPos = this.cursor.set(centerX + i, centerY + j, centerZ + k); // Paper - remap fix
                             }
                         }
 
@@ -377,12 +395,12 @@
                     if (this.index == l) {
                         return this.endOfData();
                     } else {
-                        int i = this.index % i;
-                        int j = this.index / i;
-                        int k = j % j;
-                        int l = j / j;
+                        int offsetX = this.index % i; // Paper - decomp fix
+                        int u = this.index / i; // Paper - decomp fix
+                        int offsetY = u % j; // Paper - decomp fix
+                        int offsetZ = u / j; // Paper - decomp fix
                         ++this.index;
-                        return this.cursor.set(startX + i, startY + k, startZ + l);
+                        return this.cursor.set(startX + offsetX, startY + offsetY, startZ + offsetZ); // Paper - decomp fix
                     }
                 }
             };
@@ -470,9 +488,9 @@
         }
 
         public BlockPos.MutableBlockPos set(int x, int y, int z) {
-            this.setX(x);
-            this.setY(y);
-            this.setZ(z);
+            this.x = x; // Paper - force inline
+            this.y = y; // Paper - force inline
+            this.z = z; // Paper - force inline
             return this;
         }
 
@@ -533,23 +551,25 @@
             }
         }
 
+        // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep
         @Override
         public BlockPos.MutableBlockPos setX(int i) {
-            super.setX(i);
+            this.x = i; // Paper
             return this;
         }
 
         @Override
         public BlockPos.MutableBlockPos setY(int i) {
-            super.setY(i);
+            this.y = i; // Paper
             return this;
         }
 
         @Override
         public BlockPos.MutableBlockPos setZ(int i) {
-            super.setZ(i);
+            this.z = i; // Paper
             return this;
         }
+        // Paper end
 
         @Override
         public BlockPos immutable() {
