Skip to content

Commit f2207dc

Browse files
authored
Merge pull request CommandAPI#589 from JorelAli/release/9.5.2
Release/9.5.2
2 parents d130bde + ce0eeb6 commit f2207dc

File tree

1,085 files changed

+59176
-3939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,085 files changed

+59176
-3939
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ body:
2020
description: What version of Minecraft are you using? _(If using a minor version that isn't specified, such as 1.18.1, just select the latest version below it such as 1.18)_
2121
multiple: false
2222
options:
23+
- "1.21"
24+
- "1.20.6"
2325
- "1.20.5"
2426
- "1.20.4"
2527
- "1.20.3"

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = CommandAPI
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 9.5.1
41+
PROJECT_NUMBER = 9.5.2
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,23 @@ The list of what version of the CommandAPI you'll need to run on a specific vers
5353
| **1.16.2** | v4.0 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
5454
| **1.16.3** | v4.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
5555
| **1.16.4** | v5.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
56-
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.5.1 | 9.5.1 | 16 |
57-
| **1.17** | 6.0.x - 9.5.1 | 9.5.1 | 16 |
58-
| **1.17.1** | 6.1.x - 9.5.1 | 9.5.1 | 16 |
59-
| **1.18, 1.18.1** | 6.5.2 - 9.5.1 | 9.5.1 | 16 |
60-
| **1.18.2** | 6.5.4 - 9.5.1 | 9.5.1 | 16 |
61-
| **1.19** | 8.3.0 - 9.5.1 | 9.5.1 | 16 |
62-
| **1.19.1** | 8.5.0 - 9.5.1 | 9.5.1 | 16 |
63-
| **1.19.2** | 8.5.1 - 9.5.1 | 9.5.1 | 16 |
64-
| **1.19.3** | 8.7.0 - 9.5.1 | 9.5.1 | 16 |
65-
| **1.19.4** | 8.8.0 - 9.5.1 | 9.5.1 | 16 |
66-
| **1.20** | 9.0.2 - 9.5.1 | 9.5.1 | 16 |
67-
| **1.20.1** | 9.0.3 - 9.5.1 | 9.5.1 | 16 |
68-
| **1.20.2** | 9.2.0 - 9.5.1 | 9.5.1 | 16 |
69-
| **1.20.3, 1.20.4** | 9.3.0 - 9.5.1 | 9.5.1 | 16 |
70-
| **1.20.5, 1.20.6** | 9.4.0 - 9.5.1 | 9.5.1 | 16 |
71-
| **1.21** | 9.5.0 - 9.5.1 | 9.5.1 | 16 |
56+
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.5.2 | 9.5.2 | 16 |
57+
| **1.17** | 6.0.x - 9.5.2 | 9.5.2 | 16 |
58+
| **1.17.1** | 6.1.x - 9.5.2 | 9.5.2 | 16 |
59+
| **1.18, 1.18.1** | 6.5.2 - 9.5.2 | 9.5.2 | 16 |
60+
| **1.18.2** | 6.5.4 - 9.5.2 | 9.5.2 | 16 |
61+
| **1.19** | 8.3.0 - 9.5.2 | 9.5.2 | 16 |
62+
| **1.19.1** | 8.5.0 - 9.5.2 | 9.5.2 | 16 |
63+
| **1.19.2** | 8.5.1 - 9.5.2 | 9.5.2 | 16 |
64+
| **1.19.3** | 8.7.0 - 9.5.2 | 9.5.2 | 16 |
65+
| **1.19.4** | 8.8.0 - 9.5.2 | 9.5.2 | 16 |
66+
| **1.20** | 9.0.2 - 9.5.2 | 9.5.2 | 16 |
67+
| **1.20.1** | 9.0.3 - 9.5.2 | 9.5.2 | 16 |
68+
| **1.20.2** | 9.2.0 - 9.5.2 | 9.5.2 | 16 |
69+
| **1.20.3, 1.20.4** | 9.3.0 - 9.5.2 | 9.5.2 | 16 |
70+
| **1.20.5, 1.20.6** | 9.4.0 - 9.5.2 | 9.5.2 | 16 |
71+
| **1.21** | 9.5.0 - 9.5.2 | 9.5.2 | 16 |
72+
| **1.21.1** | 9.5.2 | 9.5.2 | 16 |
7273

7374
-----
7475

@@ -408,6 +409,23 @@ This is the current roadmap for the CommandAPI (as of 30th April 2024):
408409
</tr>
409410
</thead>
410411
<tbody>
412+
<tr>
413+
<td valign="top"><b>9.5.2</b></td>
414+
<td valign="top">August 2024</td>
415+
<td valign="top">
416+
<b>Minecraft Version Changes:</b>
417+
<ul>
418+
<li>Adds support for Minecraft 1.21.1</li>
419+
</ul>
420+
<b>CommandAPI Changes:</b>
421+
<ul>
422+
<li>https://github.com/JorelAli/CommandAPI/pull/588 Fix Folia scheduling methods using the wrong scheduler implementation</li>
423+
<li>https://github.com/JorelAli/CommandAPI/issues/577 Adds a <code>CommandAPIBukkit#failWithAdventureComponent(ComponentLike)</code> method</li>
424+
<li>https://github.com/JorelAli/CommandAPI/pull/580 Fix running a non-vanilla command on paper in Minecraft functions with the CommandAPI throwing runtime exceptions</li>
425+
<li>Fix namespaces not being propagated when registering subcommands</li>
426+
</ul>
427+
</td>
428+
</tr>
411429
<tr>
412430
<td valign="top"><b>9.5.1</b></td>
413431
<td valign="top">June 2024</td>

commandapi-annotations/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>dev.jorel</groupId>
2020
<artifactId>commandapi</artifactId>
21-
<version>9.5.1</version>
21+
<version>9.5.2</version>
2222
</parent>
2323

2424
<artifactId>commandapi-annotations</artifactId>

commandapi-codecov/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>dev.jorel</groupId>
2222
<artifactId>commandapi</artifactId>
23-
<version>9.5.1</version>
23+
<version>9.5.2</version>
2424
</parent>
2525

2626
<artifactId>commandapi-codecov</artifactId>

commandapi-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>commandapi</artifactId>
2121
<groupId>dev.jorel</groupId>
22-
<version>9.5.1</version>
22+
<version>9.5.2</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

commandapi-core/src/main/java/dev/jorel/commandapi/AbstractCommandAPICommand.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Impl setConverted(boolean isConverted) {
215215
// shouldn't be accessing/depending on any of the contents of the current class instance)
216216
@SuppressWarnings({ "unchecked", "rawtypes" })
217217
private static <Impl extends AbstractCommandAPICommand<Impl, Argument, CommandSender>, Argument extends AbstractArgument<?, ?, Argument, CommandSender>, CommandSender>
218-
void flatten(Impl rootCommand, List<Argument> prevArguments, Impl subcommand) {
218+
void flatten(Impl rootCommand, List<Argument> prevArguments, Impl subcommand, String namespace) {
219219
// Get the list of literals represented by the current subcommand. This
220220
// includes the subcommand's name and any aliases for this subcommand
221221
String[] literals = new String[subcommand.meta.aliases.length + 1];
@@ -243,11 +243,11 @@ void flatten(Impl rootCommand, List<Argument> prevArguments, Impl subcommand) {
243243
rootCommand.withArguments(subcommand.arguments);
244244
rootCommand.executor = subcommand.executor;
245245
rootCommand.subcommands = new ArrayList<>();
246-
rootCommand.register();
246+
rootCommand.register(namespace);
247247
}
248248

249249
for (Impl subsubcommand : subcommand.getSubcommands()) {
250-
flatten(rootCommand, new ArrayList<>(prevArguments), subsubcommand);
250+
flatten(rootCommand, new ArrayList<>(prevArguments), subsubcommand, namespace);
251251
}
252252
}
253253

@@ -310,7 +310,7 @@ public void register(String namespace) {
310310

311311
// Convert subcommands into multiliteral arguments
312312
for (Impl subcommand : this.subcommands) {
313-
flatten(this.copy(), new ArrayList<>(), subcommand);
313+
flatten(this.copy(), new ArrayList<>(), subcommand, namespace);
314314
}
315315
}
316316

commandapi-core/src/main/java/dev/jorel/commandapi/CommandAPI.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ private CommandAPI() {
2727
private static boolean loaded;
2828
private static InternalConfig config;
2929
private static CommandAPILogger logger;
30+
private static String loadedStack;
3031

3132
// Accessing static variables
3233

@@ -96,6 +97,14 @@ public static CommandAPILogger getLogger() {
9697
*/
9798
public static void onLoad(CommandAPIConfig<?> config) {
9899
if (!loaded) {
100+
// Store the current stack trace to help diagnose multi-loading errors
101+
final StringBuilder currentStack = new StringBuilder();
102+
for (StackTraceElement e : Thread.currentThread().getStackTrace()) {
103+
currentStack.append(e.toString());
104+
currentStack.append("\n");
105+
}
106+
CommandAPI.loadedStack = currentStack.toString();
107+
99108
// Setup variables
100109
CommandAPI.config = new InternalConfig(config);
101110

@@ -124,6 +133,14 @@ public static void onLoad(CommandAPIConfig<?> config) {
124133
loaded = true;
125134
} else {
126135
getLogger().severe("You've tried to call the CommandAPI's onLoad() method more than once!");
136+
final StringBuilder currentStack = new StringBuilder();
137+
for (StackTraceElement e : Thread.currentThread().getStackTrace()) {
138+
currentStack.append(e.toString());
139+
currentStack.append("\n");
140+
}
141+
getLogger().severe("The CommandAPI was first loaded here:\n\n" + CommandAPI.loadedStack +
142+
"\n\nBut it is now being loaded here:\n\n" + currentStack.toString());
143+
127144
}
128145
}
129146

commandapi-core/src/main/java/dev/jorel/commandapi/executors/CommandArguments.java

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package dev.jorel.commandapi.executors;
22

3-
import dev.jorel.commandapi.arguments.AbstractArgument;
4-
5-
import javax.annotation.Nullable;
6-
3+
import java.util.Arrays;
74
import java.util.Collection;
85
import java.util.Collections;
9-
import java.util.HashMap;
106
import java.util.Map;
7+
import java.util.Objects;
118
import java.util.Optional;
129
import java.util.function.Supplier;
1310

11+
import javax.annotation.Nullable;
12+
13+
import dev.jorel.commandapi.arguments.AbstractArgument;
14+
1415
/**
1516
* This class stores the arguments for this command
1617
*
@@ -600,4 +601,28 @@ private String buildExceptionMessage(Object argumentNameOrIndex, String expected
600601
"contact the developers of the CommandAPI, we'd love to know how you managed to get this error!");
601602
}
602603

604+
@Override
605+
public int hashCode() {
606+
final int prime = 31;
607+
int result = 1;
608+
result = prime * result + Arrays.deepHashCode(args);
609+
result = prime * result + Arrays.hashCode(rawArgs);
610+
result = prime * result + Objects.hash(argsMap, fullInput, rawArgsMap);
611+
return result;
612+
}
613+
614+
@Override
615+
public boolean equals(Object obj) {
616+
if (this == obj)
617+
return true;
618+
if (obj == null)
619+
return false;
620+
if (getClass() != obj.getClass())
621+
return false;
622+
CommandArguments other = (CommandArguments) obj;
623+
return Arrays.deepEquals(args, other.args) && Objects.equals(argsMap, other.argsMap)
624+
&& Objects.equals(fullInput, other.fullInput) && Arrays.equals(rawArgs, other.rawArgs)
625+
&& Objects.equals(rawArgsMap, other.rawArgsMap);
626+
}
627+
603628
}

commandapi-documentation-code/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<artifactId>commandapi</artifactId>
99
<groupId>dev.jorel</groupId>
10-
<version>9.5.1</version>
10+
<version>9.5.2</version>
1111
</parent>
1212

1313
<artifactId>commandapi-documentation-code</artifactId>
@@ -19,7 +19,7 @@
1919
</repository>
2020
<repository>
2121
<id>papermc</id>
22-
<url>https://papermc.io/repo/repository/maven-public/</url>
22+
<url>https://repo.papermc.io/repository/maven-public/</url>
2323
</repository>
2424
<repository>
2525
<id>codemc-repo</id>

0 commit comments

Comments
 (0)