diff options
Diffstat (limited to 'Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch')
-rw-r--r-- | Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch b/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch index a2e0ec02c3..cd3a9824d5 100644 --- a/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch +++ b/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch @@ -7,10 +7,35 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 163a6c83a2e494e28981974ef9accd3255e562c2..8c2a4b57aba17b43517f7b09c4adf65ae5904b6d 100644 +index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3cada6b3f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -53,28 +53,29 @@ public class BlockPosition extends BaseBlockPosition { +@@ -24,14 +24,16 @@ public class BlockPosition extends BaseBlockPosition { + }).stable(); + private static final Logger LOGGER = LogManager.getLogger(); + public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); +- private static final int f = 1 + MathHelper.f(MathHelper.c(30000000)); +- private static final int g = BlockPosition.f; +- private static final int h = 64 - BlockPosition.f - BlockPosition.g; +- private static final long i = (1L << BlockPosition.f) - 1L; +- private static final long j = (1L << BlockPosition.h) - 1L; +- private static final long k = (1L << BlockPosition.g) - 1L; +- private static final int l = BlockPosition.h; +- private static final int m = BlockPosition.h + BlockPosition.g; ++ // Paper start - static constants ++ private static final int f = 26; ++ private static final int g = 26; ++ private static final int h = 12; ++ private static final long i = 67108863; ++ private static final long j = 4095; ++ private static final long k = 67108863; ++ private static final int l = 12; ++ private static final int m = 38; ++ // Paper end + + public BlockPosition(int i, int j, int k) { + super(i, j, k); +@@ -53,28 +55,29 @@ public class BlockPosition extends BaseBlockPosition { this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } @@ -45,7 +70,7 @@ index 163a6c83a2e494e28981974ef9accd3255e562c2..8c2a4b57aba17b43517f7b09c4adf65a } public long asLong() { -@@ -83,12 +84,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -83,12 +86,7 @@ public class BlockPosition extends BaseBlockPosition { public static long asLong(int x, int y, int z) { return a(x, y, z); } // Paper - OBFHELPER public static long a(int i, int j, int k) { |