diff options
author | Spottedleaf <[email protected]> | 2019-12-01 05:33:57 -0800 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2019-12-01 13:33:57 +0000 |
commit | b499d0d8404ca4d2228a841addb4eca8784612de (patch) | |
tree | 6f0396f01206aa10c04b86443a3e94e279abd1de | |
parent | 779f34cc3717b9d2e5fb6f8551031ea7deaaac4b (diff) | |
download | Paper-b499d0d8404ca4d2228a841addb4eca8784612de.tar.gz Paper-b499d0d8404ca4d2228a841addb4eca8784612de.zip |
Shift chunk key location in the correct direction (#2710)
-rw-r--r-- | Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch index c87a199f96..04e9f88f0a 100644 --- a/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -1,4 +1,4 @@ -From e31205e58fdc02cb6102c7f710a61a1ff8499067 Mon Sep 17 00:00:00 2001 +From 13d88336c734b2f4d7ec780cd4170c29bd517273 Mon Sep 17 00:00:00 2001 From: Aikar <[email protected]> Date: Sat, 4 Aug 2018 19:37:35 -0400 Subject: [PATCH] Provide Chunk Coordinates as a Long API @@ -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. 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 +++ b/src/main/java/org/bukkit/Chunk.java @@ -27,6 +27,32 @@ public interface Chunk { @@ -27,7 +27,7 @@ index 95e485ee..7b0424d5 100644 + * @return Location's chunk coordinates packed into a long + */ + 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 * 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 +++ b/src/main/java/org/bukkit/World.java @@ -158,6 +158,22 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -71,5 +71,5 @@ index 59cfe1ce..00a542f8 100644 * Checks if the specified {@link Chunk} is loaded * -- -2.23.0 +2.24.0 |