mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-09 06:50:32 +08:00
Fixed vanilla issue where chunks would be mislocated and corrupt. Big thanks to Wug for the fix.
This commit is contained in:
parent
72559fe634
commit
875219e28c
@ -67,8 +67,8 @@ public class ChunkLoader implements IChunkLoader {
|
||||
|
||||
if (!chunk.a(i, j)) {
|
||||
System.out.println("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.x + ", " + chunk.z + ")");
|
||||
nbttagcompound.setInt("xPos", i);
|
||||
nbttagcompound.setInt("zPos", j);
|
||||
nbttagcompound.getCompound("Level").setInt("xPos", i); // CraftBukkit - .getCompound("Level")
|
||||
nbttagcompound.getCompound("Level").setInt("zPos", j); // CraftBukkit - .getCompound("Level")
|
||||
chunk = a(world, nbttagcompound.getCompound("Level"));
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutput;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@ -58,8 +54,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
||||
if (!chunk.a(i, j)) {
|
||||
System.out.println("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.x + ", " + chunk.z + ")");
|
||||
nbttagcompound.setInt("xPos", i);
|
||||
nbttagcompound.setInt("zPos", j);
|
||||
nbttagcompound.getCompound("Level").setInt("xPos", i); // CraftBukkit - .getCompound("Level")
|
||||
nbttagcompound.getCompound("Level").setInt("zPos", j); // CraftBukkit - .getCompound("Level")
|
||||
chunk = ChunkLoader.a(world, nbttagcompound.getCompound("Level"));
|
||||
}
|
||||
|
||||
@ -126,7 +122,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void a(PendingChunkToSave pendingchunktosave) {
|
||||
public void a(PendingChunkToSave pendingchunktosave) throws IOException { // CraftBukkit - Added throws
|
||||
DataOutputStream dataoutputstream = RegionFileCache.c(this.d, pendingchunktosave.a.x, pendingchunktosave.a.z);
|
||||
|
||||
NBTCompressedStreamTools.a(pendingchunktosave.b, (DataOutput) dataoutputstream);
|
||||
|
Loading…
Reference in New Issue
Block a user