Skip to content

Commit

Permalink
impr: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
MatzHilven committed Jun 19, 2024
1 parent f991209 commit 8c5ec02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/slampvp/factory/command/FactoryCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ public abstract class FactoryCommand extends net.minestom.server.command.builder
public FactoryCommand(@NotNull String name) {
super(name);

Command annotation = getClass().getAnnotation(Command.class);
Command command = getClass().getAnnotation(Command.class);

setDefaultExecutor((sender, context) -> {
sender.sendMessage(Locale.Command.INVALID_COMMAND
.replaceText(TextReplacementConfig.builder().match("<usage>").replacement(annotation.usage()).build())
.replaceText(TextReplacementConfig.builder().match("<usage>").replacement(command.usage()).build())
);
});

setCondition((commandSender, string) -> {
if (commandSender instanceof ConsoleSender) {
return !annotation.playerOnly();
return !command.playerOnly();
}

// TODO: implement permission checking when we implement ranks
Expand Down

0 comments on commit 8c5ec02

Please sign in to comment.