@@ -69,11 +69,7 @@ public void write(EntryTree<EntryMapping> mappings, Path path, ProgressListener
69
69
}
70
70
71
71
public void write (EntryTree <EntryMapping > mappings , MappingDelta <EntryMapping > delta , Path path , ProgressListener progressListener , MappingSaveParameters saveParameters ) {
72
- if (!hasMappingIoWriter || !useMappingIo ()) {
73
- if (writer == null ) {
74
- throw new IllegalStateException (name () + " does not support writing" );
75
- }
76
-
72
+ if (!hasMappingIoWriter || (!useMappingIo () && writer != null )) {
77
73
writer .write (mappings , usedMappingIoWriterLast ? MappingDelta .added (mappings ) : delta , path , progressListener , saveParameters );
78
74
usedMappingIoWriterLast = false ;
79
75
return ;
@@ -107,11 +103,7 @@ public EntryTree<EntryMapping> read(Path path, ProgressListener progressListener
107
103
}
108
104
109
105
public EntryTree <EntryMapping > read (Path path , ProgressListener progressListener , MappingSaveParameters saveParameters , JarIndex index ) throws IOException , MappingParseException {
110
- if (!useMappingIo ()) {
111
- if (reader == null ) {
112
- throw new IllegalStateException (name () + " does not support reading" );
113
- }
114
-
106
+ if (mappingIoCounterpart == null || (!useMappingIo () && reader != null )) {
115
107
return reader .read (path , progressListener , saveParameters );
116
108
}
117
109
@@ -180,9 +172,7 @@ public boolean isWritable() {
180
172
return writer != null || hasMappingIoWriter ;
181
173
}
182
174
183
- @ ApiStatus .Internal
184
175
private boolean useMappingIo () {
185
- if (mappingIoCounterpart == null ) return false ;
186
176
return System .getProperty ("enigma.use_mappingio" , "true" ).equals ("true" );
187
177
}
188
178
0 commit comments