aboutsummaryrefslogtreecommitdiffhomepage
path: root/removed
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2019-12-10 20:43:21 -0600
committerZach Brown <[email protected]>2019-12-10 22:01:17 -0600
commitf2ed239ead411618df00227e57b1d766e049071c (patch)
tree099072809384303674ccf06f69fafe10021191cb /removed
parenta308619d28ef16ef559c79a3b578792d51c13a87 (diff)
downloadPaper-f2ed239ead411618df00227e57b1d766e049071c.tar.gz
Paper-f2ed239ead411618df00227e57b1d766e049071c.zip
More progress
Diffstat (limited to 'removed')
-rw-r--r--removed/0078-Reduce-IO-ops-opening-a-new-region-file.patch52
-rw-r--r--removed/0081-Do-not-load-chunks-for-light-checks.patch23
2 files changed, 75 insertions, 0 deletions
diff --git a/removed/0078-Reduce-IO-ops-opening-a-new-region-file.patch b/removed/0078-Reduce-IO-ops-opening-a-new-region-file.patch
new file mode 100644
index 0000000000..501d25ab67
--- /dev/null
+++ b/removed/0078-Reduce-IO-ops-opening-a-new-region-file.patch
@@ -0,0 +1,52 @@
+From 299ea42df7d2ad51015e65dbbf5bb77a3d4f4e09 Mon Sep 17 00:00:00 2001
+From: Antony Riley <[email protected]>
+Date: Tue, 29 Mar 2016 06:56:23 +0300
+Subject: [PATCH] Reduce IO ops opening a new region file.
+
+
+diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
+index fb529eac9..faf425588 100644
+--- a/src/main/java/net/minecraft/server/RegionFile.java
++++ b/src/main/java/net/minecraft/server/RegionFile.java
+@@ -26,7 +26,7 @@ public class RegionFile implements AutoCloseable {
+ private final File file;
+ // Spigot end
+ private static final byte[] a = new byte[4096];
+- private final RandomAccessFile b; // PAIL dataFile
++ private final RandomAccessFile b; private RandomAccessFile getDataFile() { return this.b; } // Paper - OBFHELPER // PAIL dataFile
+ private final int[] c = new int[1024];
+ private final int[] d = new int[1024];
+ private final List<Boolean> e; // PAIL freeSectors
+@@ -59,10 +59,19 @@ public class RegionFile implements AutoCloseable {
+ this.e.set(1, false);
+ this.b.seek(0L);
+
++ // Paper Start
++ java.nio.ByteBuffer header = java.nio.ByteBuffer.allocate(8192);
++ while (header.hasRemaining()) {
++ if (this.getDataFile().getChannel().read(header) == -1) throw new java.io.EOFException();
++ }
++ ((java.nio.Buffer) header).clear();
++ java.nio.IntBuffer headerAsInts = header.asIntBuffer();
++ // Paper End
++
+ int k;
+
+ for (j = 0; j < 1024; ++j) {
+- k = this.b.readInt();
++ k = headerAsInts.get(); // Paper
+ this.c[j] = k;
+ // Spigot start
+ int length = k & 255;
+@@ -88,7 +97,7 @@ public class RegionFile implements AutoCloseable {
+ }
+
+ for (j = 0; j < 1024; ++j) {
+- k = this.b.readInt();
++ k = headerAsInts.get(); // Paper
+ this.d[j] = k;
+ }
+
+--
+2.22.0
+
diff --git a/removed/0081-Do-not-load-chunks-for-light-checks.patch b/removed/0081-Do-not-load-chunks-for-light-checks.patch
new file mode 100644
index 0000000000..0e35a24e0a
--- /dev/null
+++ b/removed/0081-Do-not-load-chunks-for-light-checks.patch
@@ -0,0 +1,23 @@
+From 317532f24f529ff717533f65beadc821a7a62bc7 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Thu, 31 Mar 2016 19:17:58 -0400
+Subject: [PATCH] Do not load chunks for light checks
+
+Should only happen for blocks on the edge that uses neighbors light level
+(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from.
+
+diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
+index 1ffa8b42b..35fb686d8 100644
+--- a/src/main/java/net/minecraft/server/World.java
++++ b/src/main/java/net/minecraft/server/World.java
+@@ -592,6 +592,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
+ if (blockposition.getY() >= 256) {
+ blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
+ }
++ if (!this.isLoaded(blockposition)) return 0; // Paper
+
+ return this.getChunkAtWorldCoords(blockposition).a(blockposition, i);
+ }
+--
+2.22.0
+