Skip to content

Commit 9e2cf13

Browse files
committed
C style array declaration & git test
1 parent 4dd5054 commit 9e2cf13

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ See the [LICENSE](https://github.com/Despical/CommandFramework/blob/main/LICENSE
114114
## Donations
115115
You like the Command Framework? Then [donate](https://www.patreon.com/despical) back me to support the development.
116116

117-
## Contributing
117+
## ~~Contributing~~ (No more contributing)
118118

119119
I accept Pull Requests via GitHub. There are some guidelines which will make applying PRs easier for me:
120120
+ Ensure you didn't use tabs! Please use spaces for indentation.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public class CommandArguments {
3535

3636
private final CommandSender commandSender;
3737
private final Command command;
38-
private final String label;
39-
private final String[] arguments;
38+
private final String label, arguments[];
4039

4140
public CommandArguments(CommandSender commandSender, Command command, String label, String... arguments) {
4241
this.commandSender = commandSender;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ private void registerCommand(Command command, Method method, Object instance) {
168168
public boolean onCommand(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command cmd, @NotNull String label, String[] args) {
169169
for (Map.Entry<Command, Map.Entry<Method, Object>> entry : commands.entrySet()) {
170170
Command command = entry.getKey();
171-
String[] splitted = command.name().split("\\.");
172-
String allArgs = args.length == 0 ? "" : String.join(".", Arrays.copyOfRange(args, 0, splitted.length - 1));
171+
String splitted[] = command.name().split("\\."), allArgs = args.length == 0 ? "" : String.join(".", Arrays.copyOfRange(args, 0, splitted.length - 1));
173172
String cmdName = (command.name().contains(".") ? splitted[0] : cmd.getName()) + (splitted.length == 1 && allArgs.isEmpty() ? "" : "." + allArgs);
174173

175174
if (command.name().equalsIgnoreCase(cmdName) || Stream.of(command.aliases()).anyMatch(cmdName::equalsIgnoreCase)) {

0 commit comments

Comments
 (0)