@@ -63,16 +63,16 @@ void onCommand(MVCommandIssuer issuer, World world) {
6363 continue ;
6464 }
6565 UUID playerUUID = UUID .fromString (Files .getNameWithoutExtension (playerDataFile .getName ()));
66- Try < ProfileData > profileData = playerDataExtractor .extract (playerDataFile .toPath ());
67- playerDataFutures .add (profileDataSource
68- .getGlobalProfile (GlobalProfileKey .of (playerUUID ))
69- .thenCompose (profileDataSource ::updateGlobalProfile )
70- .thenCompose (ignore -> profileDataSource .getPlayerProfile (
71- ProfileKey .of (ContainerType .WORLD , world .getName (), ProfileTypes .getDefault (), playerUUID )))
72- .thenCompose (playerProfile -> {
73- playerProfile .update (profileData . get () );
74- return profileDataSource .updatePlayerProfile (playerProfile );
75- } ));
66+ playerDataExtractor .extract (playerDataFile .toPath ())
67+ . onSuccess ( profileData -> playerDataFutures .add (profileDataSource
68+ .getGlobalProfile (GlobalProfileKey .of (playerUUID ))
69+ .thenCompose (profileDataSource ::updateGlobalProfile )
70+ .thenCompose (ignore -> profileDataSource .getPlayerProfile (
71+ ProfileKey .of (ContainerType .WORLD , world .getName (), ProfileTypes .getDefault (), playerUUID )))
72+ .thenCompose (playerProfile -> {
73+ playerProfile .update (profileData );
74+ return profileDataSource .updatePlayerProfile (playerProfile );
75+ }) ));
7676 }
7777 CompletableFuture .allOf (playerDataFutures .toArray (new CompletableFuture [0 ]))
7878 .thenRun (() -> issuer .sendMessage ("Successfully imported all player data from " + world .getName () + "." ));
0 commit comments