<commit_before>/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.world.commands;

import com.google.common.collect.Lists;
import io.github.nucleuspowered.nucleus.Util;
import io.github.nucleuspowered.nucleus.argumentparsers.NucleusWorldPropertiesArgument;
import io.github.nucleuspowered.nucleus.internal.annotations.Permissions;
import io.github.nucleuspowered.nucleus.internal.annotations.RegisterCommand;
import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.args.CommandElement;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.world.storage.WorldProperties;

import java.util.List;

@Permissions(prefix = "world", mainOverride = "list")
@RegisterCommand(value = "info", subcommandOf = WorldCommand.class)
public class InfoWorldCommand extends AbstractCommand<CommandSource> {

    private final String worldKey = "world";

    @Override public CommandElement[] getArguments() {
        return new CommandElement[] {
            new NucleusWorldPropertiesArgument(Text.of(worldKey), NucleusWorldPropertiesArgument.Type.ALL)
        };
    }

    @Override protected CommandResult executeCommand(CommandSource src, CommandContext args) throws Exception {
        WorldProperties wp = getWorldPropertiesOrDefault(src, worldKey, args);
        final List<Text> listContent = Lists.newArrayList();
        final boolean canSeeSeeds = permissions.testSuffix(src, "seed");
        ListWorldCommand.getWorldInfo(listContent, wp, canSeeSeeds);
        Util.getPaginationBuilder(src)
            .contents(listContent).title(plugin.getMessageProvider().getTextMessageWithFormat("command.world.info.title", wp.getWorldName()))
            .sendTo(src);

        return CommandResult.success();
    }
}
<commit_msg>/world info defaults to your current world.<commit_after>/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.world.commands;

import com.google.common.collect.Lists;
import io.github.nucleuspowered.nucleus.Util;
import io.github.nucleuspowered.nucleus.argumentparsers.NucleusWorldPropertiesArgument;
import io.github.nucleuspowered.nucleus.internal.annotations.Permissions;
import io.github.nucleuspowered.nucleus.internal.annotations.RegisterCommand;
import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.args.CommandElement;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.world.storage.WorldProperties;

import java.util.List;

@Permissions(prefix = "world", mainOverride = "list")
@RegisterCommand(value = "info", subcommandOf = WorldCommand.class)
public class InfoWorldCommand extends AbstractCommand<CommandSource> {

    private final String worldKey = "world";

    @Override public CommandElement[] getArguments() {
        return new CommandElement[] {
            new NucleusWorldPropertiesArgument(Text.of(worldKey), NucleusWorldPropertiesArgument.Type.ALL)
        };
    }

    @Override protected CommandResult executeCommand(CommandSource src, CommandContext args) throws Exception {
        WorldProperties wp = getWorldFromUserOrArgs(src, worldKey, args);
        final List<Text> listContent = Lists.newArrayList();
        final boolean canSeeSeeds = permissions.testSuffix(src, "seed");
        ListWorldCommand.getWorldInfo(listContent, wp, canSeeSeeds);
        Util.getPaginationBuilder(src)
            .contents(listContent).title(plugin.getMessageProvider().getTextMessageWithFormat("command.world.info.title", wp.getWorldName()))
            .sendTo(src);

        return CommandResult.success();
    }
}

{'fraction_non_alphanumeric': 0.09855484482350153, 'fraction_numerical': 0.0, 'mean_word_length': 4.921458625525947, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '22312', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1127, 'n_words': 234}