File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/org/mvplugins/multiverse/inventories/dataimport/perworldinventory Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2222import org .jetbrains .annotations .Nullable ;
2323import org .mvplugins .multiverse .core .utils .ReflectHelper ;
2424import org .mvplugins .multiverse .core .world .WorldManager ;
25+ import org .mvplugins .multiverse .external .vavr .control .Try ;
2526import org .mvplugins .multiverse .inventories .config .InventoriesConfig ;
2627import org .mvplugins .multiverse .inventories .dataimport .DataImportException ;
2728import org .mvplugins .multiverse .inventories .profile .GlobalProfile ;
@@ -128,7 +129,11 @@ private void findPlayersWithData() throws DataImportException {
128129 }
129130 this .playerList = Arrays .stream (playerFolders )
130131 .filter (File ::isDirectory )
131- .map (file -> UUID .fromString (file .getName ()))
132+ .map (file -> Try .of (() -> UUID .fromString (file .getName ()))
133+ .onFailure (throwable -> Logging .warning ("Unable to convert %s to UUID: %s" ,
134+ file .getName (), throwable .getMessage ()))
135+ .getOrNull ())
136+ .filter (Objects ::nonNull )
132137 .map (Bukkit ::getOfflinePlayer )
133138 .toList ();
134139 }
You can’t perform that action at this time.
0 commit comments