summaryrefslogtreecommitdiffstats
path: root/nms-patches/RegionFile.patch
diff options
context:
space:
mode:
authorGeoff Crossland <gcrossland+bukkit@gmail.com>2017-01-31 23:52:21 +0000
committermd_5 <git@md-5.net>2017-04-27 21:25:33 +1000
commit6194f6cc4985a4a6840bb2cc39375caf9835ae68 (patch)
tree8b7fbbd61df2878e006b0766393f1329d4d00608 /nms-patches/RegionFile.patch
parent55a1f9ff12e69ef036ae999dc8cf63f2622cc873 (diff)
downloadcraftbukkit-6194f6cc4985a4a6840bb2cc39375caf9835ae68.tar
craftbukkit-6194f6cc4985a4a6840bb2cc39375caf9835ae68.tar.gz
craftbukkit-6194f6cc4985a4a6840bb2cc39375caf9835ae68.tar.lz
craftbukkit-6194f6cc4985a4a6840bb2cc39375caf9835ae68.tar.xz
craftbukkit-6194f6cc4985a4a6840bb2cc39375caf9835ae68.zip
Drop RegionFile.chunkExists() in favour of Mojang's own version
Diffstat (limited to 'nms-patches/RegionFile.patch')
-rw-r--r--nms-patches/RegionFile.patch54
1 files changed, 11 insertions, 43 deletions
diff --git a/nms-patches/RegionFile.patch b/nms-patches/RegionFile.patch
index de585900..a1abb025 100644
--- a/nms-patches/RegionFile.patch
+++ b/nms-patches/RegionFile.patch
@@ -1,48 +1,16 @@
--- a/net/minecraft/server/RegionFile.java
+++ b/net/minecraft/server/RegionFile.java
-@@ -86,6 +86,45 @@
+@@ -224,11 +224,11 @@
+ return i < 0 || i >= 32 || j < 0 || j >= 32;
+ }
+
+- private int e(int i, int j) {
++ private synchronized int e(int i, int j) { // CraftBukkit
+ return this.d[i + j * 32];
+ }
+- public boolean c(int i, int j) {
++ public boolean c(int i, int j) { // PAIL chunkExists
+ return this.e(i, j) != 0;
}
-+ // CraftBukkit start - This is a copy (sort of) of the method below it, make sure they stay in sync
-+ public synchronized boolean chunkExists(int i, int j) {
-+ if (this.d(i, j)) {
-+ return false;
-+ } else {
-+ try {
-+ int k = this.e(i, j);
-+
-+ if (k == 0) {
-+ return false;
-+ } else {
-+ int l = k >> 8;
-+ int i1 = k & 255;
-+
-+ if (l + i1 > this.f.size()) {
-+ return false;
-+ }
-+
-+ this.c.seek((long) (l * 4096));
-+ int j1 = this.c.readInt();
-+
-+ if (j1 > 4096 * i1 || j1 <= 0) {
-+ return false;
-+ }
-+
-+ byte b0 = this.c.readByte();
-+ if (b0 == 1 || b0 == 2) {
-+ return true;
-+ }
-+ }
-+ } catch (IOException ioexception) {
-+ return false;
-+ }
-+ }
-+
-+ return false;
-+ }
-+ // CraftBukkit end
-+
- @Nullable
- public synchronized DataInputStream a(int i, int j) {
- if (this.d(i, j)) {