geforkt von Mirrors/FastAsyncWorldEdit
Adding a try-catch for some edge scenario Fawe failing to grab Mojang assets
Dieser Commit ist enthalten in:
Ursprung
d224d6ea32
Commit
51487135bb
@ -36,6 +36,7 @@ import java.net.URL;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.security.AccessControlException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -353,6 +354,7 @@ public class TextureUtil implements TextureHolder {
|
|||||||
public TextureUtil(File folder) throws FileNotFoundException {
|
public TextureUtil(File folder) throws FileNotFoundException {
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
if (!folder.exists()) {
|
if (!folder.exists()) {
|
||||||
|
try {
|
||||||
log.info("Downloading asset jar from Mojang, please wait...");
|
log.info("Downloading asset jar from Mojang, please wait...");
|
||||||
new File(Fawe.imp().getDirectory() + "/" + Settings.IMP.PATHS.TEXTURES + "/" + "/.minecraft/versions/").mkdirs();
|
new File(Fawe.imp().getDirectory() + "/" + Settings.IMP.PATHS.TEXTURES + "/" + "/.minecraft/versions/").mkdirs();
|
||||||
try (BufferedInputStream in = new BufferedInputStream(new URL("https://launcher.mojang.com/v1/objects/37fd3c903861eeff3bc24b71eed48f828b5269c8/client.jar").openStream());
|
try (BufferedInputStream in = new BufferedInputStream(new URL("https://launcher.mojang.com/v1/objects/37fd3c903861eeff3bc24b71eed48f828b5269c8/client.jar").openStream());
|
||||||
@ -364,9 +366,14 @@ public class TextureUtil implements TextureHolder {
|
|||||||
}
|
}
|
||||||
log.info("Asset jar down has been downloaded successfully.");
|
log.info("Asset jar down has been downloaded successfully.");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar or mods in it.");
|
log.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar in it.");
|
||||||
log.error("If the file exists, please make sure the server has read access to the directory.");
|
log.error("If the file exists, please make sure the server has read access to the directory.");
|
||||||
}
|
}
|
||||||
|
} catch (AccessControlException e) {
|
||||||
|
log.error("Could not download asset jar. It's likely your file permission are setup improperly and do not allow fetching data from the Mojang servers.");
|
||||||
|
log.error("Please create the following folder manually: `FastAsyncWorldEdit/textures` with `.minecraft/versions` jar in it.");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren