Backportat latest changes from master
This commit is contained in:
parent
9183293329
commit
53911dfe91
63 changed files with 1002 additions and 351 deletions
|
@ -32,6 +32,7 @@ import ru.bclib.util.Logger;
|
|||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.EOFException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -570,6 +571,9 @@ public class DataFixerAPI {
|
|||
private static List<File> getAllPlayers(File dir) {
|
||||
List<File> list = new ArrayList<>();
|
||||
dir = new File(dir, "playerdata");
|
||||
if (!dir.exists() || !dir.isDirectory()) {
|
||||
return list;
|
||||
}
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.isFile() && file.getName().endsWith(".dat")) {
|
||||
list.add(file);
|
||||
|
@ -604,7 +608,7 @@ public class DataFixerAPI {
|
|||
private static CompoundTag readNbt(File file) throws IOException {
|
||||
try {
|
||||
return NbtIo.readCompressed(file);
|
||||
} catch (ZipException e){
|
||||
} catch (ZipException | EOFException e){
|
||||
return NbtIo.read(file);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue