mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 00:22:08 -07:00
Shift chunk key location in the correct direction (#2710)
This commit is contained in:
@@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method
|
|||||||
to look up by the long key too.
|
to look up by the long key too.
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
|
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
|
||||||
index 95e485ee..7b0424d5 100644
|
index 95e485eea..0bbef14a9 100644
|
||||||
--- a/src/main/java/org/bukkit/Chunk.java
|
--- a/src/main/java/org/bukkit/Chunk.java
|
||||||
+++ b/src/main/java/org/bukkit/Chunk.java
|
+++ b/src/main/java/org/bukkit/Chunk.java
|
||||||
@@ -0,0 +0,0 @@ public interface Chunk {
|
@@ -0,0 +0,0 @@ public interface Chunk {
|
||||||
@@ -27,7 +27,7 @@ index 95e485ee..7b0424d5 100644
|
|||||||
+ * @return Location's chunk coordinates packed into a long
|
+ * @return Location's chunk coordinates packed into a long
|
||||||
+ */
|
+ */
|
||||||
+ static long getChunkKey(@NotNull Location loc) {
|
+ static long getChunkKey(@NotNull Location loc) {
|
||||||
+ return getChunkKey((int) Math.floor(loc.getX()) << 4, (int) Math.floor(loc.getZ()) << 4);
|
+ return getChunkKey((int) Math.floor(loc.getX()) >> 4, (int) Math.floor(loc.getZ()) >> 4);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
@@ -44,7 +44,7 @@ index 95e485ee..7b0424d5 100644
|
|||||||
* Gets the world containing this chunk
|
* Gets the world containing this chunk
|
||||||
*
|
*
|
||||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||||
index 59cfe1ce..00a542f8 100644
|
index 98f416455..b80b8b3b6 100644
|
||||||
--- a/src/main/java/org/bukkit/World.java
|
--- a/src/main/java/org/bukkit/World.java
|
||||||
+++ b/src/main/java/org/bukkit/World.java
|
+++ b/src/main/java/org/bukkit/World.java
|
||||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||||
|
Reference in New Issue
Block a user