Fix compile
This commit is contained in:
@@ -709,6 +709,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.folder = directory;
|
this.folder = directory;
|
||||||
this.sync = dsync;
|
this.sync = dsync;
|
||||||
this.info = storageKey;
|
this.info = storageKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Paper start
|
||||||
|
+ @Nullable
|
||||||
|
+ public static ChunkPos getRegionFileCoordinates(Path file) {
|
||||||
|
+ String fileName = file.getFileName().toString();
|
||||||
|
+ if (!fileName.startsWith("r.") || !fileName.endsWith(".mca")) {
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ String[] split = fileName.split("\\.");
|
||||||
|
+
|
||||||
|
+ if (split.length != 4) {
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ try {
|
||||||
|
+ int x = Integer.parseInt(split[1]);
|
||||||
|
+ int z = Integer.parseInt(split[2]);
|
||||||
|
+
|
||||||
|
+ return new ChunkPos(x << 5, z << 5);
|
||||||
|
+ } catch (NumberFormatException ex) {
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
+
|
||||||
|
// Paper start
|
||||||
|
public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) {
|
||||||
|
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
|
||||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
// Paper - only create directory if not existing only - moved down
|
// Paper - only create directory if not existing only - moved down
|
||||||
Path path = this.folder;
|
Path path = this.folder;
|
||||||
|
|||||||
Reference in New Issue
Block a user