mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 00:56:39 +01:00
Fix isEdgeOfChunk check for MCUtils
This commit is contained in:
parent
578af64827
commit
d03da137f2
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
|
|
Loading…
Reference in a new issue