summaryrefslogtreecommitdiffstats
path: root/nms-patches/RegionFile.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/RegionFile.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/RegionFile.patch')
-rw-r--r--nms-patches/RegionFile.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/nms-patches/RegionFile.patch b/nms-patches/RegionFile.patch
new file mode 100644
index 00000000..80999d9c
--- /dev/null
+++ b/nms-patches/RegionFile.patch
@@ -0,0 +1,81 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/RegionFile.java 2014-11-27 08:59:46.881421054 +1100
++++ src/main/java/net/minecraft/server/RegionFile.java 2014-11-27 08:42:10.160850895 +1100
+@@ -86,8 +86,46 @@
+ } catch (IOException ioexception) {
+ ioexception.printStackTrace();
+ }
++ }
++
++ // 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
+
+ public synchronized DataInputStream a(int i, int j) {
+ if (this.d(i, j)) {
+@@ -214,7 +252,7 @@
+
+ }
+
+- private void a(int i, byte[] abyte, int j) {
++ private void a(int i, byte[] abyte, int j) throws IOException { // CraftBukkit - added throws
+ this.c.seek((long) (i * 4096));
+ this.c.writeInt(j + 1);
+ this.c.writeByte(2);
+@@ -233,19 +271,19 @@
+ return this.e(i, j) != 0;
+ }
+
+- private void a(int i, int j, int k) {
++ private void a(int i, int j, int k) throws IOException { // CraftBukkit - added throws
+ this.d[i + j * 32] = k;
+ this.c.seek((long) ((i + j * 32) * 4));
+ this.c.writeInt(k);
+ }
+
+- private void b(int i, int j, int k) {
++ private void b(int i, int j, int k) throws IOException { // CraftBukkit - added throws
+ this.e[i + j * 32] = k;
+ this.c.seek((long) (4096 + (i + j * 32) * 4));
+ this.c.writeInt(k);
+ }
+
+- public void c() {
++ public void c() throws IOException { // CraftBukkit - added throws
+ if (this.c != null) {
+ this.c.close();
+ }