mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-09 11:55:52 -04:00
Auto detect world and datapack's encoding
This commit is contained in:
parent
b7723a88c3
commit
fab5bdc2e1
@ -88,7 +88,7 @@ public class World {
|
||||
}
|
||||
|
||||
private void loadFromZip() throws IOException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(file)) {
|
||||
try (FileSystem fs = CompressingUtils.readonly(file).setAutoDetectEncoding(true).build()) {
|
||||
Path root = Files.list(fs.getPath("/")).filter(Files::isDirectory).findAny()
|
||||
.orElseThrow(() -> new IOException("Not a valid world zip file"));
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class Datapack {
|
||||
}
|
||||
|
||||
public void loadFromZip() throws IOException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(path)) {
|
||||
try (FileSystem fs = CompressingUtils.readonly(path).setAutoDetectEncoding(true).build()) {
|
||||
Path datapacks = fs.getPath("/datapacks/");
|
||||
Path mcmeta = fs.getPath("pack.mcmeta");
|
||||
if (Files.exists(datapacks)) { // multiple datapacks
|
||||
|
Loading…
x
Reference in New Issue
Block a user