Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lDEVinux
GitHub Repository: lDEVinux/eaglercraft
Path: blob/main/sp-server/src_aux/AnvilSaveHandler.java
8641 views
1
package net.minecraft.src;
2
3
import java.io.File;
4
5
public class AnvilSaveHandler extends SaveHandler {
6
public AnvilSaveHandler(File par1File, String par2Str, boolean par3) {
7
super(par1File, par2Str, par3);
8
}
9
10
/**
11
* initializes and returns the chunk loader for the specified world provider
12
*/
13
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) {
14
File var2 = this.getWorldDirectory();
15
File var3;
16
17
if (par1WorldProvider instanceof WorldProviderHell) {
18
var3 = new File(var2, "DIM-1");
19
var3.mkdirs();
20
return new AnvilChunkLoader(var3);
21
} else if (par1WorldProvider instanceof WorldProviderEnd) {
22
var3 = new File(var2, "DIM1");
23
var3.mkdirs();
24
return new AnvilChunkLoader(var3);
25
} else {
26
return new AnvilChunkLoader(var2);
27
}
28
}
29
30
/**
31
* Saves the given World Info with the given NBTTagCompound as the Player.
32
*/
33
public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) {
34
par1WorldInfo.setSaveVersion(19133);
35
super.saveWorldInfoWithPlayer(par1WorldInfo, par2NBTTagCompound);
36
}
37
38
/**
39
* Called to flush all changes to disk, waiting for them to complete.
40
*/
41
public void flush() {
42
try {
43
ThreadedFileIOBase.threadedIOInstance.waitForFinish();
44
} catch (InterruptedException var2) {
45
var2.printStackTrace();
46
}
47
48
RegionFileCache.clearRegionFileReferences();
49
}
50
}
51
52