Fix isEdgeOfChunk check for MCUtils

This commit is contained in:
Aikar 2016-03-31 21:43:37 -04:00
parent 578af64827
commit d03da137f2

View file

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