--- a/net/minecraft/core/BlockPos.java
+++ b/net/minecraft/core/BlockPos.java
@@ -51,15 +_,17 @@
     };
     private static final Logger LOGGER = LogUtils.getLogger();
     public static final BlockPos ZERO = new BlockPos(0, 0, 0);
-    public static final int PACKED_HORIZONTAL_LENGTH = 1 + Mth.log2(Mth.smallestEncompassingPowerOfTwo(30000000));
-    public static final int PACKED_Y_LENGTH = 64 - 2 * PACKED_HORIZONTAL_LENGTH;
-    private static final long PACKED_X_MASK = (1L << PACKED_HORIZONTAL_LENGTH) - 1L;
-    private static final long PACKED_Y_MASK = (1L << PACKED_Y_LENGTH) - 1L;
-    private static final long PACKED_Z_MASK = (1L << PACKED_HORIZONTAL_LENGTH) - 1L;
+    // Paper start - Optimize Bit Operations by inlining
+    public static final int PACKED_HORIZONTAL_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 Y_OFFSET = 0;
-    private static final int Z_OFFSET = PACKED_Y_LENGTH;
-    private static final int X_OFFSET = PACKED_Y_LENGTH + PACKED_HORIZONTAL_LENGTH;
-    public static final int MAX_HORIZONTAL_COORDINATE = (1 << PACKED_HORIZONTAL_LENGTH) / 2 - 1;
+    private static final int Z_OFFSET = 12;
+    private static final int X_OFFSET = 38;
+    public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
+    // Paper end - Optimize Bit Operations by inlining
 
     public BlockPos(int x, int y, int z) {
         super(x, y, z);
@@ -69,28 +_,29 @@
         this(vector.getX(), vector.getY(), vector.getZ());
     }
 
+    public static long getAdjacent(int baseX, int baseY, int baseZ, Direction direction) { return asLong(baseX + direction.getStepX(), baseY + direction.getStepY(), baseZ + direction.getStepZ()); } // Paper
     public static long offset(long pos, Direction direction) {
         return offset(pos, direction.getStepX(), direction.getStepY(), direction.getStepZ());
     }
 
     public static long offset(long pos, int dx, int dy, int dz) {
-        return asLong(getX(pos) + dx, getY(pos) + dy, getZ(pos) + dz);
+        return asLong((int) (pos >> 38) + dx, (int) ((pos << 52) >> 52) + dy, (int) ((pos << 26) >> 38) + dz); // Paper - simplify/inline
     }
 
     public static int getX(long packedPos) {
-        return (int)(packedPos << 64 - X_OFFSET - PACKED_HORIZONTAL_LENGTH >> 64 - PACKED_HORIZONTAL_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_HORIZONTAL_LENGTH >> 64 - PACKED_HORIZONTAL_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 static BlockPos containing(double x, double y, double z) {
@@ -114,10 +_,7 @@
     }
 
     public static long asLong(int x, int y, int z) {
-        long l = 0L;
-        l |= (x & PACKED_X_MASK) << X_OFFSET;
-        l |= (y & PACKED_Y_MASK) << 0;
-        return l | (z & PACKED_Z_MASK) << Z_OFFSET;
+        return ((x & 67108863L) << 38) | ((y &  4095L)) | ((z & 67108863L) << 12); // Paper - inline constants and simplify
     }
 
     public static long getFlatIndex(long packedPos) {
@@ -158,67 +_,84 @@
 
     @Override
     public BlockPos above() {
-        return this.relative(Direction.UP);
+        return new BlockPos(this.getX(), this.getY() + 1, this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos above(int distance) {
-        return this.relative(Direction.UP, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX(), this.getY() + distance, this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos below() {
-        return this.relative(Direction.DOWN);
+        return new BlockPos(this.getX(), this.getY() - 1, this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos below(int distance) {
-        return this.relative(Direction.DOWN, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX(), this.getY() - distance, this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos north() {
-        return this.relative(Direction.NORTH);
+        return new BlockPos(this.getX(), this.getY(), this.getZ() - 1); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos north(int distance) {
-        return this.relative(Direction.NORTH, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX(), this.getY(), this.getZ() - distance); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos south() {
-        return this.relative(Direction.SOUTH);
+        return new BlockPos(this.getX(), this.getY(), this.getZ() + 1); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos south(int distance) {
-        return this.relative(Direction.SOUTH, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX(), this.getY(), this.getZ() + distance); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos west() {
-        return this.relative(Direction.WEST);
+        return new BlockPos(this.getX() - 1, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos west(int distance) {
-        return this.relative(Direction.WEST, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX() - distance, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos east() {
-        return this.relative(Direction.EAST);
+        return new BlockPos(this.getX() + 1, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos east(int distance) {
-        return this.relative(Direction.EAST, distance);
+        return distance == 0 ? this.immutable() : new BlockPos(this.getX() + distance, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
     }
 
     @Override
     public BlockPos relative(Direction direction) {
-        return new BlockPos(this.getX() + direction.getStepX(), this.getY() + direction.getStepY(), this.getZ() + direction.getStepZ());
+        // Paper start - Perf: 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 - Perf: Optimize BlockPosition
     }
 
     @Override
@@ -573,9 +_,9 @@
         }
 
         public BlockPos.MutableBlockPos set(int x, int y, int z) {
-            this.setX(x);
-            this.setY(y);
-            this.setZ(z);
+            this.x = x; // Paper - Perf: Manually inline methods in BlockPosition
+            this.y = y; // Paper - Perf: Manually inline methods in BlockPosition
+            this.z = z; // Paper - Perf: Manually inline methods in BlockPosition
             return this;
         }
 
@@ -638,19 +_,19 @@
 
         @Override
         public BlockPos.MutableBlockPos setX(int x) {
-            super.setX(x);
+            this.x = x; // Paper - Perf: Manually inline methods in BlockPosition
             return this;
         }
 
         @Override
         public BlockPos.MutableBlockPos setY(int y) {
-            super.setY(y);
+            this.y = y; // Paper - Perf: Manually inline methods in BlockPosition
             return this;
         }
 
         @Override
         public BlockPos.MutableBlockPos setZ(int z) {
-            super.setZ(z);
+            this.z = z; // Paper - Perf: Manually inline methods in BlockPosition
             return this;
         }
 
