Skip to content

Commit 426a793

Browse files
committed
Refactor: rename Command#fallBackPrefix to Command#fallbackPrefix
1 parent cdc4b82 commit 426a793

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.github/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class ExampleClass extends JavaPlugin {
8686
// CommandArguments parameter and also @Command annotation
8787
@Command(
8888
name = "example",
89-
fallBackPrefix = "prefix",
89+
fallbackPrefix = "prefix",
9090
aliases = {"firstAlias", "secondAlias"},
9191
permission = "example.permission",
9292
desc = "Sends an example message to sender",

src/main/java/me/despical/commandframework/CommandRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ protected void registerCommand(Command command, Method method, Object instance)
173173
pluginCommand.setPermission(command.permission().isEmpty() ? null : command.permission());
174174
pluginCommand.setDescription(command.desc());
175175

176-
String fallBackPrefix = command.fallBackPrefix().isEmpty() ? commandFramework.plugin.getName() : command.fallBackPrefix();
176+
String fallbackPrefix = command.fallbackPrefix().isEmpty() ? commandFramework.plugin.getName() : command.fallbackPrefix();
177177

178-
commandMap.register(fallBackPrefix, pluginCommand);
178+
commandMap.register(fallbackPrefix, pluginCommand);
179179
} catch (Exception exception) {
180180
Utils.handleExceptions(exception);
181181
}

src/main/java/me/despical/commandframework/annotations/Command.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@
4545
String name();
4646

4747
/**
48+
* By default, using the plugin's name as a fallback prefix.
49+
*
4850
* @return a prefix which is prepended to the command with a ':'
4951
* one or more times to make the command unique.
5052
*/
51-
String fallBackPrefix() default "";
53+
String fallbackPrefix() default "";
5254

5355
/**
5456
* The permission that sender has to have to execute command.
@@ -132,4 +134,4 @@
132134
enum SenderType {
133135
BOTH, CONSOLE, PLAYER
134136
}
135-
}
137+
}

src/main/java/me/despical/commandframework/utils/Utils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ public String name() {
159159
}
160160

161161
@Override
162-
public String fallBackPrefix() {
163-
return command.fallBackPrefix();
162+
public String fallbackPrefix() {
163+
return command.fallbackPrefix();
164164
}
165165

166166
@Override
@@ -214,4 +214,4 @@ public Class<? extends Annotation> annotationType() {
214214
}
215215
};
216216
}
217-
}
217+
}

0 commit comments

Comments
 (0)