Skip to content

Commit

Permalink
Rename 'bank' to 'banks' in command and method names
Browse files Browse the repository at this point in the history
Changed the literal command and method names from 'bank' to 'banks' to correct the terminology. This adjustment ensures consistency across the command handling and improves code readability.
  • Loading branch information
NonSwag committed Aug 31, 2024
1 parent 2ce6f70 commit dcaf270
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ServiceInfoCommand {

LiteralArgumentBuilder<CommandSourceStack> create() {
return Commands.literal("info")
.then(Commands.literal("bank").executes(this::infoBank))
.then(Commands.literal("banks").executes(this::infoBanks))
.then(Commands.literal("chat").executes(this::infoChat))
.then(Commands.literal("economy").executes(this::infoEconomy))
.then(Commands.literal("groups").executes(this::infoGroups))
Expand All @@ -40,15 +40,11 @@ LiteralArgumentBuilder<CommandSourceStack> create() {
.executes(this::info);
}

@SuppressWarnings("DuplicatedCode")
private int info(CommandContext<CommandSourceStack> context) {

// ED8106

context.getSource().getSender().sendRichMessage("ServiceIO Information (v<version>)",
Placeholder.parsed("version", plugin.getPluginMeta().getVersion()));

infoBank(context);
infoBanks(context);
infoChat(context);
infoEconomy(context);
infoGroups(context);
Expand All @@ -57,7 +53,7 @@ private int info(CommandContext<CommandSourceStack> context) {
return Command.SINGLE_SUCCESS;
}

private int infoBank(CommandContext<CommandSourceStack> context) {
private int infoBanks(CommandContext<CommandSourceStack> context) {
var sender = context.getSource().getSender();
var bank = plugin.getServer().getServicesManager().load(BankController.class);
var banks = getRegistrations(BankController.class, bank, BankController::getName);
Expand Down

0 comments on commit dcaf270

Please sign in to comment.