diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java index f28a3d48..a73b2d68 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java @@ -1,7 +1,6 @@ package com.onarandombox.MultiverseCore.commands; import co.aikar.commands.CommandIssuer; -import co.aikar.commands.InvalidCommandArgument; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; @@ -11,7 +10,6 @@ import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.MVCommandManager; import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand; import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlag; @@ -24,6 +22,7 @@ import com.onarandombox.MultiverseCore.utils.webpaste.PasteFailedException; import com.onarandombox.MultiverseCore.utils.webpaste.PasteService; import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceFactory; import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceType; +import com.onarandombox.MultiverseCore.worldnew.WorldManager; import jakarta.inject.Inject; import org.apache.commons.lang.StringUtils; import org.bukkit.scheduler.BukkitRunnable; @@ -35,9 +34,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; @@ -48,12 +44,12 @@ import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getServerProp public class DumpsCommand extends MultiverseCommand { private final MultiverseCore plugin; - private final MVWorldManager worldManager; + private final WorldManager worldManager; @Inject public DumpsCommand(@NotNull MVCommandManager commandManager, @NotNull MultiverseCore plugin, - @NotNull MVWorldManager worldManager) { + @NotNull WorldManager worldManager) { super(commandManager); this.plugin = plugin; this.worldManager = worldManager; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java index f7379f81..a38f1014 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java @@ -1,19 +1,13 @@ package com.onarandombox.MultiverseCore.commands; -import java.util.Arrays; -import java.util.stream.Collectors; - -import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; -import co.aikar.commands.annotation.Conditions; import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Optional; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.dumptruckman.minecraft.util.Logging; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.MVCommandIssuer; import com.onarandombox.MultiverseCore.commandtools.MVCommandManager; import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand; @@ -32,6 +26,9 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; +import java.util.Arrays; +import java.util.stream.Collectors; + @Service @CommandAlias("mv") public class ImportCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java index ce25e910..95a7a00e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/LoadCommand.java @@ -1,6 +1,5 @@ package com.onarandombox.MultiverseCore.commands; -import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; @@ -10,7 +9,6 @@ import co.aikar.commands.annotation.Single; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.dumptruckman.minecraft.util.Logging; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.MVCommandIssuer; import com.onarandombox.MultiverseCore.commandtools.MVCommandManager; import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandConditions.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandConditions.java index bb6bf694..11900d5c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandConditions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandConditions.java @@ -6,7 +6,6 @@ import co.aikar.commands.BukkitConditionContext; import co.aikar.commands.CommandConditions; import co.aikar.commands.ConditionContext; import co.aikar.commands.ConditionFailedException; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.world.WorldNameChecker; import com.onarandombox.MultiverseCore.worldnew.WorldManager; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java index d1c4992d..5ded1ccf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java @@ -1,7 +1,5 @@ package com.onarandombox.MultiverseCore.commandtools; -import java.util.List; - import co.aikar.commands.BukkitCommandCompletionContext; import co.aikar.commands.BukkitCommandExecutionContext; import co.aikar.commands.BukkitLocales; @@ -11,7 +9,6 @@ import co.aikar.commands.CommandHelp; import co.aikar.commands.HelpEntry; import co.aikar.commands.PaperCommandManager; import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.commandtools.flags.CommandFlagsManager; import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager; import com.onarandombox.MultiverseCore.worldnew.WorldManager; @@ -22,6 +19,8 @@ import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; +import java.util.List; + /** * Main class to manage permissions. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/MVWorld.java index 53c8adf7..fcf02547 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/MVWorld.java @@ -11,6 +11,7 @@ import io.vavr.control.Option; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; +import org.bukkit.WorldType; import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -103,9 +104,27 @@ public class MVWorld extends OfflineWorld { return Option.of(Bukkit.getWorld(worldUid)); } + public Option getWorldType() { + return getBukkitWorld().map(World::getWorldType); + } + + public Option canGenerateStructures() { + return getBukkitWorld().map(World::canGenerateStructures); + } + @Override void setWorldConfig(WorldConfig worldConfig) { super.setWorldConfig(worldConfig); setupWorldConfig(getBukkitWorld().get()); } + + @Override + public String toString() { + return "MVWorld{" + + "name='" + worldName + "', " + + "env='" + getEnvironment() + "', " + + "type='" + getWorldType().getOrNull() + "', " + + "gen='" + getGenerator() + "'" + + '}'; + } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/OfflineWorld.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/OfflineWorld.java index 63053379..08ee2024 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/OfflineWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/OfflineWorld.java @@ -292,4 +292,13 @@ public class OfflineWorld { void setWorldConfig(WorldConfig worldConfig) { this.worldConfig = worldConfig; } + + @Override + public String toString() { + return "OfflineWorld{" + + "name='" + worldName + "', " + + "env='" + getEnvironment() + "', " + + "gen='" + getGenerator() + "'" + + '}'; + } }