From d189ac1db34ff109bc5a2cbd31ff8fba10479e9e Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 19 May 2019 19:26:17 -0700 Subject: [PATCH] Fix RegionFileCache#hasRegionFile (#2062) also remove the pointless synchronization on RegionFileCache#getRegionFileName --- ...ide-option-to-use-a-versioned-world-folder-for-t.patch | 8 ++++---- .../0358-Allow-Saving-of-Oversized-Chunks.patch | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Spigot-Server-Patches/0272-Provide-option-to-use-a-versioned-world-folder-for-t.patch b/Spigot-Server-Patches/0272-Provide-option-to-use-a-versioned-world-folder-for-t.patch index 11a1ff3955..aabb9ad8de 100644 --- a/Spigot-Server-Patches/0272-Provide-option-to-use-a-versioned-world-folder-for-t.patch +++ b/Spigot-Server-Patches/0272-Provide-option-to-use-a-versioned-world-folder-for-t.patch @@ -1,4 +1,4 @@ -From 0c747969dc199cf6e1a914b30a64c294078e8749 Mon Sep 17 00:00:00 2001 +From cfb0efe00f65ee5d31eab9a11261f0481b22cdb1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 29 Jul 2018 15:48:50 -0400 Subject: [PATCH] Provide option to use a versioned world folder for testing @@ -59,7 +59,7 @@ index a9b71c85d5..8c3880c838 100644 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 6425b14f2c..990d34efde 100644 +index 6425b14f2c..74f102adf5 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -10,13 +10,41 @@ import java.io.IOException; @@ -116,12 +116,12 @@ index 6425b14f2c..990d34efde 100644 } } -+ public static synchronized File getRegionFileName(File file, int i, int j) { ++ public static File getRegionFileName(File file, int i, int j) { + File file1 = new File(file, "region"); + return new File(file1, "r." + (i >> 5) + "." + (j >> 5) + ".mca"); + } + public synchronized boolean hasRegionFile(File file, int i, int j) { -+ return cache.containsKey(getRegionFileName(file, i, j)); ++ return cache.containsKey(ChunkCoordIntPair.pair(i, j)); + } + // Paper End + diff --git a/Spigot-Server-Patches/0358-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0358-Allow-Saving-of-Oversized-Chunks.patch index 9f6a65556a..c5ee3209d4 100644 --- a/Spigot-Server-Patches/0358-Allow-Saving-of-Oversized-Chunks.patch +++ b/Spigot-Server-Patches/0358-Allow-Saving-of-Oversized-Chunks.patch @@ -1,4 +1,4 @@ -From b2b0e6b7957bca3f54f5c603b2afd5bb6bfe9ff9 Mon Sep 17 00:00:00 2001 +From 35fe71a17f9f7b03759a454071bab4271c10218e Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Feb 2019 01:08:19 -0500 Subject: [PATCH] Allow Saving of Oversized Chunks @@ -286,7 +286,7 @@ index e68f901943..ed2ccebb23 100644 + } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 990d34efde..b61864641c 100644 +index 74f102adf5..3f7190b6a2 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -47,6 +47,7 @@ public abstract class RegionFileCache implements AutoCloseable { @@ -299,7 +299,7 @@ index 990d34efde..b61864641c 100644 RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i); @@ -79,12 +80,151 @@ public abstract class RegionFileCache implements AutoCloseable { public synchronized boolean hasRegionFile(File file, int i, int j) { - return cache.containsKey(getRegionFileName(file, i, j)); + return cache.containsKey(ChunkCoordIntPair.pair(i, j)); } + // Paper start + private static void printOversizedLog(String msg, File file, int x, int z) {