add check

This commit is contained in:
wagyourtail 2021-07-06 15:59:06 -06:00
parent 2e98eee7e0
commit de42109771
No known key found for this signature in database
GPG Key ID: E6E3EB7DCD4EB017
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,6 @@ public class ProguardTask extends BaritoneGradleTask {
private void copyMcJar() throws IOException {
File mcClientJar = this.getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("launch").getRuntimeClasspath().getFiles()
.stream()
//this line will change when using official mappings in 1.17
.filter(f -> f.getName().startsWith("minecraft-"))
.map(f -> {
switch (compType) {
@ -104,6 +103,7 @@ public class ProguardTask extends BaritoneGradleTask {
})
.findFirst()
.get();
if (!mcClientJar.exists()) throw new IOException("Failed to find minecraft! " + mcClientJar.getAbsolutePath());
if (!copyMcTargetDir.exists() && !copyMcTargetDir.mkdirs()) throw new IOException("Failed to create target for copyMcJar");
Files.copy(mcClientJar.toPath(), copyMcTargetJar.toPath(), REPLACE_EXISTING);
}