Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /mv version #3056

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.mvplugins.multiverse.core.commands;

import co.aikar.commands.BukkitCommandIssuer;
import co.aikar.commands.MessageType;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Description;
import co.aikar.commands.annotation.Subcommand;
import jakarta.inject.Inject;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
import org.mvplugins.multiverse.core.MultiverseCore;

Check warning on line 12 in src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 'org.mvplugins.multiverse.core.MultiverseCore' should be separated from previous imports. Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java:12:1: warning: 'org.mvplugins.multiverse.core.MultiverseCore' should be separated from previous imports. (com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck)
import org.mvplugins.multiverse.core.commandtools.MVCommandManager;
import org.mvplugins.multiverse.core.commandtools.MultiverseCommand;
import org.mvplugins.multiverse.core.utils.MVCorei18n;

@Service
@CommandAlias("mv")
class VersionCommand extends MultiverseCommand {

private final MultiverseCore plugin;

@Inject
VersionCommand(@NotNull MVCommandManager commandManager, MultiverseCore plugin) {
super(commandManager);
this.plugin = plugin;
}

@Subcommand("version")
@CommandPermission("multiverse.core.version")
@Description("{@@mv-core.version.description}")
void versionCommand(BukkitCommandIssuer issuer) {
issuer.sendMessage(MessageType.INFO, MVCorei18n.VERSION_MV, "{version}", plugin.getDescription().getVersion());
issuer.sendMessage(MessageType.INFO, MVCorei18n.VERSION_AUTHORS, "{authors}", String.join(", ", plugin.getDescription().getAuthors()));

Check warning on line 34 in src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 Line is longer than 120 characters (found 143). Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java:34:0: warning: Line is longer than 120 characters (found 143). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
issuer.sendMessage(MessageType.INFO, MVCorei18n.VERSION_SECRETCODE); // An in joke I don't get...

Check warning on line 35 in src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 Don't use trailing comments. Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/VersionCommand.java:35:78: warning: Don't use trailing comments. (com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public enum MVCorei18n implements MessageKeyProvider {
UNLOAD_UNLOADING,
UNLOAD_SUCCESS,

// version command
VERSION_MV,
VERSION_AUTHORS,
VERSION_SECRETCODE,

// debug command
DEBUG_INFO_OFF,
DEBUG_INFO_ON,
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/multiverse-core_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
# /mv usage
mv-core.usage.description=Show Multiverse-Core command usage.

# /mv version
mv-core.version.description=Displays version and authors
mv-core.version.mv=Multiverse Core Version &fv{version}
mv-core.version.authors=Multiverse Core Authors &f{authors}

Check warning on line 145 in src/main/resources/multiverse-core_en.properties

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 Property key 'mv-core.version.authors' is not in the right order with previous property 'mv-core.version.mv'. Raw Output: /github/workspace/./src/main/resources/multiverse-core_en.properties:145:0: warning: Property key 'mv-core.version.authors' is not in the right order with previous property 'mv-core.version.mv'. (com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck)
mv-core.version.secretcode=Special Code: &fFRN002

# commands error
mv-core.commands.error.playersonly=&cThis command can only be used by players
mv-core.commands.error.multiverseworldonly=&cThis can only be used in multiverse worlds
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Multiverse-Core
main: org.mvplugins.multiverse.core.MultiverseCore
authors: ['dumptruckman', 'Rigby', 'fernferret', 'lithium3141', 'main--']
authors: ['dumptruckman', 'Rigby', 'fernferret', 'lithium3141', 'main--', 'benwoo1110', 'Zax71']
website: 'https://dev.bukkit.org/projects/multiverse-core'
softdepend: ['Vault', 'PlaceholderAPI']
api-version: 1.13
Expand Down