Skip to content

Commit

Permalink
refactor: /sjm sync -> /sjm collection
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAreaBean committed Apr 20, 2024
1 parent a4e3e4d commit 6e74b4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/cc/happyareabean/sjm/commands/SJMCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void regenerate(BukkitCommandActor actor) {
.append(text(fileName, NamedTextColor.GRAY)));
}

@Subcommand({"sync create"})
@Description("Create a sync collection with current join message")
@Subcommand({"collection create"})
@Description("Create a collection with current join message")
public void create(BukkitCommandActor actor, String collectionName) {
actor.reply(Constants.PREFIX.append(text("Creating collection %s...".formatted(collectionName), NamedTextColor.YELLOW)));

Expand All @@ -153,8 +153,8 @@ public void create(BukkitCommandActor actor, String collectionName) {
});
}

@Subcommand({"sync remove"})
@Description("Remove a sync collection")
@Subcommand({"collection remove"})
@Description("Remove a collection")
public void remove(BukkitCommandActor actor, String collectionName) {
actor.reply(Constants.PREFIX.append(text("Removing collection %s...".formatted(collectionName), NamedTextColor.YELLOW)));

Expand All @@ -179,16 +179,16 @@ public void remove(BukkitCommandActor actor, String collectionName) {
});
}

@Subcommand({"sync set"})
@Description("Set sync collection")
@Subcommand({"collection set"})
@Description("Set collection target for sync on startup")
public void set(BukkitCommandActor actor, String collectionName) {

SJMSync sync = SimpleJoinMessage.getInstance().getSyncConfig();
sync.setCollectionName(collectionName);
sync.save();
sync.load();

actor.reply(Constants.PREFIX.append(text("The sync collection has been updated to %s.".formatted(collectionName), NamedTextColor.GREEN)));
actor.reply(Constants.PREFIX.append(text("The collection has been updated to %s.".formatted(collectionName), NamedTextColor.GREEN)));
actor.reply(Constants.PREFIX.append(text("It will be applied when the next server starts up.", NamedTextColor.GREEN)));
}

Expand Down

0 comments on commit 6e74b4b

Please sign in to comment.