Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-17 00:20:09 +01:00
fix: correctly resolve file if extension is given (#2857)
* fix: correctly resolve file if extension is given * Adjust error if ClipboardFormats#findByFile null
Dieser Commit ist enthalten in:
Ursprung
638344d815
Commit
f93ad596c6
@ -712,6 +712,12 @@ public class MainUtil {
|
|||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (filename.matches(".*\\.[\\w].*")) {
|
||||||
|
File file = MainUtil.resolveRelative(new File(dir, filename));
|
||||||
|
if (file.exists()) {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (ClipboardFormat f : ClipboardFormats.getAll()) {
|
for (ClipboardFormat f : ClipboardFormats.getAll()) {
|
||||||
File file = MainUtil.resolveRelative(new File(dir, filename + "." + f.getPrimaryFileExtension()));
|
File file = MainUtil.resolveRelative(new File(dir, filename + "." + f.getPrimaryFileExtension()));
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
|
@ -401,7 +401,11 @@ public class SchematicCommands {
|
|||||||
if (format == null) {
|
if (format == null) {
|
||||||
format = ClipboardFormats.findByFile(file);
|
format = ClipboardFormats.findByFile(file);
|
||||||
if (format == null) {
|
if (format == null) {
|
||||||
|
if (noExplicitFormat) {
|
||||||
|
actor.print(Caption.of("fawe.worldedit.schematic.schematic.load-failure", TextComponent.of(file.getName())));
|
||||||
|
} else {
|
||||||
actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,6 @@ public class ClipboardFormats {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MultiClipboardHolder loadAllFromInput(
|
public static MultiClipboardHolder loadAllFromInput(
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren