9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2026-01-06 15:51:30 +00:00

switch to lz4 block compression

This commit is contained in:
CrazyDev22
2023-12-22 16:13:57 +01:00
parent 4f888f16bc
commit a28df78792
2 changed files with 5 additions and 4 deletions

View File

@@ -110,7 +110,7 @@ public class Mantle {
* @return the file
*/
public static File fileForRegion(File folder, Long key) {
File f = new File(folder, "p." + key + ".ttp.lz4");
File f = new File(folder, "p." + key + ".ttp.lz4b");
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
@@ -552,7 +552,7 @@ public class Mantle {
File file = fileForRegion(dataFolder, x, z);
if (!file.exists())
file = new File(dataFolder, file.getName().substring(".lz4".length()));
file = new File(dataFolder, file.getName().substring(".lz4b".length()));
if (file.exists()) {
try {

View File

@@ -27,6 +27,7 @@ import com.volmit.iris.util.format.Form;
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import lombok.Getter;
import net.jpountz.lz4.LZ4BlockInputStream;
import net.jpountz.lz4.LZ4BlockOutputStream;
import net.jpountz.lz4.LZ4FrameInputStream;
import net.jpountz.lz4.LZ4FrameOutputStream;
@@ -87,7 +88,7 @@ public class TectonicPlate {
GZIPInputStream gzi = new GZIPInputStream(fin);
din = new DataInputStream(gzi);
} else {
LZ4FrameInputStream lz4 = new LZ4FrameInputStream(fin);
LZ4BlockInputStream lz4 = new LZ4BlockInputStream(fin);
din = new DataInputStream(lz4);
}
TectonicPlate p = new TectonicPlate(worldHeight, din);
@@ -178,7 +179,7 @@ public class TectonicPlate {
GZIPOutputStream gzo = new GZIPOutputStream(fos);
dos = new DataOutputStream(gzo);
} else {
LZ4FrameOutputStream lz4 = new LZ4FrameOutputStream(fos);
LZ4BlockOutputStream lz4 = new LZ4BlockOutputStream(fos);
dos = new DataOutputStream(lz4);
}
write(dos);