Skip to content

Commit

Permalink
Merge branch 'hotfix-1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamierocks committed Feb 9, 2018
2 parents 21a6694 + 85c3a68 commit 8cc0eea
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ gradle-app.setting
!test.jar

#################
## Git submodules
## Nocturne
#################
FernFlower/
run/
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defaultTasks 'clean', 'licenseFormat', 'build'
// Project information
allprojects {
group = 'blue.lapis.nocturne'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import blue.lapis.nocturne.mapping.MappingContext;
import blue.lapis.nocturne.mapping.io.reader.MappingReaderType;
import blue.lapis.nocturne.mapping.io.reader.MappingsReader;
import blue.lapis.nocturne.mapping.io.writer.MappingWriterType;
import blue.lapis.nocturne.util.helper.PropertiesHelper;

import javafx.stage.FileChooser;

import java.io.BufferedReader;
Expand Down Expand Up @@ -90,6 +90,7 @@ public static void openMappings(boolean merge) throws IOException {
}

Main.setCurrentMappingsPath(selectedPath);
Main.setCurrentWriterType(MappingWriterType.fromFormatType(type.getFormatType()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public enum MappingReaderType {

private final MappingFormatType type;

public static final Map<FileChooser.ExtensionFilter, MappingReaderType> filterToType = Maps.newHashMap();
private static final Map<FileChooser.ExtensionFilter, MappingReaderType> filterToType = Maps.newHashMap();
private static final Map<MappingFormatType, MappingReaderType> formatToType = Maps.newHashMap();

static {
Arrays.asList(values()).forEach(t -> filterToType.put(t.getExtensionFilter(), t));
Arrays.asList(values()).forEach(t -> formatToType.put(t.getFormatType(), t));
}

private final FileChooser.ExtensionFilter extensionFilter;
Expand Down Expand Up @@ -86,4 +88,8 @@ public MappingsReader constructReader(BufferedReader reader) {
public static MappingReaderType fromExtensionFilter(FileChooser.ExtensionFilter filter) {
return filterToType.get(filter);
}

public static MappingReaderType fromFormatType(final MappingFormatType formatType) {
return formatToType.get(formatType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import blue.lapis.nocturne.Main;
import blue.lapis.nocturne.mapping.io.MappingFormatType;

import com.google.common.collect.Maps;
import javafx.stage.FileChooser;

Expand All @@ -46,9 +45,11 @@ public enum MappingWriterType {
private final MappingFormatType type;

private static final Map<FileChooser.ExtensionFilter, MappingWriterType> filterToType = Maps.newHashMap();
private static final Map<MappingFormatType, MappingWriterType> formatToType = Maps.newHashMap();

static {
Arrays.asList(values()).forEach(t -> filterToType.put(t.getExtensionFilter(), t));
Arrays.asList(values()).forEach(t -> formatToType.put(t.getFormatType(), t));
}

private final FileChooser.ExtensionFilter extensionFilter;
Expand Down Expand Up @@ -86,4 +87,8 @@ public MappingsWriter constructWriter(PrintWriter writer) {
public static MappingWriterType fromExtensionFilter(FileChooser.ExtensionFilter filter) {
return filterToType.get(filter);
}

public static MappingWriterType fromFormatType(final MappingFormatType formatType) {
return formatToType.get(formatType);
}
}

0 comments on commit 8cc0eea

Please sign in to comment.