Rename to CoreFlags

This commit is contained in:
benwoo1110 2021-03-05 14:16:08 +08:00
parent 51c642b71c
commit 650f2022b9
7 changed files with 30 additions and 32 deletions

View File

@ -19,7 +19,7 @@ import com.onarandombox.MultiverseCore.api.MultiverseCoreConfig;
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import com.onarandombox.MultiverseCore.destination.AnchorDestination;
import com.onarandombox.MultiverseCore.destination.BedDestination;
import com.onarandombox.MultiverseCore.destination.CannonDestination;
@ -220,7 +220,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.unsafeCallWrapper = new UnsafeCallWrapper(this);
// Setup our static classes
CompatibilityLayer.init();
MVFlags.setCoreInstance(this);
CoreFlags.setCoreInstance(this);
}

View File

@ -15,11 +15,10 @@ import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Flags;
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.commandtools.flags.FlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagResult;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -34,11 +33,11 @@ public class CreateCommand extends MultiverseCoreCommand {
public CreateCommand(MultiverseCore plugin) {
super(plugin);
this.setFlagGroup(FlagGroup.of(
MVFlags.WORLD_TYPE,
MVFlags.SEED,
MVFlags.GENERATOR,
MVFlags.GENERATE_STRUCTURES,
MVFlags.SPAWN_ADJUST
CoreFlags.WORLD_TYPE,
CoreFlags.SEED,
CoreFlags.GENERATOR,
CoreFlags.GENERATE_STRUCTURES,
CoreFlags.SPAWN_ADJUST
));
}
@ -72,11 +71,11 @@ public class CreateCommand extends MultiverseCoreCommand {
worldName,
environment,
// TODO API: Should Allow FlagResult object to be passed directly
flags.getValue(MVFlags.SEED),
flags.getValue(MVFlags.WORLD_TYPE),
flags.getValue(MVFlags.GENERATE_STRUCTURES),
flags.getValue(MVFlags.GENERATOR),
flags.getValue(MVFlags.SPAWN_ADJUST))
flags.getValue(CoreFlags.SEED),
flags.getValue(CoreFlags.WORLD_TYPE),
flags.getValue(CoreFlags.GENERATE_STRUCTURES),
flags.getValue(CoreFlags.GENERATOR),
flags.getValue(CoreFlags.SPAWN_ADJUST))
)
? String.format("%sComplete!", ChatColor.GREEN)
: String.format("%sFailed! See console for errors.", ChatColor.RED));

View File

@ -15,7 +15,7 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.commandtools.display.ColorAlternator;
import com.onarandombox.MultiverseCore.commandtools.display.ContentCreator;
import com.onarandombox.MultiverseCore.commandtools.display.inline.ListDisplay;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
@ -49,6 +49,6 @@ public class GeneratorCommand extends MultiverseCoreCommand {
}
private static ContentCreator<List<String>> getGeneratorContent() {
return () -> (List<String>) MVFlags.GENERATOR.suggestValue();
return () -> (List<String>) CoreFlags.GENERATOR.suggestValue();
}
}

View File

@ -17,7 +17,7 @@ import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagResult;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -31,7 +31,7 @@ public class ImportCommand extends MultiverseCoreCommand {
public ImportCommand(MultiverseCore plugin) {
super(plugin);
this.setFlagGroup(FlagGroup.of(MVFlags.GENERATOR, MVFlags.SPAWN_ADJUST));
this.setFlagGroup(FlagGroup.of(CoreFlags.GENERATOR, CoreFlags.SPAWN_ADJUST));
}
@Subcommand("import")
@ -63,8 +63,8 @@ public class ImportCommand extends MultiverseCoreCommand {
null,
null,
null,
flags.getValue(MVFlags.GENERATOR),
flags.getValue(MVFlags.SPAWN_ADJUST))
flags.getValue(CoreFlags.GENERATOR),
flags.getValue(CoreFlags.SPAWN_ADJUST))
)
? String.format("%sComplete!", ChatColor.GREEN)
: String.format("%sFailed! See console for more details.", ChatColor.RED));

View File

@ -18,7 +18,7 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagResult;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
@ -30,7 +30,7 @@ public class RegenCommand extends MultiverseCoreCommand {
public RegenCommand(MultiverseCore plugin) {
super(plugin);
this.setFlagGroup(FlagGroup.of(MVFlags.RANDOM_SEED));
this.setFlagGroup(FlagGroup.of(CoreFlags.RANDOM_SEED));
}
@Subcommand("regen")
@ -70,9 +70,9 @@ public class RegenCommand extends MultiverseCoreCommand {
//TODO: API should allow regen of unloaded worlds.
sender.sendMessage((this.plugin.getMVWorldManager().regenWorld(
world.getName(),
!flags.isDefaulted(MVFlags.RANDOM_SEED),
!flags.isByUserInput(MVFlags.RANDOM_SEED),
flags.getValue(MVFlags.RANDOM_SEED))
!flags.isDefaulted(CoreFlags.RANDOM_SEED),
!flags.isByUserInput(CoreFlags.RANDOM_SEED),
flags.getValue(CoreFlags.RANDOM_SEED))
)
? String.format("%sWorld Regenerated!", ChatColor.GREEN)
: String.format("%sWorld could not be regenerated!", ChatColor.RED));

View File

@ -16,7 +16,7 @@ import co.aikar.commands.annotation.Syntax;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagGroup;
import com.onarandombox.MultiverseCore.commandtools.flags.FlagResult;
import com.onarandombox.MultiverseCore.commandtools.flags.MVFlags;
import com.onarandombox.MultiverseCore.commandtools.flags.CoreFlags;
import com.onarandombox.MultiverseCore.event.MVVersionEvent;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteFailedException;
import com.onarandombox.MultiverseCore.utils.webpaste.PasteService;
@ -31,7 +31,6 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.Arrays;
@ -45,8 +44,8 @@ public class VersionCommand extends MultiverseCoreCommand {
public VersionCommand(MultiverseCore plugin) {
super(plugin);
this.setFlagGroup(FlagGroup.of(
MVFlags.PASTE_SERVICE_TYPE,
MVFlags.INCLUDE_PLUGIN_LIST
CoreFlags.PASTE_SERVICE_TYPE,
CoreFlags.INCLUDE_PLUGIN_LIST
));
}
@ -68,7 +67,7 @@ public class VersionCommand extends MultiverseCoreCommand {
this.addVersionInfoToEvent(versionEvent);
this.plugin.getServer().getPluginManager().callEvent(versionEvent);
if (flags.getValue(MVFlags.INCLUDE_PLUGIN_LIST)) {
if (flags.getValue(CoreFlags.INCLUDE_PLUGIN_LIST)) {
versionEvent.appendVersionInfo('\n' + "Plugins: " + getPluginList());
versionEvent.putDetailedVersionInfo("plugins.txt", "Plugins: " + getPluginList());
}
@ -80,7 +79,7 @@ public class VersionCommand extends MultiverseCoreCommand {
logToConsole(versionInfo);
PasteServiceType pasteType = flags.getValue(MVFlags.PASTE_SERVICE_TYPE);
PasteServiceType pasteType = flags.getValue(CoreFlags.PASTE_SERVICE_TYPE);
if (pasteType == PasteServiceType.NONE && !(sender instanceof ConsoleCommandSender)) {
sender.sendMessage("Version info dumped to console! Please check your server logs.");
return;

View File

@ -17,7 +17,7 @@ import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
public class MVFlags {
public class CoreFlags {
private static MultiverseCore multiverse;