MCPcopy Create free account
hub / github.com/FabricMC/Matcher / getFormat

Method getFormat

src/main/java/matcher/gui/menu/FileMenu.java:313–328  ·  view source on GitHub ↗
(Path file)

Source from the content-addressed store, hash-verified

311 }
312
313 private static MappingFormat getFormat(Path file) {
314 if (Files.isDirectory(file)) return MappingFormat.ENIGMA_DIR;
315
316 String name = file.getFileName().toString().toLowerCase(Locale.ENGLISH);
317
318 for (MappingFormat format : MappingFormat.values()) {
319 if (format.hasSingleFile()
320 && name.endsWith(format.fileExt)
321 && name.length() > format.fileExt.length()
322 && name.charAt(name.length() - 1 - format.fileExt.length()) == '.') {
323 return format;
324 }
325 }
326
327 return null;
328 }
329
330 private static MappingFormat getFormat(String selectedName) {
331 for (MappingFormat format : MappingFormat.values()) {

Callers 2

loadMappingsMethod · 0.95
saveMappingsMethod · 0.95

Calls 2

toStringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected