mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-10 18:28:28 +01:00
Dumps command use new wm and fix some imports
This commit is contained in:
parent
891f7ca136
commit
90eb1c882b
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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<WorldType> getWorldType() {
|
||||
return getBukkitWorld().map(World::getWorldType);
|
||||
}
|
||||
|
||||
public Option<Boolean> 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() + "'" +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -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() + "'" +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user