2424import com .fastasyncworldedit .core .event .extent .ActorSaveClipboardEvent ;
2525import com .fastasyncworldedit .core .extent .clipboard .MultiClipboardHolder ;
2626import com .fastasyncworldedit .core .extent .clipboard .URIClipboardHolder ;
27+ import com .fastasyncworldedit .core .internal .exception .FaweException ;
2728import com .fastasyncworldedit .core .math .transform .MutatingOperationTransformHolder ;
2829import com .fastasyncworldedit .core .util .MainUtil ;
2930import com .google .common .collect .Multimap ;
@@ -576,15 +577,20 @@ public void save(
576577 ClipboardHolder holder = session .getClipboard ();
577578
578579 SchematicSaveTask task = new SchematicSaveTask (actor , f , dir , format , holder , overwrite );
579- AsyncCommandBuilder .wrap (task , actor )
580- .registerWithSupervisor (worldEdit .getSupervisor (), "Saving schematic " + filename )
581- .setDelayMessage (Caption .of ("worldedit.schematic.save.saving" ))
582- .onSuccess (Caption .of ("fawe.worldedit.schematic.schematic.saved" , filename , (overwrite ? Caption .of ("fawe.worldedit.schematic.schematic.overwritten" ) : "." )), null )
583- .onFailure (
584- Caption .of ("worldedit.schematic.failed-to-save" ),
585- worldEdit .getPlatformManager ().getPlatformCommandManager ().getExceptionConverter ()
586- )
587- .buildAndExec (worldEdit .getExecutorService ());
580+ AsyncCommandBuilder
581+ .wrap (task , actor )
582+ .registerWithSupervisor (worldEdit .getSupervisor (), "Saving schematic " + filename )
583+ .setDelayMessage (Caption .of ("worldedit.schematic.save.saving" ))
584+ .onSuccess (
585+ overwrite
586+ ? Caption .of ("fawe.worldedit.schematic.schematic.overwritten" )
587+ : Caption .of ("fawe.worldedit.schematic.schematic.saved" , filename ), null
588+ )
589+ .onFailure (
590+ Caption .of ("worldedit.schematic.failed-to-save" ),
591+ worldEdit .getPlatformManager ().getPlatformCommandManager ().getExceptionConverter ()
592+ )
593+ .buildAndExec (worldEdit .getExecutorService ());
588594 }
589595
590596 @ Command (
@@ -1002,9 +1008,7 @@ public Void call() throws Exception {
10021008
10031009 if (numFiles >= limit ) {
10041010 LOGGER .info (actor .getName () + " failed to save " + file .getCanonicalPath () + " - too many schematics!" );
1005- actor .print (Caption .of ("fawe.error.schematic.over.count.limit" , numFiles , limit ).color (TextColor .RED ));
1006- throw new WorldEditException (Caption .of ("fawe.error.schematic.over.limit" , numFiles , limit )) {
1007- };
1011+ throw new FaweException (Caption .of ("fawe.error.schematic.over.limit" , numFiles , limit ));
10081012 }
10091013 }
10101014 //FAWE end
@@ -1043,10 +1047,12 @@ public Void call() throws Exception {
10431047
10441048 if ((curKb ) > allocatedKb ) {
10451049 file .delete ();
1046- actor .print (Caption .of ("fawe.error.schematic.over.disk.limit" , String .format ("%.1f" , curKb ), String .format ("%dkb" , allocatedKb )).color (TextColor .RED ));
10471050 LOGGER .info (actor .getName () + " failed to save " + SCHEMATIC_NAME + " - not enough space!" );
1048- throw new WorldEditException (Caption .of ("fawe.error.schematic.over.disk.limit" , String .format ("%.1f" , curKb ), String .format ("%dkb" , allocatedKb ))) {
1049- };
1051+ throw new FaweException (Caption .of (
1052+ "fawe.error.schematic.over.disk.limit" ,
1053+ String .format ("%.1f" , curKb ),
1054+ String .format ("%dkb" , allocatedKb )
1055+ ));
10501056 }
10511057 if (overwrite ) {
10521058 new File (curFilepath ).delete ();
@@ -1059,7 +1065,6 @@ public Void call() throws Exception {
10591065 }
10601066
10611067 if (Settings .settings ().PATHS .PER_PLAYER_SCHEMATICS && actor .getLimit ().SCHEM_FILE_NUM_LIMIT > -1 ) {
1062-
10631068 actor .print (Caption .of ("fawe.worldedit.schematic.schematic.slots.free" , (actor .getLimit ().SCHEM_FILE_NUM_LIMIT - numFiles )));
10641069 }
10651070 LOGGER .info (actor .getName () + " saved " + file .getCanonicalPath ());
0 commit comments