mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-25 09:41:23 +01:00
Use .get() for world folder, since it should fail if null
This commit is contained in:
parent
481933b948
commit
a4a5be20f9
@ -558,8 +558,7 @@ public class WorldManager {
|
|||||||
|
|
||||||
private Attempt<CloneWorldOptions, CloneFailureReason> cloneWorldCopyFolder(
|
private Attempt<CloneWorldOptions, CloneFailureReason> cloneWorldCopyFolder(
|
||||||
@NotNull CloneWorldOptions options) {
|
@NotNull CloneWorldOptions options) {
|
||||||
// TODO: Check null?
|
File worldFolder = options.world().getBukkitWorld().map(World::getWorldFolder).get();
|
||||||
File worldFolder = options.world().getBukkitWorld().map(World::getWorldFolder).getOrNull();
|
|
||||||
File newWorldFolder = new File(Bukkit.getWorldContainer(), options.newWorldName());
|
File newWorldFolder = new File(Bukkit.getWorldContainer(), options.newWorldName());
|
||||||
return filesManipulator.copyFolder(worldFolder, newWorldFolder, CLONE_IGNORE_FILES).fold(
|
return filesManipulator.copyFolder(worldFolder, newWorldFolder, CLONE_IGNORE_FILES).fold(
|
||||||
exception -> worldActionResult(CloneFailureReason.COPY_FAILED,
|
exception -> worldActionResult(CloneFailureReason.COPY_FAILED,
|
||||||
|
Loading…
Reference in New Issue
Block a user