Skip to content

Commit 50545ee

Browse files
committed
Rename import command to migrate command
1 parent e0b73cb commit 50545ee

3 files changed

Lines changed: 20 additions & 22 deletions

File tree

src/main/java/org/mvplugins/multiverse/inventories/commands/ImportCommand.java renamed to src/main/java/org/mvplugins/multiverse/inventories/commands/MigrateCommand.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import org.jetbrains.annotations.NotNull;
44
import org.jvnet.hk2.annotations.Service;
55
import org.mvplugins.multiverse.core.command.MVCommandIssuer;
6-
import org.mvplugins.multiverse.core.command.MVCommandManager;
76
import org.mvplugins.multiverse.core.command.queue.CommandQueueManager;
87
import org.mvplugins.multiverse.core.command.queue.CommandQueuePayload;
98
import org.mvplugins.multiverse.core.locale.message.Message;
10-
import org.mvplugins.multiverse.external.acf.commands.annotation.CommandAlias;
119
import org.mvplugins.multiverse.external.acf.commands.annotation.CommandCompletion;
1210
import org.mvplugins.multiverse.external.acf.commands.annotation.CommandPermission;
1311
import org.mvplugins.multiverse.external.acf.commands.annotation.Description;
@@ -22,50 +20,50 @@
2220
import static org.mvplugins.multiverse.core.locale.message.MessageReplacement.replace;
2321

2422
@Service
25-
final class ImportCommand extends InventoriesCommand {
23+
final class MigrateCommand extends InventoriesCommand {
2624

2725
private final DataImportManager dataImportManager;
2826
private final CommandQueueManager commandQueueManager;
2927

3028
@Inject
31-
ImportCommand(
29+
MigrateCommand(
3230
@NotNull DataImportManager dataImportManager,
3331
@NotNull CommandQueueManager commandQueueManager
3432
) {
3533
this.dataImportManager = dataImportManager;
3634
this.commandQueueManager = commandQueueManager;
3735
}
3836

39-
@Subcommand("import")
37+
@Subcommand("migrate")
4038
@Syntax("<MultiInv|WorldInventories|PerWorldInventory>")
4139
@CommandPermission("multiverse.inventories.import")
4240
@CommandCompletion("@dataimporters")
4341
@Description("Import inventories from MultiInv/WorldInventories/PerWorldInventory plugin.")
44-
void onImportCommand(
42+
void onMigrateCommand(
4543
MVCommandIssuer issuer,
4644

4745
@Single
4846
@Syntax("<MultiInv|WorldInventories|PerWorldInventory>")
4947
String pluginName) {
5048

5149
dataImportManager.getImporter(pluginName)
52-
.onEmpty(() -> issuer.sendError(MVInvi18n.IMPORT_UNSUPPORTEDPLUGIN, replace("{plugin}").with(pluginName)))
50+
.onEmpty(() -> issuer.sendError(MVInvi18n.MIGRATE_UNSUPPORTEDPLUGIN, replace("{plugin}").with(pluginName)))
5351
.peek(dataImporter -> {
5452
if (!dataImporter.isEnabled()) {
55-
issuer.sendError(MVInvi18n.IMPORT_PLUGINNOTENABLED, replace("{plugin}").with(pluginName));
53+
issuer.sendError(MVInvi18n.MIGRATE_PLUGINNOTENABLED, replace("{plugin}").with(pluginName));
5654
return;
5755
}
5856
commandQueueManager.addToQueue(CommandQueuePayload.issuer(issuer)
59-
.prompt(Message.of(MVInvi18n.IMPORT_CONFIRMPROMPT, replace("{plugin}").with(pluginName)))
57+
.prompt(Message.of(MVInvi18n.MIGRATE_CONFIRMPROMPT, replace("{plugin}").with(pluginName)))
6058
.action(() -> doDataImport(issuer, dataImporter)));
6159
});
6260
}
6361

6462
void doDataImport(MVCommandIssuer issuer, DataImporter dataImporter) {
6563
if (dataImporter.importData()) {
66-
issuer.sendInfo(MVInvi18n.IMPORT_SUCCESS, replace("{plugin}").with(dataImporter.getPluginName()));
64+
issuer.sendInfo(MVInvi18n.MIGRATE_SUCCESS, replace("{plugin}").with(dataImporter.getPluginName()));
6765
} else {
68-
issuer.sendError(MVInvi18n.IMPORT_FAILED, replace("{plugin}").with(dataImporter.getPluginName()));
66+
issuer.sendError(MVInvi18n.MIGRATE_FAILED, replace("{plugin}").with(dataImporter.getPluginName()));
6967
}
7068
}
7169
}

src/main/java/org/mvplugins/multiverse/inventories/util/MVInvi18n.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public enum MVInvi18n implements MessageKeyProvider {
8888
GROUP_NONCONVERSABLE,
8989
GROUP_INVALIDOPTION,
9090

91-
IMPORT_PLUGINNOTENABLED,
92-
IMPORT_UNSUPPORTEDPLUGIN,
93-
IMPORT_CONFIRMPROMPT,
94-
IMPORT_SUCCESS,
95-
IMPORT_FAILED,
91+
MIGRATE_PLUGINNOTENABLED,
92+
MIGRATE_UNSUPPORTEDPLUGIN,
93+
MIGRATE_CONFIRMPROMPT,
94+
MIGRATE_SUCCESS,
95+
MIGRATE_FAILED,
9696

9797
DELETEGROUP_CONFIRMPROMPT,
9898
DELETEGROUP_SUCCESS,

src/main/resources/multiverse-inventories_en.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ mv-inventories.group.updated=&2Group has been updated!
9191
mv-inventories.group.nonconversable=You are not allowed to access conversations (remote console?)
9292
mv-inventories.group.invalidoption=&cThat is not a valid option! Type &f##&c to stop working on groups.
9393

94-
# Import command
95-
mv-inventories.import.pluginnotenabled=&f{plugin} &6is not enabled so you may not import data from it!
96-
mv-inventories.import.unsupportedplugin=&6Sorry, ''&f{plugin}&6'' is not supported for importing.
97-
mv-inventories.import.confirmprompt=&6Are you sure you want to import data from &f{plugin}&6? This will override existing Multiverse-Inventories playerdata!!!
98-
mv-inventories.import.success=&2Successfully imported data from &f{plugin}!
99-
mv-inventories.import.failed=Failed to import data from &f{plugin}!
94+
# Migrate command
95+
mv-inventories.migrate.pluginnotenabled=&f{plugin} &6is not enabled so you may not import data from it!
96+
mv-inventories.migrate.unsupportedplugin=&6Sorry, ''&f{plugin}&6'' is not supported for importing.
97+
mv-inventories.migrate.confirmprompt=&6Are you sure you want to import data from &f{plugin}&6? This will override existing Multiverse-Inventories playerdata!!!
98+
mv-inventories.migrate.success=&2Successfully imported data from &f{plugin}!
99+
mv-inventories.migrate.failed=Failed to import data from &f{plugin}!
100100

101101
# Deletegroup command
102102
mv-inventories.deletegroup.confirmprompt=Are you sure you want to delete group &f{group}&6?

0 commit comments

Comments
 (0)