8000 Release/9.7.0 by JorelAli · Pull Request #618 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content

Release/9.7.0 #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b38936a
Set version to 9.6.2-SNAPSHOT
JorelAli Oct 28, 2024
558f09c
Create `commandapi-bukkit-test-toolkit`
willkroboth Jul 4, 2024
1816bff
Add `MockCommandAPIPlugin` for testing with `commandapi-bukkit-plugin`
willkroboth Jul 5, 2024
9ad579f
Add `assertCommandSucceeds` and `assertCommandFails` methods to Comma…
willkroboth Jul 5, 2024
8ed2acf
Add `assertCommandRunsWithArguments` methods to CommandAPITestUtilities
willkroboth Jul 9, 2024
d2fa55e
Implement testing IntegerRangeArgument NMS independently
willkroboth Jul 9, 2024
b86eb60
Fix CommandAPIHandler javadoc error that breaks full build
willkroboth Jul 9, 2024
be330ca
Add `assertCommandSuggests` methods to CommandAPITestUtilities
willkroboth Jul 10, 2024
7178477
Add `assertCommandFailsWithArguments` methods
willkroboth Jul 10, 2024
dafa99a
Improve coverage report by using Supplier<String> in CommandAPITestUt…
willkroboth Jul 10, 2024
83e5133
Add example argument and suggestion tests
willkroboth Jul 10, 2024
363c247
Add EntitySelectorArgument, PlayerArgument, and OfflinePlayerArgument…
willkroboth Jul 13, 2024
874770b
Implement ArgumentType suggestions for test toolkit
willkroboth Jul 16, 2024
2824ed8
Refactor Parser building syntax
willkroboth Jul 17, 2024
10000
421fa57
Add README files for the test toolkit example projects
willkroboth Jul 17, 2024
4b67594
Add javadocs for important test toolkit methods and classes
willkroboth Jul 18, 2024
2ab0c17
Add docs for the test toolkit
willkroboth Jul 19, 2024
3b92c11
Fix trailing space (markdown lint)
willkroboth Jul 19, 2024
7b5750a
Add manual update notes to `update.sh`
willkroboth Jul 22, 2024
6b5f791
Allow developers to load custom MockCommandAPIBukkit instances in the…
willkroboth Aug 24, 2024
3b74499
Use translation keys instead of literal messages
willkroboth Sep 23, 2024
c8264e3
Update note about unimplemented methods in test_intro.md
willkroboth Sep 23, 2024
764f72e
Update MockBukkit-v1.21 to match paper updates
willkroboth Sep 23, 2024
5b286a3
Add javadocs to ArgumentUtilities and parser package
willkroboth Oct 6, 2024
87406f3
Update dependencies to 1.21
willkroboth Oct 16, 2024
40e8f87
Add @n to suggestions
willkroboth Oct 16, 2024
e9003b5
Add braces to inlined if-statements
willkroboth Oct 16, 2024
d2a8f88
Update documented dependency versions and mention gradle dependencies
willkroboth Oct 16, 2024
461f9f9
Fix markdownlint errors in test_setup.md
willkroboth Oct 16, 2024
ba8d578
Update MockBukkit to fix Paper 1.21 api update
willkroboth Oct 22, 2024
ac84d75
Rework `Parser` definition
willkroboth Oct 25, 2024
0bb04fa
Fix test-toolkit dependencies
willkroboth Oct 26, 2024
8688a08
Code review
willkroboth Oct 26, 2024
cf61f14
Update test toolkit versions to 9.6.2-SNAPSHOT manually
willkroboth Oct 28, 2024
e000a4b
Add new 9.6.0 NMS methods to MockCommandAPIBukkit
willkroboth Oct 28, 2024
c53e451
Merge pull request #575 from JorelAli/dev/simple-test-suite
willkroboth Oct 28, 2024
b27fc71
complete #529
MC-XiaoHei Nov 13, 2024
a47d939
format, docs, and fix tests
MC-XiaoHei Nov 15, 2024
1582991
format
MC-XiaoHei Nov 15, 2024
ab330ee
use const for more readable
MC-XiaoHei Nov 15, 2024
2c9b081
Update commandapi-core/src/main/java/dev/jorel/commandapi/AbstractArg…
MC-XiaoHei Nov 18, 2024
fd2eca8
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 18, 2024
90e6045
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 18, 2024
994653c
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 18, 2024
d0dd2c8
add thenNested() list ver, implement array ver with list ver
MC-XiaoHei Nov 18, 2024
0203144
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 19, 2024
3a8a6f2
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 19, 2024
59572b2
Update docssrc/src/commandtrees.md
MC-XiaoHei Nov 19, 2024
a31e859
implement nested { } with list ver thenNested() method
MC-XiaoHei Nov 19, 2024
54d3e36
Update commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/…
MC-XiaoHei Nov 19, 2024
8771911
fix indentation
MC-XiaoHei Nov 20, 2024
50fa068
fix indentation
MC-XiaoHei Nov 20, 2024
27b9360
Merge pull request #613 from MC-XiaoHei/dev/dev
JorelAli Nov 20, 2024
082bee7
Initial work for 1.21.4 support
DerEchtePilz Dec 3, 2024
ed915a3
Adds support for new Trail particle in 1.21.4
JorelAli Dec 3, 2024
0cb559a
Adds documentation for Trail particle and adds thenNested to the docu…
JorelAli Dec 3, 2024
362b8e6
Add 1.21.4 to the issue template
DerEchtePilz Dec 3, 2024
32319cf
Add test toolkit to 9.7.0 documentation changelog
willkroboth Dec 4, 2024
6017fd0
Set version to 9.7.0
JorelAli Dec 4, 2024
28cc2f5
Adds 9.7.0 documentation
JorelAli Dec 4, 2024
e79fb6e
Update homepage to point to 9.7.0
JorelAli Dec 4, 2024
aea0a3e
Generate 9.7.0 JavaDocs
JorelAli Dec 4, 2024
2e3adc2
Update documentation wiki.vg links to point to the MinecraftWiki wiki…
JorelAli Dec 4, 2024
7fe69b7
Merge branch 'master' into release/9.7.0
JorelAli Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body:
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)_
multiple: false
options:
- "1.21.4"
- "1.21.3"
- "1.21.2"
- "1.21.1"
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
8000
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = CommandAPI
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 9.6.1
PROJECT_NUMBER = 9.7.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,25 @@ The list of what version of the CommandAPI you'll need to run on a specific vers
| **1.16.2** | v4.0 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
| **1.16.3** | v4.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
| **1.16.4** | v5.2 - 5.12, 8.3.0 - 9.4.2 | 9.4.2 | 16 |
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.6.1 | 9.6.1 | 16 |
| **1.17** | 6.0.x - 9.6.1 | 9.6.1 | 16 |
| **1.17.1** | 6.1.x - 9.6.1 | 9.6.1 | 16 |
| **1.18, 1.18.1** | 6.5.2 - 9.6.1 | 9.6.1 | 16 |
| **1.18.2** | 6.5.4 - 9.6.1 | 9.6.1 | 16 |
| **1.19** | 8.3.0 - 9.6.1 | 9.6.1 | 16 |
| **1.19.1** | 8.5.0 - 9.6.1 | 9.6.1 | 16 |
| **1.19.2** | 8.5.1 - 9.6.1 | 9.6.1 | 16 |
| **1.19.3** | 8.7.0 - 9.6.1 | 9.6.1 | 16 |
| **1.19.4** | 8.8.0 - 9.6.1 | 9.6.1 | 16 |
| **1.20** | 9.0.2 - 9.6.1 | 9.6.1 | 16 |
| **1.20.1** | 9.0.3 - 9.6.1 | 9.6.1 | 16 |
| **1.20.2** | 9.2.0 - 9.6.1 | 9.6.1 | 16 |
| **1.20.3, 1.20.4** | 9.3.0 - 9.6.1 | 9.6.1 | 16 |
| **1.20.5, 1.20.6** | 9.4.0 - 9.6.1 | 9.6.1 | 16 |
| **1.21** | 9.5.0 - 9.6.1 | 9.6.1 | 16 |
| **1.21.1** | 9.5.2 - 9.6.1 | 9.6.1 | 16 |
| **1.21.2, 1.21.3** | 9.6.0 - 9.6.1 | 9.6.1 | 16 |
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.7.0 | 9.7.0 | 16 |
| **1.17** | 6.0.x - 9.7.0 | 9.7.0 | 16 |
| **1.17.1** | 6.1.x - 9.7.0 | 9.7.0 | 16 |
| **1.18, 1.18.1** | 6.5.2 - 9.7.0 | 9.7.0 | 16 |
| **1.18.2** | 6.5.4 - 9.7.0 | 9.7.0 | 16 |
| **1.19** | 8.3.0 - 9.7.0 | 9.7.0 | 16 |
| **1.19.1** | 8.5.0 - 9.7.0 | 9.7.0 | 16 |
| **1.19.2** | 8.5.1 - 9.7.0 | 9.7.0 | 16 |
| **1.19.3** | 8.7.0 - 9.7.0 | 9.7.0 | 16 |
| **1.19.4** | 8.8.0 - 9.7.0 | 9.7.0 | 16 |
| **1.20** | 9.0.2 - 9.7.0 | 9.7.0 | 16 |
| **1.20.1** | 9.0.3 - 9.7.0 | 9.7.0 | 16 |
| **1.20.2** | 9.2.0 - 9.7.0 | 9.7.0 | 16 |
| **1.20.3, 1.20.4** | 9.3.0 - 9.7.0 | 9.7.0 | 16 |
| **1.20.5, 1.20.6** | 9.4.0 - 9.7.0 | 9.7.0 | 16 |
| **1.21** | 9.5.0 - 9.7.0 | 9.7.0 | 16 |
| **1.21.1** | 9.5.2 - 9.7.0 | 9.7.0 | 16 |
| **1.21.2, 1.21.3** | 9.6.0 - 9.7.0 | 9.7.0 | 16 |
| **1.21.4** | 9.7.0 | 9.7.0 | 16 |

-----

Expand Down Expand Up @@ -410,6 +411,21 @@ This is the current roadmap for the CommandAPI (as of 30th April 2024):
</tr>
</thead>
<tbody>
<tr>
<td valign="top"><b>9.7.0</b></td>
<td valign="top">December 2024</td>
<td valign="top">
<b>Minecraft Version Changes:</b>
<ul>
<li>Adds support for Minecraft 1.21.4</li>
</ul>
<b>CommandAPI Changes:</b>
<ul>
<li>https://github.com/CommandAPI/CommandAPI/pull/575 Adds a NMS independent test toolkit to allow developers to test their commands with MockBukkit</li>
<li>https://github.com/CommandAPI/CommandAPI/pull/613 Adds a <code>thenNested</code> method for <code>CommandTree</code>s to reduce nesting</li>
</ul>
</td>
</tr>
<tr>
<td valign="top"><b>9.6.1</b></td>
<td valign="top">October 2024</td>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>

<artifactId>commandapi-annotations</artifactId>
628C Expand Down
8 changes: 7 additions & 1 deletion commandapi-codecov/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>

<artifactId>commandapi-codecov</artifactId>
Expand Down Expand Up @@ -58,6 +58,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-bukkit-test-toolkit</artifactId>
<version>${project.version}</version>
<!-- This should not have the test scope because it contains classes whose coverage we want to analyze -->
</dependency>

<!-- From commandapi-bukkit-nms-dependency-mojang-mapped -->

Expand Down
2 changes: 1 addition & 1 deletion commandapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>commandapi</artifactId>
<groupId>dev.jorel</groupId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.jorel.commandapi.arguments.AbstractArgument;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
Expand Down Expand Up @@ -60,6 +61,41 @@ public Impl then(final AbstractArgumentTree<?, Argument, CommandSender> tree) {
return instance();
}

/**
* Creates a chain of child branches starting at this node
* <p>
* {@code thenNested(a, b, c)} is equivalent to {@link #then}{@code (a.then(b.then(c)))}.
*
* @param trees The child branches to add in a chain.
* @return this tree node
*/
public final Impl thenNested(List<AbstractArgumentTree<?, Argument, CommandSender>> trees) {
int length = trees.size();
if (length == 0) {
return instance();
}

AbstractArgumentTree<?, Argument, CommandSender> combined = trees.get(length - 1);
for (int i = length - 2; i >= 0; i--) {
combined = trees.get(i).then(combined);
}

return then(combined);
}

/**
* Creates a chain of child branches starting at this node
* <p>
* {@code thenNested(a, b, c)} is equivalent to {@link #then}{@code (a.then(b.then(c)))}.
*
* @param trees The child branches to add in a chain.
* @return this tree node
*/
@SafeVarargs
public final Impl thenNested(final AbstractArgumentTree<?, Argument, CommandSender>... trees) {
return thenNested(Arrays.asList(trees));
}

List<Execution<CommandSender, Argument>> getExecutions() {
List<Execution<CommandSender, Argument>> executions = new ArrayList<>();
// If this is executable, add its execution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.jorel.commandapi.arguments.AbstractArgument;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
Expand Down Expand Up @@ -43,6 +44,41 @@ public Impl then(final AbstractArgumentTree<?, Argument, CommandSender> tree) {
return instance();
}

/**
* Creates a chain of child branches starting at this node
* <p>
* {@code thenNested(a, b, c)} is equivalent to {@link #then}{@code (a.then(b.then(c)))}.
*
* @param trees The child branches to add in a chain.
* @return this tree node
*/
public final Impl thenNested(List<AbstractArgumentTree<?, Argument, CommandSender>> trees) {
int length = trees.size();
if (length == 0) {
return instance();
}

AbstractArgumentTree<?, Argument, CommandSender> combined = trees.get(length - 1);
for (int i = length - 2; i >= 0; i--) {
combined = trees.get(i).then(combined);
}

return then(combined);
}

/**
* Creates a chain of child branches starting at this node
* <p>
* {@code thenNested(a, b, c)} is equivalent to {@link #then}{@code (a.then(b.then(c)))}.
*
* @param trees The child branches to add in a chain.
* @return this tree node
*/
@SafeVarargs
public final Impl thenNested(final AbstractArgumentTree<?, Argument, CommandSender>... trees) {
return thenNested(Arrays.asList(trees));
}

/**
* Registers the command with a given namespace
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ public CommandAPIPlatform<Argument, CommandSender, Source> getPlatform() {
* @param executor code to be ran when the command is executed
* @param converted True if this command is being converted from another plugin, and false otherwise
* @return a brigadier command which is registered internally
* @throws CommandSyntaxException if an error occurs when the command is ran
*/
Command<Source> generateCommand(Argument[] args, CommandAPIExecutor<CommandSender, AbstractCommandSender<? extends CommandSender>> executor, boolean converted) {
public Command<Source> generateCommand(Argument[] args, CommandAPIExecutor<CommandSender, AbstractCommandSender<? extends CommandSender>> executor, boolean converted) {

// Generate our command from executor
return cmdCtx -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public interface CommandAPIPlatform<Argument
public abstract void createDispatcherFile(File file, CommandDispatcher<Source> dispatcher) throws IOException;

/**
* @return A new default Logger meant for the CommandAPI to use
* @return A new default Logger meant for the CommandAPI to use. This logger will be used by the CommandAPI
* if one is not set using {@link CommandAPI#setLogger(CommandAPILogger)}.
*/
public default CommandAPILogger getLogger() {
return new CommandAPILogger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file within the commandapi-core module is NOT used at run time. Instead, the platform modules
* replace this class with their own version that handles loads the correct class for their version.
*/
public interface CommandAPIVersionHandler {
public abstract class CommandAPIVersionHandler {

/**
* Returns an instance of the version's implementation of CommandAPIPlatform.
Expand Down
22 changes: 20 additions & 2 deletions commandapi-documentation-code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>commandapi</artifactId>
<groupId>dev.jorel</groupId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>

<artifactId>commandapi-documentation-code</artifactId>
Expand Down Expand Up @@ -48,7 +48,6 @@
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
Expand All @@ -57,6 +56,25 @@
<scope>provided</scope>
</dependency>

<!-- Testing examples dependencies -->
<dependency>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v1.20</artifactId>
<version>3.9.0</version>
</dependency>
<dependency>
<!-- Note: This is before the other CommandAPI dependencies so example `testLoadMockCommandAPI2`
can resolve the correct instance of the CommandAPIVersionHandler class -->
<groupId>dev.jorel</groupId>
<artifactId>commandapi-bukkit-test-toolkit</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
</dependency>

<!-- CommandAPI -->
<dependency>
<groupId>dev.jorel</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************************/

import be.seeseemelk.mockbukkit.MockBukkit;
import be.seeseemelk.mockbukkit.ServerMock;
import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.Message;
import com.mojang.brigadier.ParseResults;
Expand Down Expand Up @@ -74,6 +76,8 @@
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.EulerAngle;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

import java.util.*;
import java.util.Map.Entry;
Expand Down Expand Up @@ -2519,6 +2523,60 @@ void subcommands() {
/* ANCHOR_END: subcommands4 */
}

class test {
class Main extends JavaPlugin {

}

class example1 {
/* ANCHOR: testLoadMockCommandAPI1 */
@BeforeEach
public void setUp() {
// Set up MockBukkit server
ServerMock server = MockBukkit.mock();

// Load the CommandAPI plugin
MockCommandAPIPlugin.load(config -> config
.missingExecutorImplementationMessage("This command cannot be run by %S")
);

// Load our plugin
MockBukkit.load(Main.class);
}

@AfterEach
public void tearDown() {
// Reset for a clean slate next test
MockBukkit.unmock();
}
/* ANCHOR_END: testLoadMockCommandAPI1 */
}

class example2 {
/* ANCHOR: testLoadMockCommandAPI2 */
public class CustomMockCommandAPIBukkit extends MockCommandAPIBukkit {
// Implement a method that usually throws `UnimplementedMethodException`
@Override
public void reloadDataPacks() {
CommandAPI.logInfo("Simulating data pack reload");
// Further logic
}
}

@BeforeEach
public void setUp() {
// Set up MockBukkit server
MockBukkit.mock();

// Tell the CommandAPI to use your custom platform implementation
CommandAPIVersionHandler.usePlatformImplementation(new CustomMockCommandAPIBukkit());

// Load CommandAPI and your plugin as mentioned above...
}
/* ANCHOR_END: testLoadMockCommandAPI2 */
}
}

class tooltips {
{
/* ANCHOR: tooltips1 */
Expand Down
2 changes: 1 addition & 1 deletion commandapi-documentation-velocity-code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>

<artifactId>commandapi-documentation-velocity-code</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.6.1</version>
<version>9.7.0</version>
</parent>

<artifactId>commandapi-bukkit-kotlin</artifactId>
Expand Down
Loading
Loading
0