3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Fix isEdgeOfChunk check for MCUtils

Dieser Commit ist enthalten in:
Aikar 2016-03-31 21:43:37 -04:00
Ursprung 578af64827
Commit d03da137f2

Datei anzeigen

@ -1,4 +1,4 @@
From bb8dd93f486683d2a80fe0d23337f11faca44e9a Mon Sep 17 00:00:00 2001
From 2bce99d815e516c5ea740c9f161933d7f7f5bcdd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
@ -7,7 +7,7 @@ Collection of utils to help reduce NMS diff
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
index 0000000..3004822
index 0000000..abe7e9f
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,115 @@
@ -121,9 +121,9 @@ index 0000000..3004822
+ }
+
+ public static boolean isEdgeOfChunk(BlockPosition pos) {
+ final int absX = Math.abs(pos.getX()) % 16;
+ final int absZ = Math.abs(pos.getZ()) % 16;
+ return (absX == 0 || absX == 15 || absZ == 0 || absZ == 15);
+ final int modX = pos.getX() & 15;
+ final int modZ = pos.getZ() & 15;
+ return (modX == 0 || modX == 15 || modZ == 0 || modZ == 15);
+ }
+}
--