File tree Expand file tree Collapse file tree
de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,9 +66,11 @@ public Object execute(ModelManager modelManager) throws IOException {
6666
6767 injectMapData (gui , targetMap , result );
6868
69- //noinspection EmptyTryBlock
70- try (MpqEditor ignored = MpqEditorFactory .getEditor (targetMap )) {
71- // Just finalization
69+ gui .sendProgress ("Finalizing map" );
70+
71+ MpqEditor mpq = MpqEditorFactory .getEditor (targetMap );
72+ if (mpq != null ) {
73+ mpq .closeWithCompression ();
7274 }
7375
7476 gui .sendProgress ("Done." );
Original file line number Diff line number Diff line change @@ -69,4 +69,13 @@ public void setKeepHeaderOffset(boolean flag) {
6969 editor .setKeepHeaderOffset (flag );
7070 }
7171
72+ @ Override
73+ public void closeWithCompression () throws IOException {
74+ try {
75+ editor .close (true , false , true );
76+ } catch (JMpqException e ) {
77+ throw new IOException (e );
78+ }
79+ }
80+
7281}
Original file line number Diff line number Diff line change 22
33import java .io .Closeable ;
44import java .io .File ;
5+ import java .io .IOException ;
56
67public interface MpqEditor extends Closeable {
78
@@ -18,4 +19,6 @@ public interface MpqEditor extends Closeable {
1819 boolean hasFile (String fileName ) throws Exception ;
1920
2021 void setKeepHeaderOffset (boolean flag );
22+
23+ void closeWithCompression () throws IOException ;
2124}
You can’t perform that action at this time.
0 commit comments