mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
fix try...catch segments not closing files in some cases
This commit is contained in:
@@ -79,17 +79,24 @@ public class ModRemapper {
|
||||
|
||||
TinyRemapper remapper = remapperBuilder.build();
|
||||
|
||||
OutputConsumerPath outputConsumer = null;
|
||||
try {
|
||||
OutputConsumerPath outputConsumer = new OutputConsumerPath(modJarOutputPath);
|
||||
outputConsumer = new OutputConsumerPath(modJarOutputPath);
|
||||
outputConsumer.addNonClassFiles(modJarPath);
|
||||
remapper.read(classpath);
|
||||
remapper.read(modJarPath);
|
||||
remapper.apply(modJarPath, outputConsumer);
|
||||
outputConsumer.finish();
|
||||
remapper.finish();
|
||||
} catch (Exception e){
|
||||
remapper.finish();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to remap JAR", e);
|
||||
} finally {
|
||||
if (outputConsumer != null) {
|
||||
try {
|
||||
outputConsumer.finish();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
remapper.finish();
|
||||
}
|
||||
|
||||
if (!modJarOutput.exists()){
|
||||
|
||||
Reference in New Issue
Block a user