Skip to content

Commit

Permalink
feat: add litematica error when failing to load schematic (#2850)
Browse files Browse the repository at this point in the history
* feat: add litematica error when failing to load schematic

* Adjust
  • Loading branch information
dordsor21 authored Jul 27, 2024
1 parent dac7cdb commit 6fb0102
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public Clipboard read(UUID uuid, Function<BlockVector3, Clipboard> createOutput)
throw new IOException("This schematic version is not supported; Version: " + version
+ ", DataVersion: " + dataVersion + ". It's very likely your schematic has an invalid file extension," +
" if the schematic has been created on a version lower than 1.13.2, the extension MUST be `.schematic`," +
" elsewise the schematic can't be read properly.");
" elsewise the schematic can't be read properly. If you are using a litematica schematic, it is not supported!");
}

if (blocks != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ public void load(
} catch (URISyntaxException | IOException e) {
actor.print(Caption.of("worldedit.schematic.file-not-exist", TextComponent.of(Objects.toString(e.getMessage()))));
LOGGER.warn("Failed to load a saved clipboard", e);
} catch (Exception e) {
actor.print(Caption.of("fawe.worldedit.schematic.schematic.load-failure", TextComponent.of(e.getMessage())));
LOGGER.error("Error loading a schematic", e);
} finally {
if (in != null) {
try {
Expand Down
4 changes: 2 additions & 2 deletions worldedit-core/src/main/resources/lang/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"fawe.worldedit.schematic.schematic.loaded": "{0} loaded. Paste it with //paste",
"fawe.worldedit.schematic.schematic.saved": "{0} saved.",
"fawe.worldedit.schematic.schematic.none": "No files found.",
"fawe.worldedit.schematic.schematic.load-failure": "File could not be read or it does not exist: {0}. If you are specifying a format, you may not be specifying the correct one. Sponge schematic v2 and v3 both use the .schem file extension. To allow FAWE to select the format, do not specify one.",
"fawe.worldedit.schematic.schematic.load-failure": "File could not be read or it does not exist: {0}. If you are specifying a format, you may not be specifying the correct one. Sponge schematic v2 and v3 both use the .schem file extension. To allow FAWE to select the format, do not specify one. If you are using a litematica schematic, it is not supported!",
"fawe.worldedit.clipboard.clipboard.uri.not.found": "You do not have {0} loaded",
"fawe.worldedit.clipboard.clipboard.cleared": "Clipboard cleared",
"fawe.worldedit.clipboard.clipboard.invalid.format": "Unknown clipboard format: {0}",
Expand Down Expand Up @@ -360,7 +360,7 @@
"worldedit.schematic.unknown-format": "Unknown schematic format: {0}.",
"worldedit.schematic.load.does-not-exist": "Schematic {0} does not exist!",
"worldedit.schematic.load.loading": "(Please wait... loading schematic.)",
"worldedit.schematic.load.unsupported-version": "This schematic is not supported. Version: {0}.",
"worldedit.schematic.load.unsupported-version": "This schematic is not supported. Version: {0}. If you are using a litematica schematic, it is not supported!",
"worldedit.schematic.save.already-exists": "That schematic already exists. Use the -f flag to overwrite it.",
"worldedit.schematic.save.failed-directory": "Could not create folder for schematics!",
"worldedit.schematic.save.saving": "(Please wait... saving schematic.)",
Expand Down

0 comments on commit 6fb0102

Please sign in to comment.