Add static encode/decode for block long keys (#1712)

Should make this API easier to use.
This commit is contained in:
Spottedleaf 2019-04-08 21:08:14 -07:00 committed by Daniel Ennis
commit 0181fb14b6
4 changed files with 92 additions and 43 deletions

View file

@ -1,11 +1,11 @@
From e69f6fd86a2a77175c639ee9438deccd46f0f2c5 Mon Sep 17 00:00:00 2001
From 39f88f102e19e146cd9a008dfc0af879190f3f3a Mon Sep 17 00:00:00 2001
From: cswhite2000 <18whitechristop@gmail.com>
Date: Tue, 21 Aug 2018 19:39:46 -0700
Subject: [PATCH] isChunkGenerated API
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 334e31350..57ce443a5 100644
index 2719eecb..a90f78d5 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 334e31350..57ce443a5 100644
import java.util.HashMap;
import java.util.Map;
@@ -519,6 +520,15 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -518,6 +519,15 @@ public class Location implements Cloneable, ConfigurationSerializable {
public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
// Paper start
@ -32,10 +32,10 @@ index 334e31350..57ce443a5 100644
/**
* Sets the position of this Location and returns itself
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 158917492..6b91635fe 100644
index fa736b07..38dae649 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -197,6 +197,17 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -196,6 +196,17 @@ public interface World extends PluginMessageRecipient, Metadatable {
return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
}