Use .get() for world folder, since it should fail if null

This commit is contained in:
Ben Woo 2023-09-11 15:49:27 +08:00
parent 481933b948
commit a4a5be20f9
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -558,8 +558,7 @@ public class WorldManager {
private Attempt<CloneWorldOptions, CloneFailureReason> cloneWorldCopyFolder(
@NotNull CloneWorldOptions options) {
// TODO: Check null?
File worldFolder = options.world().getBukkitWorld().map(World::getWorldFolder).getOrNull();
File worldFolder = options.world().getBukkitWorld().map(World::getWorldFolder).get();
File newWorldFolder = new File(Bukkit.getWorldContainer(), options.newWorldName());
return filesManipulator.copyFolder(worldFolder, newWorldFolder, CLONE_IGNORE_FILES).fold(
exception -> worldActionResult(CloneFailureReason.COPY_FAILED,