diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index cd5baa179..ff9e64621 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -189,7 +189,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
- server-id: ossrh # Needs to match the id in the main pom.xml file
+ server-id: central # Needs to match the id in the main pom.xml file
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
java-version: 21
@@ -204,5 +204,5 @@ jobs:
echo "Version is not a SNAPSHOT version, not deploying to Sonatype Snapshot repo"
fi
env:
- MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
- MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
+ MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_PASSWORD }}
diff --git a/README.md b/README.md
index 235d9d909..1da415073 100644
--- a/README.md
+++ b/README.md
@@ -63,16 +63,17 @@ The list of what version of the CommandAPI you'll need to run on a specific vers
| **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 - 10.0.0 | 10.0.0 | 17 |
-| **1.20.1** | 9.0.3 - 10.0.0 | 10.0.0 | 17 |
-| **1.20.2** | 9.2.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.20.3, 1.20.4** | 9.3.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.20.5, 1.20.6** | 9.4.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.21** | 9.5.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.21.1** | 9.5.2 - 10.0.0 | 10.0.0 | 17 |
-| **1.21.2, 1.21.3** | 9.6.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.21.4** | 9.7.0 - 10.0.0 | 10.0.0 | 17 |
-| **1.21.5** | 10.0.0 | 10.0.0 | 17 |
+| **1.20** | 9.0.2 - 10.1.0 | 10.1.0 | 17 |
+| **1.20.1** | 9.0.3 - 10.1.0 | 10.1.0 | 17 |
+| **1.20.2** | 9.2.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.20.3, 1.20.4** | 9.3.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.20.5, 1.20.6** | 9.4.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.21** | 9.5.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.21.1** | 9.5.2 - 10.1.0 | 10.1.0 | 17 |
+| **1.21.2, 1.21.3** | 9.6.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.21.4** | 9.7.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.21.5** | 10.0.0 - 10.1.0 | 10.1.0 | 17 |
+| **1.21.6** | 10.1.0 | 10.1.0 | 17 |
-----
@@ -391,11 +392,21 @@ This is the current roadmap for the CommandAPI (as of 1st April 2025):
+
+
10.1.0
+
June 2025
+
+ Minecraft Version Changes:
+
+
Adds support for Minecraft 1.21.6
+
+
+
10.0.1
May 2025
- Bug Fixes:
+ Bug Fixes:
Fixes command unregistration not working on Paper
https://github.com/CommandAPI/CommandAPI/issues/645 Ignore requirements for null senders
@@ -406,17 +417,17 @@ This is the current roadmap for the CommandAPI (as of 1st April 2025):
10.0.0
April 2025
- ⚠️ This version is incompatible with any plugin that used the CommandAPI version 9.X.X or below! (See documentation for more information)
+ ⚠️ This version is incompatible with any plugin that used the CommandAPI version 9.X.X or below! (See documentation for more information) Minecraft Version Changes:
Adds support for Minecraft 1.21.5
Drops support for Minecraft 1.16.5 - 1.19.4
- Java Version Changes:
-
+ Java Version Changes:
+
Change from requiring Java 16 to Java 17 (LTS)
- CommandAPI Changes:
+ CommandAPI Changes:
https://github.com/CommandAPI/CommandAPI/pull/633 Adds an AsyncOfflinePlayerArgument to allow asynchronous fetching of an offline player
https://github.com/CommandAPI/CommandAPI/pull/636 The default namespace has been updated from minecraft to the plugin's name. If you are not shading, the default namespace is going to be commandapi. If you are shading, the default namespace is going to be your plugin's name.
@@ -429,13 +440,13 @@ This is the current roadmap for the CommandAPI (as of 1st April 2025):
https://github.com/CommandAPI/CommandAPI/issues/578, https://github.com/CommandAPI/CommandAPI/issues/583, https://github.com/CommandAPI/CommandAPI/pull/629 Fixes Bukkit#dispatchCommand() not working after Paper's Brigadier API changes
Fixes PotionEffectArgument.NamespacedKey not having suggestions in some versions
- Website Changes:
-
+ Website Changes:
+
The CommandAPI has a new website: https://commandapi.dev/
-
The CommandAPI has moved from https://github.com/JorelAli/CommandAPI to https://github.com/CommandAPI/CommandAPI
+
The CommandAPI has moved from https://github.com/JorelAli/CommandAPI to https://github.com/CommandAPI/CommandAPI
The CommandAPI's documentation source code is now over at https://github.com/CommandAPI/docs
The CommandAPI's JavaDocs can be viewed over at https://javadocs.commandapi.dev
-
+
diff --git a/commandapi-annotations/pom.xml b/commandapi-annotations/pom.xml
index 8bcdca015..9c707b51c 100644
--- a/commandapi-annotations/pom.xml
+++ b/commandapi-annotations/pom.xml
@@ -18,10 +18,11 @@
dev.jorelcommandapi
- 10.0.1
+ 10.1.0commandapi-annotations
+ CommandAPI - Annotations Library
diff --git a/commandapi-core/pom.xml b/commandapi-core/pom.xml
index a7fec2d6e..b071904f5 100644
--- a/commandapi-core/pom.xml
+++ b/commandapi-core/pom.xml
@@ -19,11 +19,12 @@
commandapidev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-core
+ CommandAPI - Core library
diff --git a/commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml b/commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml
index cb9ca7024..bda964ea3 100644
--- a/commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml
+++ b/commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml
@@ -7,10 +7,11 @@
dev.jorelcommandapi-kotlin
- 10.0.1
+ 10.1.0commandapi-bukkit-kotlin
+ CommandAPI - Bukkit support in Kotlinsrc/main/kotlin
diff --git a/commandapi-kotlin/commandapi-core-kotlin/pom.xml b/commandapi-kotlin/commandapi-core-kotlin/pom.xml
index 94d6d8e0a..66fb5ce47 100644
--- a/commandapi-kotlin/commandapi-core-kotlin/pom.xml
+++ b/commandapi-kotlin/commandapi-core-kotlin/pom.xml
@@ -7,10 +7,11 @@
dev.jorelcommandapi-kotlin
- 10.0.1
+ 10.1.0commandapi-core-kotlin
+ CommandAPI - Bukkit support in Kotlin core librarysrc/main/kotlin
diff --git a/commandapi-kotlin/commandapi-velocity-kotlin/pom.xml b/commandapi-kotlin/commandapi-velocity-kotlin/pom.xml
index 3ef44202f..12cc0da22 100644
--- a/commandapi-kotlin/commandapi-velocity-kotlin/pom.xml
+++ b/commandapi-kotlin/commandapi-velocity-kotlin/pom.xml
@@ -7,10 +7,11 @@
dev.jorelcommandapi-kotlin
- 10.0.1
+ 10.1.0commandapi-velocity-kotlin
+ CommandAPI - Velocity support in Kotlinsrc/main/kotlin
diff --git a/commandapi-kotlin/pom.xml b/commandapi-kotlin/pom.xml
index fe37e4240..0a536da88 100644
--- a/commandapi-kotlin/pom.xml
+++ b/commandapi-kotlin/pom.xml
@@ -6,10 +6,11 @@
dev.jorelcommandapi
- 10.0.1
+ 10.1.0commandapi-kotlin
+ CommandAPI - Kotlin supportpom
\ No newline at end of file
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/pom.xml
index 58db87828..1b41e764a 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/pom.xml
@@ -6,9 +6,12 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.0
+
commandapi-bukkit-core
+ CommandAPI - Bukkit support core library
+
minecraft-libraries
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/PaperCommandRegistration.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/PaperCommandRegistration.java
index d3c7972e4..324b33990 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/PaperCommandRegistration.java
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/PaperCommandRegistration.java
@@ -73,7 +73,14 @@ public class PaperCommandRegistration extends CommandRegistrationStrateg
commandNode = apiCommandMeta.getDeclaredConstructor(PluginMeta.class, String.class, List.class, String.class, boolean.class);
metaFieldHandle = SafeVarHandle.ofOrNull(CommandNode.class, "apiCommandMeta", "apiCommandMeta", apiCommandMeta);
} catch (ClassNotFoundException | NoSuchMethodException e2) {
- commandNode = null;
+ try {
+ // If this happens, the boolean parameter was removed from APICommandMeta
+ Class> apiCommandMeta = Class.forName("io.papermc.paper.command.brigadier.APICommandMeta");
+ commandNode = apiCommandMeta.getDeclaredConstructor(PluginMeta.class, String. class, List.class, String.class);
+ metaFieldHandle = SafeVarHandle.ofOrNull(CommandNode.class, "apiCommandMeta", "apiCommandMeta", apiCommandMeta);
+ } catch (ClassNotFoundException |NoSuchMethodException e3) {
+ commandNode = null;
+ }
}
}
}
@@ -205,8 +212,17 @@ private void setPluginCommandMeta(LiteralCommandNode node) {
CommandAPIBukkit.getConfiguration().getNamespace(), // Don't think this matters actually
false // Indicates a server side only command
));
- } catch (ReflectiveOperationException e1) {
- // This doesn't happen
+ } catch (ReflectiveOperationException | IllegalArgumentException e1) {
+ try {
+ metaField.set(node, pluginCommandNodeConstructor.newInstance(
+ CommandAPIBukkit.getConfiguration().getPlugin().getPluginMeta(),
+ getDescription(node.getLiteral()),
+ getAliasesForCommand(node.getLiteral()),
+ CommandAPIBukkit.getConfiguration().getNamespace() // Probably still doesn't matter
+ ));
+ } catch (ReflectiveOperationException e2) {
+ // This doesn't happen
+ }
}
}
}
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/wrappers/ParticleData.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/wrappers/ParticleData.java
index 779c23f63..6c84576a7 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/wrappers/ParticleData.java
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/wrappers/ParticleData.java
@@ -2,6 +2,8 @@
import org.bukkit.Particle;
+import javax.annotation.Nullable;
+
/**
* A data structure that stores a particle and its corresponding data (or null
* if no data is present)
@@ -15,5 +17,5 @@ public record ParticleData (
* The data that this particle contains, or null if no data is present. This can
* be passed to {@link org.bukkit.World#spawnParticle}
*/
- T data) {
+ @Nullable T data) {
}
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-mojang-mapped/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-mojang-mapped/pom.xml
index 65cce5541..b60eac173 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-mojang-mapped/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-mojang-mapped/pom.xml
@@ -24,9 +24,10 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-mojang-mapped
+ CommandAPI - Bukkit support Mojang-mapped version handler
\ No newline at end of file
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-networking-plugin/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-networking-plugin/pom.xml
index 9281e62c8..31adc9c55 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-networking-plugin/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-networking-plugin/pom.xml
@@ -6,10 +6,11 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.0commandapi-bukkit-networking-plugin
+ CommandAPI - Bukkit support Velocity networking plugin
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.2/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.2/pom.xml
index 67c7dcab3..205c03f91 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.2/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.2/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.20.2
+ CommandAPI - Bukkit support for 1.20.21.20.2-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.3/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.3/pom.xml
index f1a1fb620..c332bd572 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.3/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.3/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.20.3
+ CommandAPI - Bukkit support for 1.20.31.20.4-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.5/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.5/pom.xml
index 689e75433..e0fa52de8 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.5/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20.5/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.20.5
+ CommandAPI - Bukkit support for 1.20.51.20.6-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20/pom.xml
index 90b40263f..dd6c0b3db 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.20/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.20
+ CommandAPI - Bukkit support for 1.201.20.1-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.2/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.2/pom.xml
index 9c94f02cd..c47579793 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.2/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.2/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.21.2
+ CommandAPI - Bukkit support for 1.21.21.21.3-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.4/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.4/pom.xml
index a1ed51f2d..0bb2743d8 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.4/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.4/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.21.4
+ CommandAPI - Bukkit support for 1.21.41.21.4-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.5/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.5/pom.xml
index 252995a93..244995c3a 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.5/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.5/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.21.5
+ CommandAPI - Bukkit support for 1.21.51.21.5-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/pom.xml
new file mode 100644
index 000000000..8a674188f
--- /dev/null
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/pom.xml
@@ -0,0 +1,168 @@
+
+
+
+
+
+ commandapi-bukkit-nms
+ dev.jorel
+ 10.1.0
+
+ 4.0.0
+
+ commandapi-bukkit-1.21.6
+ CommandAPI - Bukkit support for 1.21.6
+
+
+ 1.21.6-R0.1-SNAPSHOT
+ 1.21.6-R0.1-SNAPSHOT
+ 1.21.6-R0.1-SNAPSHOT
+
+
+
+
+ minecraft-libraries
+ https://libraries.minecraft.net
+
+
+ codemc-repo
+ https://repo.codemc.io/repository/nms/
+
+
+ papermc
+ https://repo.papermc.io/repository/maven-public/
+
+
+
+
+
+
+
+ org.spigotmc
+ spigot
+ ${spigot.version}
+ test
+
+
+
+ org.spigotmc
+ spigot
+ ${spigot.version}
+ remapped-mojang
+ provided
+
+
+
+ io.papermc.paper
+ paper-api
+ ${paper.version}
+ provided
+
+
+
+
+ dev.jorel
+ commandapi-bukkit-core
+ ${project.version}
+ compile
+
+
+
+ dev.jorel
+ commandapi-bukkit-nms-common
+ ${project.version}
+ mojang-mapped
+ provided
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ Mojang-Mapped
+
+ jar
+
+
+ mojang-mapped
+
+
+
+
+
+
+ net.md-5
+ specialsource-maven-plugin
+ 2.0.2
+
+
+ package
+
+ remap
+
+ remap-obf
+
+ org.spigotmc:minecraft-server:${minecraft.mappings}:txt:maps-mojang
+ true
+ org.spigotmc:spigot:${minecraft.mappings}:jar:remapped-mojang
+ true
+ remapped-obf
+
+
+
+ package
+
+ remap
+
+ remap-spigot
+
+ ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
+ org.spigotmc:minecraft-server:${minecraft.mappings}:csrg:maps-spigot
+ org.spigotmc:spigot:${minecraft.mappings}:jar:remapped-obf
+
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+
+
+ default-prepare-agent
+
+ prepare-agent
+
+
+
+ report
+ verify
+
+ report
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NMS_1_21_R5.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NMS_1_21_R5.java
new file mode 100644
index 000000000..eb5955349
--- /dev/null
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NMS_1_21_R5.java
@@ -0,0 +1,1155 @@
+/*******************************************************************************
+ * Copyright 2024 Jorel Ali (Skepter) - MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *******************************************************************************/
+package dev.jorel.commandapi.nms;
+
+import com.google.common.collect.ImmutableList;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import com.mojang.brigadier.CommandDispatcher;
+import com.mojang.brigadier.Message;
+import com.mojang.brigadier.arguments.ArgumentType;
+import com.mojang.brigadier.context.CommandContext;
+import com.mojang.brigadier.exceptions.CommandSyntaxException;
+import com.mojang.brigadier.suggestion.SuggestionProvider;
+import com.mojang.brigadier.suggestion.Suggestions;
+import com.mojang.datafixers.util.Pair;
+import com.mojang.logging.LogUtils;
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.DataResult;
+import com.mojang.serialization.JsonOps;
+import dev.jorel.commandapi.CommandAPI;
+import dev.jorel.commandapi.CommandAPIHandler;
+import dev.jorel.commandapi.CommandRegistrationStrategy;
+import dev.jorel.commandapi.PaperCommandRegistration;
+import dev.jorel.commandapi.SafeVarHandle;
+import dev.jorel.commandapi.SpigotCommandRegistration;
+import dev.jorel.commandapi.arguments.ArgumentSubType;
+import dev.jorel.commandapi.arguments.SuggestionProviders;
+import dev.jorel.commandapi.commandsenders.AbstractCommandSender;
+import dev.jorel.commandapi.commandsenders.BukkitCommandSender;
+import dev.jorel.commandapi.commandsenders.BukkitNativeProxyCommandSender;
+import dev.jorel.commandapi.preprocessor.Differs;
+import dev.jorel.commandapi.preprocessor.NMSMeta;
+import dev.jorel.commandapi.preprocessor.RequireField;
+import dev.jorel.commandapi.wrappers.ComplexRecipeImpl;
+import dev.jorel.commandapi.wrappers.FloatRange;
+import dev.jorel.commandapi.wrappers.FunctionWrapper;
+import dev.jorel.commandapi.wrappers.IntegerRange;
+import dev.jorel.commandapi.wrappers.Location2D;
+import dev.jorel.commandapi.wrappers.NativeProxyCommandSender;
+import dev.jorel.commandapi.wrappers.ParticleData;
+import dev.jorel.commandapi.wrappers.Rotation;
+import dev.jorel.commandapi.wrappers.ScoreboardSlot;
+import dev.jorel.commandapi.wrappers.SimpleFunctionWrapper;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
+import net.md_5.bungee.api.chat.BaseComponent;
+import net.md_5.bungee.chat.ComponentSerializer;
+import net.minecraft.advancements.AdvancementHolder;
+import net.minecraft.advancements.critereon.MinMaxBounds;
+import net.minecraft.commands.CommandBuildContext;
+import net.minecraft.commands.CommandResultCallback;
+import net.minecraft.commands.CommandSourceStack;
+import net.minecraft.commands.FunctionInstantiationException;
+import net.minecraft.commands.SharedSuggestionProvider;
+import net.minecraft.commands.arguments.ColorArgument;
+import net.minecraft.commands.arguments.ComponentArgument;
+import net.minecraft.commands.arguments.DimensionArgument;
+import net.minecraft.commands.arguments.EntityArgument;
+import net.minecraft.commands.arguments.MessageArgument;
+import net.minecraft.commands.arguments.ObjectiveArgument;
+import net.minecraft.commands.arguments.ParticleArgument;
+import net.minecraft.commands.arguments.RangeArgument;
+import net.minecraft.commands.arguments.ResourceArgument;
+import net.minecraft.commands.arguments.ResourceKeyArgument;
+import net.minecraft.commands.arguments.ResourceLocationArgument;
+import net.minecraft.commands.arguments.ScoreHolderArgument;
+import net.minecraft.commands.arguments.ScoreboardSlotArgument;
+import net.minecraft.commands.arguments.TeamArgument;
+import net.minecraft.commands.arguments.blocks.BlockStateArgument;
+import net.minecraft.commands.arguments.coordinates.RotationArgument;
+import net.minecraft.commands.arguments.coordinates.Vec2Argument;
+import net.minecraft.commands.arguments.item.FunctionArgument;
+import net.minecraft.commands.arguments.item.ItemArgument;
+import net.minecraft.commands.arguments.item.ItemInput;
+import net.minecraft.commands.arguments.item.ItemPredicateArgument;
+import net.minecraft.commands.arguments.selector.EntitySelector;
+import net.minecraft.commands.execution.ExecutionContext;
+import net.minecraft.commands.functions.CommandFunction;
+import net.minecraft.commands.functions.InstantiatedFunction;
+import net.minecraft.core.Holder;
+import net.minecraft.core.RegistryAccess;
+import net.minecraft.core.particles.BlockParticleOption;
+import net.minecraft.core.particles.ColorParticleOption;
+import net.minecraft.core.particles.DustColorTransitionOptions;
+import net.minecraft.core.particles.DustParticleOptions;
+import net.minecraft.core.particles.ItemParticleOption;
+import net.minecraft.core.particles.ParticleOptions;
+import net.minecraft.core.particles.SculkChargeParticleOptions;
+import net.minecraft.core.particles.ShriekParticleOption;
+import net.minecraft.core.particles.SimpleParticleType;
+import net.minecraft.core.particles.TrailParticleOption;
+import net.minecraft.core.particles.VibrationParticleOption;
+import net.minecraft.core.registries.BuiltInRegistries;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.NbtOps;
+import net.minecraft.network.chat.ComponentSerialization;
+import net.minecraft.resources.RegistryOps;
+import net.minecraft.resources.ResourceKey;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.MinecraftServer.ReloadableResources;
+import net.minecraft.server.ServerFunctionLibrary;
+import net.minecraft.server.ServerFunctionManager;
+import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.server.packs.PackResources;
+import net.minecraft.server.packs.PackType;
+import net.minecraft.server.packs.repository.Pack;
+import net.minecraft.server.packs.repository.PackRepository;
+import net.minecraft.server.packs.resources.MultiPackResourceManager;
+import net.minecraft.server.packs.resources.SimpleReloadInstance;
+import net.minecraft.sounds.SoundEvent;
+import net.minecraft.util.Unit;
+import net.minecraft.util.profiling.Profiler;
+import net.minecraft.util.profiling.ProfilerFiller;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.flag.FeatureFlagSet;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.crafting.RecipeHolder;
+import net.minecraft.world.level.DataPackConfig;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.WorldDataConfiguration;
+import net.minecraft.world.level.block.entity.FuelValues;
+import net.minecraft.world.level.gameevent.BlockPositionSource;
+import net.minecraft.world.level.storage.loot.LootTable;
+import net.minecraft.world.phys.Vec2;
+import net.minecraft.world.phys.Vec3;
+import net.minecraft.world.scores.ScoreHolder;
+import org.bukkit.Bukkit;
+import org.bukkit.Color;
+import org.bukkit.Location;
+import org.bukkit.NamespacedKey;
+import org.bukkit.Particle;
+import org.bukkit.Particle.DustOptions;
+import org.bukkit.Particle.DustTransition;
+import org.bukkit.Particle.Trail;
+import org.bukkit.Registry;
+import org.bukkit.Vibration;
+import org.bukkit.Vibration.Destination;
+import org.bukkit.Vibration.Destination.BlockDestination;
+import org.bukkit.World;
+import org.bukkit.advancement.Advancement;
+import org.bukkit.block.Biome;
+import org.bukkit.block.data.BlockData;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.SimpleCommandMap;
+import org.bukkit.craftbukkit.v1_21_R5.CraftLootTable;
+import org.bukkit.craftbukkit.v1_21_R5.CraftParticle;
+import org.bukkit.craftbukkit.v1_21_R5.CraftServer;
+import org.bukkit.craftbukkit.v1_21_R5.CraftSound;
+import org.bukkit.craftbukkit.v1_21_R5.CraftWorld;
+import org.bukkit.craftbukkit.v1_21_R5.block.data.CraftBlockData;
+import org.bukkit.craftbukkit.v1_21_R5.command.BukkitCommandWrapper;
+import org.bukkit.craftbukkit.v1_21_R5.command.VanillaCommandWrapper;
+import org.bukkit.craftbukkit.v1_21_R5.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_21_R5.help.CustomHelpTopic;
+import org.bukkit.craftbukkit.v1_21_R5.help.SimpleHelpMap;
+import org.bukkit.craftbukkit.v1_21_R5.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.v1_21_R5.potion.CraftPotionEffectType;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.Player;
+import org.bukkit.help.HelpTopic;
+import org.bukkit.inventory.Recipe;
+import org.bukkit.scoreboard.Objective;
+import org.bukkit.scoreboard.Team;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Predicate;
+import java.util.function.ToIntFunction;
+
+// Mojang-Mapped reflection
+
+/**
+ * NMS implementation for Minecraft 1.21.5
+ */
+@NMSMeta(compatibleWith = {"1.21.5"})
+@RequireField(in = SimpleHelpMap.class, name = "helpTopics", ofType = Map.class)
+@RequireField(in = EntitySelector.class, name = "usesSelector", ofType = boolean.class)
+// @RequireField(in = ItemInput.class, name = "tag", ofType = CompoundTag.class)
+@RequireField(in = ServerFunctionLibrary.class, name = "dispatcher", ofType = CommandDispatcher.class)
+@RequireField(in = MinecraftServer.class, name = "fuelValues", ofType = FuelValues.class)
+public class NMS_1_21_R5 extends NMS_Common {
+
+ private static final SafeVarHandle> helpMapTopics;
+ private static final Field entitySelectorUsesSelector;
+ // private static final SafeVarHandle itemInput;
+ private static final Field serverFunctionLibraryDispatcher;
+ private static final MethodHandle minecraftServerSetSelected;
+ private static final boolean vanillaCommandDispatcherFieldExists;
+ private static final SafeVarHandle minecraftServerFuelValues;
+
+ // Derived from net.minecraft.commands.Commands;
+ private static final CommandBuildContext COMMAND_BUILD_CONTEXT;
+
+ // Compute all var handles all in one go so we don't do this during main server
+ // runtime
+ static {
+ if (Bukkit.getServer() instanceof CraftServer server) {
+ COMMAND_BUILD_CONTEXT = CommandBuildContext.simple(server.getServer().registryAccess(),
+ server.getServer().getWorldData().getDataConfiguration().enabledFeatures());
+ } else {
+ COMMAND_BUILD_CONTEXT = null;
+ }
+
+ helpMapTopics = SafeVarHandle.ofOrNull(SimpleHelpMap.class, "helpTopics", "helpTopics", Map.class);
+ // For some reason, MethodHandles fails for this field, but Field works okay
+ entitySelectorUsesSelector = CommandAPIHandler.getField(EntitySelector.class, "p", "usesSelector");
+ // itemInput = SafeVarHandle.ofOrNull(ItemInput.class, "c", "tag", CompoundTag.class);
+ // For some reason, MethodHandles fails for this field, but Field works okay
+ serverFunctionLibraryDispatcher = CommandAPIHandler.getField(ServerFunctionLibrary.class, "h", "dispatcher");
+
+ MethodHandles.Lookup lookup = MethodHandles.lookup();
+ MethodHandle setSelected;
+ try {
+ setSelected = lookup.findVirtual(PackRepository.class, "setSelected", MethodType.methodType(void.class, Collection.class, boolean.class));
+ } catch (NoSuchMethodException | IllegalAccessException e) {
+ // We're on Spigot or Paper 1.21.4 build 62 or earlier
+ setSelected = null;
+ }
+ minecraftServerSetSelected = setSelected;
+
+ boolean fieldExists;
+ try {
+ MinecraftServer.class.getDeclaredField("vanillaCommandDispatcher");
+ fieldExists = true;
+ } catch (NoSuchFieldException | SecurityException e) {
+ // Expected on Paper-1.20.6-65 or later due to https://github.com/PaperMC/Paper/pull/8235
+ fieldExists = false;
+ }
+ vanillaCommandDispatcherFieldExists = fieldExists;
+
+ minecraftServerFuelValues = SafeVarHandle.ofOrNull(MinecraftServer.class, "aE", "fuelValues", FuelValues.class);
+ }
+
+ // Implementation taken from io.papermc.paper.adventure.WrapperAwareSerializer#deserialize(Component)
+ private String toJson(net.minecraft.network.chat.Component component) {
+ MinecraftServer server = this.getMinecraftServer();
+ RegistryAccess.Frozen access = server.registryAccess();
+ RegistryOps ops = access.createSerializationContext(JsonOps.INSTANCE);
+ JsonElement element = ComponentSerialization.CODEC.encodeStart(ops, component)
+ .getOrThrow(s -> new RuntimeException("Failed to encode Minecraft Component: " + component + "; " + s));
+ return new Gson().toJson(element);
+ }
+
+ private net.minecraft.network.chat.Component fromJson(String json) {
+ Pair result = ComponentSerialization.CODEC.decode(JsonOps.INSTANCE, JsonParser.parseString(json))
+ .getOrThrow(s -> new RuntimeException("Failed to decode Component: " + json + "; " + s));
+ return result.getFirst();
+ }
+
+ @Override
+ protected CommandBuildContext getCommandBuildContext() {
+ return COMMAND_BUILD_CONTEXT;
+ }
+
+ @Override
+ public ArgumentType> _ArgumentAdvancement() {
+ return ResourceKeyArgument.key(Registries.ADVANCEMENT);
+ }
+
+ @Override
+ public ArgumentType> _ArgumentChatComponent() {
+ return ComponentArgument.textComponent(COMMAND_BUILD_CONTEXT);
+ }
+
+ @Override
+ public final ArgumentType> _ArgumentEnchantment() {
+ return ResourceArgument.resource(COMMAND_BUILD_CONTEXT, Registries.ENCHANTMENT);
+ }
+
+ @Override
+ public ArgumentType> _ArgumentRecipe() {
+ return ResourceKeyArgument.key(Registries.RECIPE);
+ }
+
+ @Override
+ public final ArgumentType> _ArgumentSyntheticBiome() {
+ return ResourceArgument.resource(COMMAND_BUILD_CONTEXT, Registries.BIOME);
+ }
+
+ @Override
+ public final Map getHelpMap() {
+ return helpMapTopics.get((SimpleHelpMap) Bukkit.getHelpMap());
+ }
+
+ @Override
+ public String[] compatibleVersions() {
+ return new String[]{"1.21.5"};
+ }
+
+ private static String serializeNMSItemStack(ItemStack is) {
+ return new ItemInput(is.getItemHolder(), is.getComponentsPatch()).serialize(COMMAND_BUILD_CONTEXT);
+ }
+
+ @Override
+ public final String convert(org.bukkit.inventory.ItemStack is) {
+ return serializeNMSItemStack(CraftItemStack.asNMSCopy(is));
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ public final String convert(ParticleData> particle) {
+ final ParticleOptions particleOptions = CraftParticle.createParticleParam(particle.particle(), particle.data());
+ final ResourceLocation particleKey = BuiltInRegistries.PARTICLE_TYPE.getKey(particleOptions.getType());
+
+ // /particle dust{scale:2,color:[1,2,2]}
+ // Use the particle option's codec to convert the data into NBT. If we have any tags, add them
+ // to the end, otherwise leave it as it is (e.g. `/particle crit` as opposed to `/particle crit{}`)
+ final Codec codec = particleOptions.getType().codec().codec();
+ final DataResult result = codec.encodeStart(NbtOps.INSTANCE, particleOptions);
+ final CompoundTag particleOptionsTag = result.result().get();
+ final String dataString = particleOptionsTag.keySet().isEmpty() ? "" : particleOptionsTag.toString(); // TODO: Check if this is correct
+ return particleKey.toString() + dataString;
+ }
+
+ /**
+ * An implementation of {@link ServerFunctionManager#execute(CommandFunction, CommandSourceStack)} with a specified
+ * command result callback instead of {@link CommandResultCallback.EMPTY}
+ *
+ * @param commandFunction the command function to run
+ * @param css the command source stack to execute this command
+ * @return the result of our function. This is either 0 is the command failed, or greater than 0 if the command succeeded
+ */
+ private final int runCommandFunction(CommandFunction commandFunction, CommandSourceStack css) {
+ // Profile the function. We want to simulate the execution sequence exactly
+ ProfilerFiller profiler = Profiler.get();
+ profiler.push(() -> "function " + commandFunction.id());
+
+ // Store our function result
+ AtomicInteger result = new AtomicInteger();
+ CommandResultCallback onCommandResult = (succeeded, resultValue) -> result.set(resultValue);
+
+ try {
+ final InstantiatedFunction instantiatedFunction = commandFunction.instantiate((CompoundTag) null, this.getBrigadierDispatcher());
+ net.minecraft.commands.Commands.executeCommandInContext(css, (executioncontext) -> {
+ ExecutionContext.queueInitialFunctionCall(executioncontext, instantiatedFunction, css, onCommandResult);
+ });
+ } catch (FunctionInstantiationException functionInstantiationException) {
+ // We don't care if the function failed to instantiate
+ assert true;
+ } catch (Exception exception) {
+ LogUtils.getLogger().warn("Failed to execute function {}", commandFunction.id(), exception);
+ } finally {
+ profiler.pop();
+ }
+
+ return result.get();
+ }
+
+ // Converts NMS function to SimpleFunctionWrapper
+ private final SimpleFunctionWrapper convertFunction(CommandFunction commandFunction) {
+ ToIntFunction appliedObj = (CommandSourceStack css) -> runCommandFunction(commandFunction, css);
+
+ // Unpack the commands by instantiating the function with no CSS, then retrieving its entries
+ String[] commands = new String[0];
+ try {
+ final InstantiatedFunction instantiatedFunction = commandFunction.instantiate((CompoundTag) null, this.getBrigadierDispatcher());
+
+ List> cArr = instantiatedFunction.entries();
+ commands = new String[cArr.size()];
+ for (int i = 0, size = cArr.size(); i < size; i++) {
+ commands[i] = cArr.get(i).toString();
+ }
+ } catch (FunctionInstantiationException functionInstantiationException) {
+ // We don't care if the function failed to instantiate
+ assert true;
+ }
+ return new SimpleFunctionWrapper(fromResourceLocation(commandFunction.id()), appliedObj, commands);
+ }
+
+ @Override
+ public final HelpTopic generateHelpTopic(String commandName, String shortDescription, String fullDescription,
+ String permission) {
+ return new CustomHelpTopic(commandName, shortDescription, fullDescription, permission);
+ }
+
+ @Override
+ public Advancement getAdvancement(CommandContext cmdCtx, String key)
+ throws CommandSyntaxException {
+ return ResourceKeyArgument.getAdvancement(cmdCtx, key).toBukkit();
+ }
+
+ @Differs(from = "1.21.5", by = "#toJson is now implemented in this class")
+ @Override
+ public Component getAdventureChat(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ return GsonComponentSerializer.gson().deserialize(this.toJson(MessageArgument.getMessage(cmdCtx, key)));
+ }
+
+ @Override
+ public NamedTextColor getAdventureChatColor(CommandContext cmdCtx, String key) {
+ final Integer color = ColorArgument.getColor(cmdCtx, key).getColor();
+ return color == null ? NamedTextColor.WHITE : NamedTextColor.namedColor(color);
+ }
+
+ @Differs(from = "1.21.5", by = "#toJson is now implemented in this class")
+ @Override
+ public final Component getAdventureChatComponent(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ return GsonComponentSerializer.gson()
+ .deserialize(this.toJson(ComponentArgument.getResolvedComponent(cmdCtx, key)));
+ }
+
+ @Override
+ public final Object getBiome(CommandContext cmdCtx, String key, ArgumentSubType subType)
+ throws CommandSyntaxException {
+ final ResourceLocation resourceLocation = ResourceArgument.getResource(cmdCtx, key, Registries.BIOME).key()
+ .location();
+ return switch (subType) {
+ case BIOME_BIOME -> {
+ Biome biome = null;
+ try {
+ biome = Biome.valueOf(resourceLocation.getPath().toUpperCase());
+ } catch (IllegalArgumentException biomeNotFound) {
+ biome = null;
+ }
+ yield biome;
+ }
+ case BIOME_NAMESPACEDKEY -> (NamespacedKey) fromResourceLocation(resourceLocation);
+ default -> null;
+ };
+ }
+
+ @Override
+ public final BlockData getBlockState(CommandContext cmdCtx, String key) {
+ return CraftBlockData.fromData(BlockStateArgument.getBlock(cmdCtx, key).getState());
+ }
+
+ @Override
+ public CommandSourceStack getBrigadierSourceFromCommandSender(
+ AbstractCommandSender extends CommandSender> sender) {
+ return VanillaCommandWrapper.getListener(sender.getSource());
+ }
+
+ @Differs(from = "1.21.5", by = "#toJson is now implemented in this class")
+ @Override
+ public final BaseComponent[] getChat(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ return ComponentSerializer.parse(this.toJson(MessageArgument.getMessage(cmdCtx, key)));
+ }
+
+ @Differs(from = "1.21.5", by = "#toJson is now implemented in this class")
+ @Override
+ public final BaseComponent[] getChatComponent(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ return ComponentSerializer.parse(this.toJson(ComponentArgument.getResolvedComponent(cmdCtx, key)));
+ }
+
+ @Override
+ public final World getDimension(CommandContext cmdCtx, String key)
+ throws CommandSyntaxException {
+ return DimensionArgument.getDimension(cmdCtx, key).getWorld();
+ }
+
+ @Override
+ public final Enchantment getEnchantment(CommandContext cmdCtx, String key)
+ throws CommandSyntaxException {
+ final net.minecraft.world.item.enchantment.Enchantment enchantment = ResourceArgument.getEnchantment(cmdCtx, key).value();
+ final ResourceLocation resource = this.getMinecraftServer().registryAccess().lookupOrThrow(Registries.ENCHANTMENT).getKey(enchantment);
+ return Registry.ENCHANTMENT.get(fromResourceLocation(resource));
+ }
+
+ @Override
+ public final Object getEntitySelector(CommandContext cmdCtx, String str,
+ ArgumentSubType subType, boolean allowEmpty) throws CommandSyntaxException {
+
+ // We override the rule whereby players need "minecraft.command.selector" and
+ // have to have level 2 permissions in order to use entity selectors. We're
+ // trying to allow entity selectors to be used by anyone that registers a
+ // command via the CommandAPI.
+ EntitySelector argument = cmdCtx.getArgument(str, EntitySelector.class);
+ try {
+ entitySelectorUsesSelector.set(argument, false);
+ } catch (IllegalAccessException e) {
+ // Shouldn't happen, CommandAPIHandler#getField makes it accessible
+ }
+
+ return switch (subType) {
+ case ENTITYSELECTOR_MANY_ENTITIES:
+ try {
+ List result = new ArrayList<>();
+ for (Entity entity : argument.findEntities(cmdCtx.getSource())) {
+ result.add(entity.getBukkitEntity());
+ }
+ if (result.isEmpty() && !allowEmpty) {
+ throw EntityArgument.NO_ENTITIES_FOUND.create();
+ } else {
+ yield result;
+ }
+ } catch (CommandSyntaxException e) {
+ if (allowEmpty) {
+ yield new ArrayList();
+ } else {
+ throw e;
+ }
+ }
+ case ENTITYSELECTOR_MANY_PLAYERS:
+ try {
+ List result = new ArrayList<>();
+ for (ServerPlayer player : argument.findPlayers(cmdCtx.getSource())) {
+ result.add(player.getBukkitEntity());
+ }
+ if (result.isEmpty() && !allowEmpty) {
+ throw EntityArgument.NO_PLAYERS_FOUND.create();
+ } else {
+ yield result;
+ }
+ } catch (CommandSyntaxException e) {
+ if (allowEmpty) {
+ yield new ArrayList();
+ } else {
+ throw e;
+ }
+ }
+ case ENTITYSELECTOR_ONE_ENTITY:
+ yield argument.findSingleEntity(cmdCtx.getSource()).getBukkitEntity();
+ case ENTITYSELECTOR_ONE_PLAYER:
+ yield argument.findSinglePlayer(cmdCtx.getSource()).getBukkitEntity();
+ default:
+ throw new IllegalArgumentException("Unexpected value: " + subType);
+ };
+ }
+
+ @Override
+ public FloatRange getFloatRange(CommandContext cmdCtx, String key) {
+ MinMaxBounds.Doubles range = RangeArgument.Floats.getRange(cmdCtx, key);
+ final Double lowBoxed = range.min().orElse(null);
+ final Double highBoxed = range.max().orElse(null);
+ final double low = lowBoxed == null ? -Float.MAX_VALUE : lowBoxed;
+ final double high = highBoxed == null ? Float.MAX_VALUE : highBoxed;
+ return new FloatRange((float) low, (float) high);
+ }
+
+ @Override
+ public final FunctionWrapper[] getFunction(CommandContext cmdCtx, String key)
+ throws CommandSyntaxException {
+ List result = new ArrayList<>();
+ CommandSourceStack css = cmdCtx.getSource().withSuppressedOutput().withMaximumPermission(2);
+
+ for (CommandFunction commandFunction : FunctionArgument.getFunctions(cmdCtx, key)) {
+ result.add(FunctionWrapper.fromSimpleFunctionWrapper(convertFunction(commandFunction), css,
+ entity -> cmdCtx.getSource().withEntity(((CraftEntity) entity).getHandle())));
+ }
+ return result.toArray(new FunctionWrapper[0]);
+ }
+
+ @Override
+ public SimpleFunctionWrapper getFunction(NamespacedKey key) {
+ final ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(key.getNamespace(), key.getKey());
+ Optional> commandFunctionOptional = this
+ .getMinecraftServer().getFunctions().get(resourceLocation);
+ if (commandFunctionOptional.isPresent()) {
+ return convertFunction(commandFunctionOptional.get());
+ } else {
+ throw new IllegalStateException("Failed to get defined function " + key
+ + "! This should never happen - please report this to the CommandAPI"
+ + "developers, we'd love to know how you got this error message!");
+ }
+ }
+
+ @Override
+ public Set getFunctions() {
+ Set result = new HashSet<>();
+ for (ResourceLocation resourceLocation : this.getMinecraftServer().getFunctions()
+ .getFunctionNames()) {
+ result.add(fromResourceLocation(resourceLocation));
+ }
+ return result;
+ }
+
+ @Override
+ public IntegerRange getIntRange(CommandContext cmdCtx, String key) {
+ MinMaxBounds.Ints range = RangeArgument.Ints.getRange(cmdCtx, key);
+ final Integer lowBoxed = range.min().orElse(null);
+ final Integer highBoxed = range.max().orElse(null);
+ final int low = lowBoxed == null ? Integer.MIN_VALUE : lowBoxed;
+ final int high = highBoxed == null ? Integer.MAX_VALUE : highBoxed;
+ return new IntegerRange(low, high);
+ }
+
+ @Override
+ public final org.bukkit.inventory.ItemStack getItemStack(CommandContext cmdCtx, String key)
+ throws CommandSyntaxException {
+ ItemInput input = ItemArgument.getItem(cmdCtx, key);
+
+ // Create the basic ItemStack with an amount of 1
+ net.minecraft.world.item.ItemStack item = input.createItemStack(1, false);
+ return CraftItemStack.asBukkitCopy(item);
+ }
+
+ @Override
+ public final Predicate getItemStackPredicate(
+ CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ // Not inside the lambda because getItemPredicate throws CommandSyntaxException
+ Predicate predicate = ItemPredicateArgument.getItemPredicate(cmdCtx, key);
+ return item -> predicate.test(CraftItemStack.asNMSCopy(item));
+ }
+
+ @Override
+ public final Location2D getLocation2DPrecise(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ Vec2 vecPos = Vec2Argument.getVec2(cmdCtx, key);
+ return new Location2D(getWorldForCSS(cmdCtx.getSource()), vecPos.x, vecPos.y);
+ }
+
+ @Override
+ public final org.bukkit.loot.LootTable getLootTable(CommandContext cmdCtx, String key) {
+ return CraftLootTable.minecraftToBukkit(ResourceLocationArgument.getId(cmdCtx, key));
+ }
+
+ @Override
+ public NamespacedKey getMinecraftKey(CommandContext cmdCtx, String key) {
+ return fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
+ }
+
+ @Override
+ public final Objective getObjective(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ String objectiveName = ObjectiveArgument.getObjective(cmdCtx, key).getName();
+ return Bukkit.getScoreboardManager().getMainScoreboard().getObjective(objectiveName);
+ }
+
+ @Override
+ public final ParticleData> getParticle(CommandContext cmdCtx, String key) {
+ final ParticleOptions particleOptions = ParticleArgument.getParticle(cmdCtx, key);
+
+ // In our test suite, we can't parse particles via CraftParticle.minecraftToBukkit
+ // on 1.20.3+ because initializing CraftParticle's static constructor requires
+ // implementing a registry. We don't care about a registry for the sake of testing,
+ // all we're actually interested in is testing that the particle data is being parsed
+ // and converted to Bukkit properly, because that's what actually matters. If the
+ // Bukkit#getServer is a CraftServer, that means we're running on a normal (Bukkit/Spigot/Paper)
+ // server. If it isn't, that means we're running in our test environment (i.e. a mocked
+ // server instance), or some weird flavour of Bukkit that we're not supposed to use.
+ final Particle particle;
+ if (Bukkit.getServer() instanceof CraftServer server) {
+ particle = CraftParticle.minecraftToBukkit(particleOptions.getType());
+ } else {
+ particle = null;
+ }
+
+ if (particleOptions instanceof SimpleParticleType) {
+ return new ParticleData(particle, null);
+ } else if (particleOptions instanceof BlockParticleOption options) {
+ return new ParticleData(particle, CraftBlockData.fromData(options.getState()));
+ } else if (particleOptions instanceof DustColorTransitionOptions options) {
+ return getParticleDataAsDustColorTransitionOption(particle, options);
+ } else if (particleOptions instanceof DustParticleOptions options) {
+ final Color color = Color.fromRGB((int) (options.getColor().x() * 255.0F),
+ (int) (options.getColor().y() * 255.0F), (int) (options.getColor().z() * 255.0F));
+ return new ParticleData(particle, new DustOptions(color, options.getScale()));
+ } else if (particleOptions instanceof ItemParticleOption options) {
+ return new ParticleData(particle,
+ CraftItemStack.asBukkitCopy(options.getItem()));
+ } else if (particleOptions instanceof VibrationParticleOption options) {
+ return getParticleDataAsVibrationParticleOption(cmdCtx, particle, options);
+ } else if (particleOptions instanceof ShriekParticleOption options) {
+ // CraftBukkit implements shriek particles as a (boxed) Integer object
+ return new ParticleData(particle, Integer.valueOf(options.getDelay()));
+ } else if (particleOptions instanceof SculkChargeParticleOptions options) {
+ // CraftBukkit implements sculk charge particles as a (boxed) Float object
+ return new ParticleData(particle, Float.valueOf(options.roll()));
+ } else if (particleOptions instanceof ColorParticleOption options) {
+ return getParticleDataAsColorParticleOption(particle, options);
+ } else if (particleOptions instanceof TrailParticleOption options) {
+ return getParticleDataAsTrailParticleOption(cmdCtx, particle, options);
+ } else {
+ CommandAPI.getLogger().warning("Invalid particle data type for " + particle.getDataType().toString());
+ return new ParticleData(particle, null);
+ }
+ }
+
+ private ParticleData getParticleDataAsTrailParticleOption(CommandContext cmdCtx,
+ Particle particle, TrailParticleOption options) {
+ final Level level = cmdCtx.getSource().getLevel();
+ final Vec3 target = options.target();
+ final Location targetLocation = new Location(level.getWorld(), target.x, target.y, target.z);
+ final Color color = Color.fromARGB(options.color());
+ return new ParticleData(particle, new Trail(targetLocation, color, options.duration()));
+ }
+
+ private ParticleData getParticleDataAsColorParticleOption(Particle particle,
+ ColorParticleOption options) {
+ final Color color = Color.fromARGB(
+ (int) (options.getAlpha() * 255.0F),
+ (int) (options.getRed() * 255.0F),
+ (int) (options.getGreen() * 255.0F),
+ (int) (options.getBlue() * 255.0F)
+ );
+ return new ParticleData(particle, color);
+ }
+
+ private ParticleData getParticleDataAsDustColorTransitionOption(Particle particle,
+ DustColorTransitionOptions options) {
+ final Color color = Color.fromRGB((int) (options.getFromColor().x() * 255.0F),
+ (int) (options.getFromColor().y() * 255.0F), (int) (options.getFromColor().z() * 255.0F));
+ final Color toColor = Color.fromRGB((int) (options.getToColor().x() * 255.0F),
+ (int) (options.getToColor().y() * 255.0F), (int) (options.getToColor().z() * 255.0F));
+ return new ParticleData(particle, new DustTransition(color, toColor, options.getScale()));
+ }
+
+ private ParticleData> getParticleDataAsVibrationParticleOption(CommandContext cmdCtx,
+ Particle particle, VibrationParticleOption options) {
+ // The "from" part of the Vibration object in Bukkit is completely ignored now,
+ // so we just populate it with some "feasible" information
+ final Vec3 origin = cmdCtx.getSource().getPosition();
+ Level level = cmdCtx.getSource().getLevel();
+ Location from = new Location(level.getWorld(), origin.x, origin.y, origin.z);
+ final Destination destination;
+
+ if (options.getDestination() instanceof BlockPositionSource positionSource) {
+ Vec3 to = positionSource.getPosition(level).get();
+ destination = new BlockDestination(new Location(level.getWorld(), to.x(), to.y(), to.z()));
+ } else {
+ CommandAPI.getLogger().warning("Unknown or unsupported vibration destination " + options.getDestination());
+ return new ParticleData(particle, null);
+ }
+ return new ParticleData(particle, new Vibration(from, destination, options.getArrivalInTicks()));
+ }
+
+ @Override
+ public Object getPotionEffect(CommandContext cmdCtx, String key, ArgumentSubType subType) throws CommandSyntaxException {
+ return switch (subType) {
+ case POTION_EFFECT_POTION_EFFECT ->
+ CraftPotionEffectType.minecraftToBukkit(ResourceArgument.getMobEffect(cmdCtx, key).value());
+ case POTION_EFFECT_NAMESPACEDKEY -> fromResourceLocation(ResourceLocationArgument.getId(cmdCtx, key));
+ default -> throw new IllegalArgumentException("Unexpected value: " + subType);
+ };
+ }
+
+ @Override
+ public final Recipe getRecipe(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ RecipeHolder> recipe = ResourceKeyArgument.getRecipe(cmdCtx, key);
+ return new ComplexRecipeImpl(fromResourceLocation(recipe.id().registry()), recipe.toBukkitRecipe());
+ }
+
+ @Override
+ public final Rotation getRotation(CommandContext cmdCtx, String key) {
+ Vec2 rotation = RotationArgument.getRotation(cmdCtx, key).getRotation(cmdCtx.getSource());
+ return new Rotation(rotation.y, rotation.x);
+ }
+
+ @Override
+ public ScoreboardSlot getScoreboardSlot(CommandContext cmdCtx, String key) {
+ return ScoreboardSlot.ofMinecraft(ScoreboardSlotArgument.getDisplaySlot(cmdCtx, key).id());
+ }
+
+ @Override
+ public Collection getScoreHolderMultiple(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ final Collection scoreHolders = ScoreHolderArgument.getNames(cmdCtx, key);
+ Set scoreHolderNames = new HashSet<>();
+ for (ScoreHolder scoreHolder : scoreHolders) {
+ scoreHolderNames.add(scoreHolder.getScoreboardName());
+ }
+ return scoreHolderNames;
+ }
+
+ @Override
+ public String getScoreHolderSingle(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ return ScoreHolderArgument.getName(cmdCtx, key).getScoreboardName();
+ }
+
+ @Override
+ public BukkitCommandSender extends CommandSender> getSenderForCommand(CommandContext cmdCtx, boolean isNative) {
+ CommandSourceStack css = cmdCtx.getSource();
+
+ CommandSender sender = css.getBukkitSender();
+ if (sender == null) {
+ // Sender CANNOT be null. This can occur when using a remote console
+ // sender. You can access it directly using
+ // this.getMinecraftServer().remoteConsole
+ // however this may also be null, so delegate to the next most-meaningful
+ // sender.
+ sender = Bukkit.getConsoleSender();
+ }
+
+ Entity proxyEntity = css.getEntity();
+ CommandSender proxy = proxyEntity == null ? null : proxyEntity.getBukkitEntity();
+ if (isNative || (proxy != null && !sender.equals(proxy))) {
+ if (proxy == null) {
+ proxy = sender;
+ }
+
+ return new BukkitNativeProxyCommandSender(new NativeProxyCommandSender_1_21_R5(css, sender, proxy));
+ } else {
+ return wrapCommandSender(sender);
+ }
+ }
+
+ @Override
+ public NativeProxyCommandSender createNativeProxyCommandSender(CommandSender caller, CommandSender callee, Location location, World world) {
+ if (callee == null) callee = caller;
+
+ // Most parameters default to what is defined by the caller
+ CommandSourceStack css = getBrigadierSourceFromCommandSender(wrapCommandSender(caller));
+
+ // Position and rotation may be overridden by the Location
+ if (location != null) {
+ css = css
+ .withPosition(new Vec3(location.getX(), location.getY(), location.getZ()))
+ .withRotation(new Vec2(location.getPitch(), location.getYaw()));
+ }
+
+ // ServerLevel may be overridden by the World
+ if (world == null && location != null) {
+ world = location.getWorld();
+ }
+ if (world != null) {
+ css = css.withLevel(((CraftWorld) world).getHandle());
+ }
+
+ // The proxied sender can only be an Entity in the CommandSourceStack
+ if (callee instanceof org.bukkit.entity.Entity e) {
+ css = css.withEntity(((CraftEntity) e).getHandle());
+ }
+
+ return new NativeProxyCommandSender_1_21_R5(css, caller, callee);
+ }
+
+ @Override
+ public final SimpleCommandMap getSimpleCommandMap() {
+ return ((CraftServer) Bukkit.getServer()).getCommandMap();
+ }
+
+ @Override
+ public final Object getSound(CommandContext cmdCtx, String key, ArgumentSubType subType) {
+ final ResourceLocation soundResource = ResourceLocationArgument.getId(cmdCtx, key);
+ return switch (subType) {
+ case SOUND_SOUND -> {
+ final Optional> soundEvent = BuiltInRegistries.SOUND_EVENT.get(soundResource);
+ if (soundEvent.isEmpty()) {
+ yield null;
+ } else {
+ yield CraftSound.minecraftToBukkit(soundEvent.get().value());
+ }
+ }
+ case SOUND_NAMESPACEDKEY -> {
+ yield NamespacedKey.fromString(soundResource.getNamespace() + ":" + soundResource.getPath());
+ }
+ default -> throw new IllegalArgumentException("Unexpected value: " + subType);
+ };
+ }
+
+ @Differs(from = "1.21.5", by = "Suggestion providers are per command context, not globally defined")
+ @Override
+ public SuggestionProvider getSuggestionProvider(SuggestionProviders provider) {
+ return switch (provider) {
+ case FUNCTION -> (context, builder) -> {
+ ServerFunctionManager functionData = this.getMinecraftServer().getFunctions();
+ SharedSuggestionProvider.suggestResource(functionData.getTagNames(), builder, "#");
+ return SharedSuggestionProvider.suggestResource(functionData.getFunctionNames(), builder);
+ };
+ case RECIPES -> (cmdCtx, builder) -> SharedSuggestionProvider.suggestResource(this.getMinecraftServer().getRecipeManager()
+ .getRecipes().stream().map(holder -> holder.id().location()), builder);
+ case SOUNDS ->
+ (cmdCtx, builder) -> SharedSuggestionProvider.suggestResource(cmdCtx.getSource().getAvailableSounds(), builder);
+ case ADVANCEMENTS -> (cmdCtx, builder) -> SharedSuggestionProvider.suggestResource(this.getMinecraftServer().getAdvancements()
+ .getAllAdvancements().stream().map(AdvancementHolder::id), builder);
+ case LOOT_TABLES ->
+ (cmdCtx, builder) -> {
+ // TODO: Test this actually works
+ final List LootTableKeys = this.getMinecraftServer().reloadableRegistries().lookup().lookupOrThrow(Registries.LOOT_TABLE).listElementIds().map(ResourceKey::location).toList();
+ return SharedSuggestionProvider.suggestResource(LootTableKeys, builder);
+ };
+ case BIOMES -> _ArgumentSyntheticBiome()::listSuggestions;
+ case ENTITIES -> (cmdCtx, builder) -> SharedSuggestionProvider.suggestResource(
+ BuiltInRegistries.ENTITY_TYPE
+ .stream()
+ .filter(type -> type.isEnabled(cmdCtx.getSource().enabledFeatures()) && type.canSummon()),
+ builder, EntityType::getKey, EntityType::getDescription
+ );
+ case POTION_EFFECTS ->
+ (context, builder) -> SharedSuggestionProvider.suggestResource(BuiltInRegistries.MOB_EFFECT.keySet(), builder);
+ };
+ }
+
+ @Override
+ public final SimpleFunctionWrapper[] getTag(NamespacedKey key) {
+ Collection> customFunctions = this.getMinecraftServer().getFunctions().getTag(ResourceLocation.fromNamespaceAndPath(key.getNamespace(), key.getKey()));
+ SimpleFunctionWrapper[] convertedCustomFunctions = new SimpleFunctionWrapper[customFunctions.size()];
+ int index = 0;
+ for (CommandFunction customFunction : customFunctions) {
+ convertedCustomFunctions[index++] = convertFunction(customFunction);
+ }
+ return convertedCustomFunctions;
+ }
+
+ @Override
+ public Set getTags() {
+ Set result = new HashSet<>();
+ for (ResourceLocation resourceLocation : this.getMinecraftServer().getFunctions().getTagNames()) {
+ result.add(fromResourceLocation(resourceLocation));
+ }
+ return result;
+ }
+
+ @Override
+ public final Team getTeam(CommandContext cmdCtx, String key) throws CommandSyntaxException {
+ String teamName = TeamArgument.getTeam(cmdCtx, key).getName();
+ return Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName);
+ }
+
+ @Override
+ public World getWorldForCSS(CommandSourceStack css) {
+ return (css.getLevel() == null) ? null : css.getLevel().getWorld();
+ }
+
+ @Override
+ public final void reloadDataPacks() {
+ CommandAPI.logNormal("Reloading datapacks...");
+
+ // Get previously declared recipes to be re-registered later
+ Iterator recipes = Bukkit.recipeIterator();
+
+ // Update the commandDispatcher with the current server's commandDispatcher
+ ReloadableResources serverResources = this.getMinecraftServer().resources;
+ serverResources.managers().commands = this.getMinecraftServer().getCommands();
+
+ // Update the ServerFunctionLibrary's command dispatcher with the new one
+ try {
+ serverFunctionLibraryDispatcher.set(serverResources.managers().getFunctionLibrary(),
+ getBrigadierDispatcher());
+ } catch (IllegalAccessException ignored) {
+ // Shouldn't happen, CommandAPIHandler#getField makes it accessible
+ }
+
+ // From this.getMinecraftServer().reloadResources //
+ // Discover new packs
+ Collection collection;
+ {
+ List packIDs = new ArrayList<>(
+ this.getMinecraftServer().getPackRepository().getSelectedIds());
+ List disabledPacks = this.getMinecraftServer().getWorldData()
+ .getDataConfiguration().dataPacks().getDisabled();
+
+ for (String availablePack : this.getMinecraftServer().getPackRepository()
+ .getAvailableIds()) {
+ // Add every other available pack that is not disabled
+ // and is not already in the list of existing packs
+ if (!disabledPacks.contains(availablePack) && !packIDs.contains(availablePack)) {
+ packIDs.add(availablePack);
+ }
+ }
+ collection = packIDs;
+ }
+
+ // Step 1: Construct an async supplier of a list of all resource packs to
+ // be loaded in the reload phase
+ CompletableFuture> first = CompletableFuture.supplyAsync(() -> {
+ PackRepository serverPackRepository = this.getMinecraftServer().getPackRepository();
+
+ List packResources = new ArrayList<>();
+ for (String packID : collection) {
+ Pack pack = serverPackRepository.getPack(packID);
+ if (pack != null) {
+ packResources.add(pack.open());
+ }
+ }
+ return packResources;
+ }).exceptionally(exception -> {
+ CommandAPI.logException("Something went wrong while trying to collect resource packs!", exception);
+ // Return all currently selected packs
+ return this.getMinecraftServer().getPackRepository().openAllSelected();
+ });
+
+ // Step 2: Convert all of the resource packs into ReloadableResources which
+ // are replaced by our custom server resources with defined commands
+ CompletableFuture second = first.thenCompose(packResources -> {
+ MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA,
+ packResources);
+
+ // TODO: I'm not sure if this is sufficient anymore - Do we not want to load tags for existing
+ // registries here as well?
+ // List> TagList = TagLoader.loadTagsForExistingRegistries(resourceManager, this.getMinecraftServer().registries().compositeAccess());
+
+ // Not using packResources, because we really really want this to work
+ CompletableFuture> simpleReloadInstance = SimpleReloadInstance.create(resourceManager,
+ serverResources.managers().listeners(), this.getMinecraftServer().executor,
+ this.getMinecraftServer(), CompletableFuture
+ .completedFuture(Unit.INSTANCE) /* ReloadableServerResources.DATA_RELOAD_INITIAL_TASK */,
+ LogUtils.getLogger().isDebugEnabled()).done();
+
+ return simpleReloadInstance.thenApply(x -> serverResources);
+ }).exceptionally(exception -> {
+ CommandAPI.logException("Something went wrong while trying to convert resource packs into ReloadableResources", exception);
+ // Return existing resources
+ return this.getMinecraftServer().resources;
+ });
+
+ // Step 3: Actually load all of the resources
+ CompletableFuture third = second.thenAcceptAsync(resources -> {
+ this.getMinecraftServer().resources.close();
+ this.getMinecraftServer().resources = serverResources;
+ this.getMinecraftServer().server.syncCommands();
+ if (minecraftServerSetSelected == null) {
+ this.getMinecraftServer().getPackRepository().setSelected(collection);
+ } else {
+ try {
+ minecraftServerSetSelected.invoke(this.getMinecraftServer().getPackRepository(), collection, true);
+ } catch (Throwable e) {
+ CommandAPI.logException("Something went wrong while trying to invoke PackRepository#setSelected(Collection, boolean)", e);
+ }
+ }
+
+ final FeatureFlagSet enabledFeatures = this.getMinecraftServer().getWorldData().getDataConfiguration().enabledFeatures();
+
+ // this.getMinecraftServer().getSelectedPacks
+ Collection selectedIDs = this.getMinecraftServer().getPackRepository()
+ .getSelectedIds();
+ List enabledIDs = ImmutableList.copyOf(selectedIDs);
+ List disabledIDs = new ArrayList<>(
+ this.getMinecraftServer().getPackRepository().getAvailableIds());
+
+ disabledIDs.removeIf(enabledIDs::contains);
+
+ this.getMinecraftServer().getWorldData()
+ .setDataConfiguration(new WorldDataConfiguration(new DataPackConfig(enabledIDs, disabledIDs), enabledFeatures));
+ // this.getMinecraftServer().resources.managers().updateRegistryTags(registryAccess);
+ this.getMinecraftServer().resources.managers().updateStaticRegistryTags(); // TODO: Review this
+ this.getMinecraftServer().resources.managers().getRecipeManager().finalizeRecipeLoading(enabledFeatures);
+
+ // May need to be commented out, may not. Comment it out just in case.
+ // For some reason, calling getPlayerList().saveAll() may just hang
+ // the server indefinitely. Not sure why!
+ // this.getMinecraftServer().getPlayerList().saveAll();
+ // this.getMinecraftServer().getPlayerList().reloadResources();
+ // this.getMinecraftServer().getFunctions().replaceLibrary(this.getMinecraftServer().resources.managers().getFunctionLibrary());
+ this.getMinecraftServer().getStructureManager()
+ .onResourceManagerReload(this.getMinecraftServer().resources.resourceManager());
+
+ // Set fuel values with the new loaded fuel values from the list of enabled features
+ minecraftServerFuelValues.set(this.getMinecraftServer(),
+ FuelValues.vanillaBurnTimes(this.getMinecraftServer().registries().compositeAccess(),
+ enabledFeatures
+ )
+ );
+ }).exceptionally(exception -> {
+ CommandAPI.logException("Something went wrong while trying to load resources.", exception);
+ return null;
+ });
+
+ // Step 4: Block the thread until everything's done
+ if (this.getMinecraftServer().isSameThread()) {
+ this.getMinecraftServer().managedBlock(third::isDone);
+ }
+
+ // Run the completableFuture (and bind tags?)
+ try {
+
+ // Register recipes again because reloading datapacks
+ // removes all non-vanilla recipes
+ registerBukkitRecipesSafely(recipes);
+
+ CommandAPI.logNormal("Finished reloading datapacks");
+ } catch (Exception e) {
+ StringWriter stringWriter = new StringWriter();
+ PrintWriter printWriter = new PrintWriter(stringWriter);
+ e.printStackTrace(printWriter);
+
+ CommandAPI.logError(
+ "Failed to load datapacks, can't proceed with normal server load procedure. Try fixing your datapacks?\n"
+ + stringWriter.toString());
+ }
+ }
+
+ @Differs(from = "1.21.5", by = "#toJson is now implemented in this class")
+ @Override
+ public Message generateMessageFromJson(String json) {
+ return this.fromJson(json);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public T getMinecraftServer() {
+ if (Bukkit.getServer() instanceof CraftServer server) {
+ return (T) server.getServer();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public ArgumentType> _ArgumentMobEffect() {
+ return ResourceArgument.resource(COMMAND_BUILD_CONTEXT, Registries.MOB_EFFECT);
+ }
+
+ @Override
+ public ArgumentType> _ArgumentEntitySummon() {
+ return ResourceArgument.resource(COMMAND_BUILD_CONTEXT, Registries.ENTITY_TYPE);
+ }
+
+ @Override
+ public CommandRegistrationStrategy createCommandRegistrationStrategy() {
+ if (vanillaCommandDispatcherFieldExists) {
+ return new SpigotCommandRegistration<>(
+ this.getMinecraftServer().vanillaCommandDispatcher.getDispatcher(),
+ (SimpleCommandMap) getPaper().getCommandMap(),
+ () -> this.getMinecraftServer().getCommands().getDispatcher(),
+ command -> command instanceof VanillaCommandWrapper,
+ node -> new VanillaCommandWrapper(this.getMinecraftServer().vanillaCommandDispatcher, node),
+ node -> node.getCommand() instanceof BukkitCommandWrapper
+ );
+ } else {
+ // This class is Paper-server specific, so we need to use paper's userdev plugin to
+ // access it directly. That might need gradle, but there might also be a maven version?
+ // https://discord.com/channels/289587909051416579/1121227200277004398/1246910745761812480
+ Class> bukkitCommandNode_bukkitBrigCommand;
+ try {
+ bukkitCommandNode_bukkitBrigCommand = Class.forName("io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand");
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException("Expected to find class", e);
+ }
+ return new PaperCommandRegistration<>(
+ () -> this.getMinecraftServer().getCommands().getDispatcher(),
+ () -> {
+ SimpleHelpMap helpMap = (SimpleHelpMap) Bukkit.getServer().getHelpMap();
+ helpMap.clear();
+ helpMap.initializeGeneralTopics();
+ helpMap.initializeCommands();
+ },
+ node -> bukkitCommandNode_bukkitBrigCommand.isInstance(node.getCommand())
+ );
+ }
+ }
+}
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NativeProxyCommandSender_1_21_R5.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NativeProxyCommandSender_1_21_R5.java
new file mode 100644
index 000000000..ad5307a1e
--- /dev/null
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/main/java/dev/jorel/commandapi/nms/NativeProxyCommandSender_1_21_R5.java
@@ -0,0 +1,35 @@
+package dev.jorel.commandapi.nms;
+
+import dev.jorel.commandapi.CommandAPIBukkit;
+import dev.jorel.commandapi.wrappers.NativeProxyCommandSender;
+import net.minecraft.commands.CommandSourceStack;
+import net.minecraft.world.phys.Vec2;
+import net.minecraft.world.phys.Vec3;
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.craftbukkit.v1_21_R5.command.ProxiedNativeCommandSender;
+
+public class NativeProxyCommandSender_1_21_R5 extends ProxiedNativeCommandSender implements NativeProxyCommandSender {
+ private final World world;
+ private final Location location;
+
+ public NativeProxyCommandSender_1_21_R5(CommandSourceStack css, CommandSender caller, CommandSender callee) {
+ super(css, caller, callee);
+
+ Vec3 pos = css.getPosition();
+ Vec2 rot = css.getRotation();
+ this.world = CommandAPIBukkit.get().getWorldForCSS(css);
+ this.location = new Location(this.world, pos.x(), pos.y(), pos.z(), rot.y, rot.x);
+ }
+
+ @Override
+ public Location getLocation() {
+ return location;
+ }
+
+ @Override
+ public World getWorld() {
+ return world;
+ }
+}
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/test/java/SafeReflect.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/test/java/SafeReflect.java
new file mode 100644
index 000000000..e76fb1717
--- /dev/null
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21.6/src/test/java/SafeReflect.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright 2024 Jorel Ali (Skepter) - MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *******************************************************************************/
+import java.util.Map;
+
+import org.bukkit.craftbukkit.v1_21_R5.help.SimpleHelpMap;
+
+import com.mojang.brigadier.CommandDispatcher;
+import com.mojang.datafixers.util.Either;
+
+import dev.jorel.commandapi.preprocessor.RequireField;
+import net.minecraft.commands.arguments.selector.EntitySelector;
+import net.minecraft.server.CustomFunctionManager;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.world.level.block.entity.FuelValues;
+import net.minecraft.world.level.gameevent.EntityPositionSource;
+
+// Spigot-Mapped reflection
+@RequireField(in = CustomFunctionManager.class, name = "h", ofType = CommandDispatcher.class)
+@RequireField(in = EntitySelector.class, name = "p", ofType = boolean.class)
+@RequireField(in = SimpleHelpMap.class, name = "helpTopics", ofType = Map.class)
+@RequireField(in = EntityPositionSource.class, name = "e", ofType = Either.class)
+@RequireField(in = MinecraftServer.class, name = "aE", ofType = FuelValues.class)
+public class SafeReflect {}
\ No newline at end of file
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21/pom.xml
index d992f81e7..04bab1741 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-1.21/pom.xml
@@ -21,11 +21,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-1.21
+ CommandAPI - Bukkit support for 1.211.21.1-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-common/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-common/pom.xml
index 522f625fc..d75c01a56 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-common/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-common/pom.xml
@@ -19,11 +19,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-nms-common
+ CommandAPI - Bukkit support NMS common library1.20.1-R0.1-SNAPSHOT
@@ -133,6 +134,17 @@
+
+ Spigot_1_21_R5
+
+ 1.21.6-R0.1-SNAPSHOT
+ 1.21.6-R0.1-SNAPSHOT
+ 1.21.6-R0.1-SNAPSHOT
+
+
+ ${project.basedir}/target/1.21.6
+
+ Spigot_1_21_R4
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency-mojang-mapped/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency-mojang-mapped/pom.xml
index 63873416f..4dbe801c9 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency-mojang-mapped/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency-mojang-mapped/pom.xml
@@ -19,11 +19,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-nms-dependency-mojang-mapped
+ CommandAPI - Bukkit support Mojang-mapped NMS dependencypom
@@ -36,6 +37,12 @@
+
+ dev.jorel
+ commandapi-bukkit-1.21.6
+ ${project.version}
+ mojang-mapped
+ dev.jorelcommandapi-bukkit-1.21.5
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency/pom.xml
index 331a2b646..05e4f1872 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/commandapi-bukkit-nms-dependency/pom.xml
@@ -19,11 +19,12 @@
commandapi-bukkit-nmsdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-nms-dependency
+ CommandAPI - Bukkit support Spigot-mapped NMS dependencypom
@@ -35,6 +36,11 @@
+
+ dev.jorel
+ commandapi-bukkit-1.21.6
+ ${project.version}
+ dev.jorelcommandapi-bukkit-1.21.5
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/pom.xml
index 5c3996250..b62f1e95e 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-nms/pom.xml
@@ -26,15 +26,17 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.0commandapi-bukkit-nms
+ CommandAPI - Bukkit support NMS librarypomcommandapi-bukkit-nms-common
+ commandapi-bukkit-1.21.6commandapi-bukkit-1.21.5commandapi-bukkit-1.21.4commandapi-bukkit-1.21.2
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-common/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-common/pom.xml
index b5f60c53d..516611451 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-common/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-common/pom.xml
@@ -7,10 +7,11 @@
dev.jorelcommandapi-bukkit
- 10.0.1
+ 10.1.0commandapi-bukkit-plugin-common
+ CommandAPI - Bukkit support plugin common library
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/pom.xml
index 91c2705b1..edf7e938b 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-plugin-mojang-mapped
+ CommandAPI - Bukkit support Mojang-mapped plugin
@@ -142,6 +143,10 @@
org.bukkit.craftbukkit.v1_21_R4org.bukkit.craftbukkit
+
+ org.bukkit.craftbukkit.v1_21_R5
+ org.bukkit.craftbukkit
+
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/pom.xml
index 80b576e6b..600b7512d 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-plugin
+ CommandAPI - Bukkit support Spigot-mapped plugin
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade-mojang-mapped/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade-mojang-mapped/pom.xml
index 715d969cd..8842cd805 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade-mojang-mapped/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade-mojang-mapped/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-shade-mojang-mapped
+ CommandAPI - Bukkit support Mojang-mapped shade library
@@ -104,6 +105,10 @@
org.bukkit.craftbukkit.v1_21_R4org.bukkit.craftbukkit
+
+ org.bukkit.craftbukkit.v1_21_R5
+ org.bukkit.craftbukkit
+
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade/pom.xml
index 0a2bfcdc2..1d016fb91 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-shade/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-shade
+ CommandAPI - Bukkit support Spigot-mapped shade library
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test-toolkit/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test-toolkit/pom.xml
index 2da5fe5fc..5f089da5f 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test-toolkit/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test-toolkit/pom.xml
@@ -6,10 +6,11 @@
dev.jorelcommandapi-bukkit
- 10.0.1
+ 10.1.0commandapi-bukkit-test-toolkit
+ CommandAPI - Bukkit support testing toolkit21
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.2/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.2/pom.xml
index 683208690..c7bf6fbfa 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.2/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.2/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkit-testdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-test-impl-1.20.2
+ CommandAPI - Bukkit support test library implementation for 1.20.21.20.2-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.3/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.3/pom.xml
index 7e0e71978..861f23960 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.3/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.3/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkit-testdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-test-impl-1.20.3
+ CommandAPI - Bukkit support test library implementation for 1.20.31.20.4-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.5/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.5/pom.xml
index e40d15929..eb599181f 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.5/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20.5/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkit-testdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-test-impl-1.20.5
+ CommandAPI - Bukkit support test library implementation for 1.20.51.20.5-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20/pom.xml
index 24774c7c5..ceb721a85 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl-1.20/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkit-testdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-test-impl-1.20
+ CommandAPI - Bukkit support test library implementation for 1.201.20.1-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl/pom.xml
index 0289379cf..9def293c6 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/commandapi-bukkit-test-impl/pom.xml
@@ -25,12 +25,13 @@
commandapi-bukkit-testdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-test-impl
+ CommandAPI - Bukkit support test library implementation1.20.1-R0.1-SNAPSHOT
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/pom.xml
index 79f68d05c..4959e4e88 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-test/pom.xml
@@ -24,9 +24,10 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.0commandapi-bukkit-test
+ CommandAPI - Bukkit support test librarypom
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/pom.xml b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/pom.xml
index 6b8c29808..b69ede312 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/pom.xml
@@ -24,11 +24,12 @@
commandapi-bukkitdev.jorel
- 10.0.1
+ 10.1.04.0.0commandapi-bukkit-vh
+ CommandAPI - Bukkit support version handler
diff --git a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/src/main/java/dev/jorel/commandapi/CommandAPIVersionHandler.java b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/src/main/java/dev/jorel/commandapi/CommandAPIVersionHandler.java
index b625baf76..b75473c2c 100644
--- a/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/src/main/java/dev/jorel/commandapi/CommandAPIVersionHandler.java
+++ b/commandapi-platforms/commandapi-bukkit/commandapi-bukkit-vh/src/main/java/dev/jorel/commandapi/CommandAPIVersionHandler.java
@@ -29,6 +29,7 @@
import dev.jorel.commandapi.nms.NMS_1_21_R2;
import dev.jorel.commandapi.nms.NMS_1_21_R3;
import dev.jorel.commandapi.nms.NMS_1_21_R4;
+import dev.jorel.commandapi.nms.NMS_1_21_R5;
import org.bukkit.Bukkit;
/**
@@ -60,7 +61,7 @@ static LoadContext getPlatform() {
try {
if (CommandAPI.getConfiguration().shouldUseLatestNMSVersion()) {
- return new LoadContext(new NMS_1_21_R4(), () -> {
+ return new LoadContext(new NMS_1_21_R5(), () -> {
CommandAPI.logWarning("Loading the CommandAPI with the latest and potentially incompatible NMS implementation.");
CommandAPI.logWarning("While you may find success with this, further updates might be necessary to fully support the version you are using.");
});
@@ -75,6 +76,7 @@ static LoadContext getPlatform() {
case "1.21.2", "1.21.3" -> new NMS_1_21_R2();
case "1.21.4" -> new NMS_1_21_R3();
case "1.21.5" -> new NMS_1_21_R4();
+ case "1.21.6" -> new NMS_1_21_R5();
default -> null;
};
if (platform != null) {
@@ -83,7 +85,7 @@ static LoadContext getPlatform() {
if (CommandAPI.getConfiguration().shouldBeLenientForMinorVersions()) {
final String currentMajorVersion = version.split("\\.")[1];
if (latestMajorVersion.equals(currentMajorVersion)) {
- return new LoadContext(new NMS_1_21_R4(), () -> {
+ return new LoadContext(new NMS_1_21_R5(), () -> {
CommandAPI.logWarning("Loading the CommandAPI with a potentially incompatible NMS implementation.");
CommandAPI.logWarning("While you may find success with this, further updates might be necessary to fully support the version you are using.");
});
diff --git a/commandapi-platforms/commandapi-bukkit/pom.xml b/commandapi-platforms/commandapi-bukkit/pom.xml
index 396230348..fcc3d6831 100644
--- a/commandapi-platforms/commandapi-bukkit/pom.xml
+++ b/commandapi-platforms/commandapi-bukkit/pom.xml
@@ -7,10 +7,11 @@
commandapi-platformsdev.jorel
- 10.0.1
+ 10.1.0commandapi-bukkit
+ CommandAPI - Bukkit supportpom
diff --git a/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/pom.xml b/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/pom.xml
index c80293218..8ed9b937f 100644
--- a/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/pom.xml
+++ b/commandapi-platforms/commandapi-sponge/commandapi-sponge-core/pom.xml
@@ -7,7 +7,7 @@
commandapi-spongedev.jorel
- 10.0.1
+ 10.1.0commandapi-sponge-core
diff --git a/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin-test/pom.xml b/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin-test/pom.xml
index 095a2c317..b4ff8fff0 100644
--- a/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin-test/pom.xml
+++ b/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin-test/pom.xml
@@ -7,7 +7,7 @@
commandapi-spongedev.jorel
- 10.0.1
+ 10.1.0commandapi-sponge-plugin-test
diff --git a/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin/pom.xml b/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin/pom.xml
index f943526fc..6ad908dca 100644
--- a/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin/pom.xml
+++ b/commandapi-platforms/commandapi-sponge/commandapi-sponge-plugin/pom.xml
@@ -7,7 +7,7 @@
commandapi-spongedev.jorel
- 10.0.1
+ 10.1.0commandapi-sponge-plugin
diff --git a/commandapi-platforms/commandapi-sponge/commandapi-sponge-shade/pom.xml b/commandapi-platforms/commandapi-sponge/commandapi-sponge-shade/pom.xml
index 429a44a02..cbad707d4 100644
--- a/commandapi-platforms/commandapi-sponge/commandapi-sponge-shade/pom.xml
+++ b/commandapi-platforms/commandapi-sponge/commandapi-sponge-shade/pom.xml
@@ -7,7 +7,7 @@
commandapi-spongedev.jorel
- 10.0.1
+ 10.1.0commandapi-sponge-shade
diff --git a/commandapi-platforms/commandapi-sponge/pom.xml b/commandapi-platforms/commandapi-sponge/pom.xml
index 37a8fcbc2..b09f205ed 100644
--- a/commandapi-platforms/commandapi-sponge/pom.xml
+++ b/commandapi-platforms/commandapi-sponge/pom.xml
@@ -7,7 +7,7 @@
commandapi-platformsdev.jorel
- 10.0.1
+ 10.1.0commandapi-sponge
diff --git a/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/pom.xml b/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/pom.xml
index ecc710b37..7d96710d7 100644
--- a/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/pom.xml
+++ b/commandapi-platforms/commandapi-velocity/commandapi-velocity-core/pom.xml
@@ -7,10 +7,11 @@
commandapi-velocitydev.jorel
- 10.0.1
+ 10.1.0commandapi-velocity-core
+ CommandAPI - Velocity support core library
diff --git a/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin-test/pom.xml b/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin-test/pom.xml
index 88a0a8430..dbe7787ac 100644
--- a/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin-test/pom.xml
+++ b/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin-test/pom.xml
@@ -7,10 +7,11 @@
commandapi-velocitydev.jorel
- 10.0.1
+ 10.1.0commandapi-velocity-plugin-test
+ CommandAPI - Velocity support plugin tests
diff --git a/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/pom.xml b/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/pom.xml
index c4a5acf46..e5e363ce1 100644
--- a/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/pom.xml
+++ b/commandapi-platforms/commandapi-velocity/commandapi-velocity-plugin/pom.xml
@@ -7,10 +7,11 @@
commandapi-velocitydev.jorel
- 10.0.1
+ 10.1.0commandapi-velocity-plugin
+ CommandAPI - Velocity support plugin
diff --git a/commandapi-platforms/commandapi-velocity/commandapi-velocity-shade/pom.xml b/commandapi-platforms/commandapi-velocity/commandapi-velocity-shade/pom.xml
index e709c195a..69cc900d1 100644
--- a/commandapi-platforms/commandapi-velocity/commandapi-velocity-shade/pom.xml
+++ b/commandapi-platforms/commandapi-velocity/commandapi-velocity-shade/pom.xml
@@ -7,10 +7,11 @@
commandapi-velocitydev.jorel
- 10.0.1
+ 10.1.0commandapi-velocity-shade
+ CommandAPI - Velocity support shade library
diff --git a/commandapi-platforms/commandapi-velocity/pom.xml b/commandapi-platforms/commandapi-velocity/pom.xml
index 1f0b820c4..89288066f 100644
--- a/commandapi-platforms/commandapi-velocity/pom.xml
+++ b/commandapi-platforms/commandapi-velocity/pom.xml
@@ -7,10 +7,11 @@
commandapi-platformsdev.jorel
- 10.0.1
+ 10.1.0commandapi-velocity
+ CommandAPI - Velocity supportpom
diff --git a/commandapi-platforms/pom.xml b/commandapi-platforms/pom.xml
index 337b4e5a9..cdf636126 100644
--- a/commandapi-platforms/pom.xml
+++ b/commandapi-platforms/pom.xml
@@ -7,10 +7,11 @@
commandapidev.jorel
- 10.0.1
+ 10.1.0commandapi-platforms
+ CommandAPI - Multi-platform supportpom
diff --git a/commandapi-plugin/pom.xml b/commandapi-plugin/pom.xml
index a0fce2f2c..3f9b34236 100644
--- a/commandapi-plugin/pom.xml
+++ b/commandapi-plugin/pom.xml
@@ -7,10 +7,11 @@
dev.jorelcommandapi
- 10.0.1
+ 10.1.0commandapi-plugin
+ CommandAPI - Shared plugin library
diff --git a/commandapi-preprocessor/pom.xml b/commandapi-preprocessor/pom.xml
index 863dbbe61..ae29467cd 100644
--- a/commandapi-preprocessor/pom.xml
+++ b/commandapi-preprocessor/pom.xml
@@ -25,11 +25,12 @@
dev.jorelcommandapi
- 10.0.1
+ 10.1.04.0.0commandapi-preprocessor
+ CommandAPI - Development Maven preprocessor
\ No newline at end of file
diff --git a/compileNMSCommon.sh b/compileNMSCommon.sh
index cf60e4bbd..517b77fcb 100755
--- a/compileNMSCommon.sh
+++ b/compileNMSCommon.sh
@@ -10,4 +10,5 @@ compileVersion "1.20.5 and 1.20.6" "Spigot_1_20_R4"
compileVersion "1.21 and 1.21.1" "Spigot_1_21_R1"
compileVersion "1.21.2 and 1.21.3" "Spigot_1_21_R2"
compileVersion "1.21.4" "Spigot_1_21_R3"
-compileVersion "1.21.5" "Spigot_1_21_R4"
\ No newline at end of file
+compileVersion "1.21.5" "Spigot_1_21_R4"
+compileVersion "1.21.6" "Spigot_1_21_R5"
\ No newline at end of file
diff --git a/examples/bukkit/automated-tests-shaded/README.md b/examples/bukkit/automated-tests-shaded/README.md
index 3bf21bd34..21bcd44d7 100644
--- a/examples/bukkit/automated-tests-shaded/README.md
+++ b/examples/bukkit/automated-tests-shaded/README.md
@@ -18,14 +18,14 @@ Key points:
dev.jorelcommandapi-bukkit-test-toolkit
- 10.0.1
+ 10.1.0testdev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0compile
diff --git a/examples/bukkit/automated-tests-shaded/pom.xml b/examples/bukkit/automated-tests-shaded/pom.xml
index 416ca773b..3878b1fbf 100644
--- a/examples/bukkit/automated-tests-shaded/pom.xml
+++ b/examples/bukkit/automated-tests-shaded/pom.xml
@@ -32,7 +32,7 @@
dev.jorelcommandapi-bukkit-test-toolkit
- 10.0.1
+ 10.1.0test
@@ -40,7 +40,7 @@
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0compile
diff --git a/examples/bukkit/automated-tests/README.md b/examples/bukkit/automated-tests/README.md
index 0be7039e3..358b30203 100644
--- a/examples/bukkit/automated-tests/README.md
+++ b/examples/bukkit/automated-tests/README.md
@@ -18,14 +18,14 @@ Key points:
dev.jorelcommandapi-bukkit-test-toolkit
- 10.0.1
+ 10.1.0testdev.jorelcommandapi-bukkit-core
- 10.0.1
+ 10.1.0provided
diff --git a/examples/bukkit/automated-tests/pom.xml b/examples/bukkit/automated-tests/pom.xml
index daf9b01ed..db2047e60 100644
--- a/examples/bukkit/automated-tests/pom.xml
+++ b/examples/bukkit/automated-tests/pom.xml
@@ -32,7 +32,7 @@
dev.jorelcommandapi-bukkit-test-toolkit
- 10.0.1
+ 10.1.0test
@@ -40,7 +40,7 @@
dev.jorelcommandapi-bukkit-core
- 10.0.1
+ 10.1.0provided
diff --git a/examples/bukkit/commandtrees/pom.xml b/examples/bukkit/commandtrees/pom.xml
index 4589c9067..da2215725 100644
--- a/examples/bukkit/commandtrees/pom.xml
+++ b/examples/bukkit/commandtrees/pom.xml
@@ -20,7 +20,7 @@
dev.jorelcommandapi-bukkit-core
- 10.0.1
+ 10.1.0
diff --git a/examples/bukkit/gradle-groovy/README.md b/examples/bukkit/gradle-groovy/README.md
index c7f166c8b..fec461ee1 100644
--- a/examples/bukkit/gradle-groovy/README.md
+++ b/examples/bukkit/gradle-groovy/README.md
@@ -7,7 +7,7 @@ Key points:
- The `commandapi-bukkit-plugin` dependency is used:
```groovy
- implementation 'dev.jorel:commandapi-bukkit-plugin:10.0.1'
+ implementation 'dev.jorel:commandapi-bukkit-plugin:10.1.0'
```
- In the plugin.yml, CommandAPI is listed as a depend:
diff --git a/examples/bukkit/gradle-groovy/build.gradle b/examples/bukkit/gradle-groovy/build.gradle
index 4e371ed55..b57c94272 100644
--- a/examples/bukkit/gradle-groovy/build.gradle
+++ b/examples/bukkit/gradle-groovy/build.gradle
@@ -29,7 +29,7 @@ dependencies {
implementation 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
// The CommandAPI dependency used for Bukkit and it's forks
- implementation 'dev.jorel:commandapi-bukkit-plugin:10.0.1'
+ implementation 'dev.jorel:commandapi-bukkit-plugin:10.1.0'
// NBT API to use NBT-based arguments
implementation 'de.tr7zw:item-nbt-api-plugin:2.12.2'
diff --git a/examples/bukkit/gradle-kotlin/README.md b/examples/bukkit/gradle-kotlin/README.md
index f186f5aa1..9112bdc4f 100644
--- a/examples/bukkit/gradle-kotlin/README.md
+++ b/examples/bukkit/gradle-kotlin/README.md
@@ -7,7 +7,7 @@ Key points:
- The `commandapi-bukkit-plugin` dependency is used:
```kotlin
- implementation("dev.jorel:commandapi-bukkit-plugin:10.0.1")
+ implementation("dev.jorel:commandapi-bukkit-plugin:10.1.0")
```
- In the plugin.yml, CommandAPI is listed as a depend:
diff --git a/examples/bukkit/gradle-kotlin/build.gradle.kts b/examples/bukkit/gradle-kotlin/build.gradle.kts
index 32b9140cc..c5ebb1566 100644
--- a/examples/bukkit/gradle-kotlin/build.gradle.kts
+++ b/examples/bukkit/gradle-kotlin/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies {
implementation("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
// The CommandAPI dependency used for Bukkit and it's forks
- implementation("dev.jorel:commandapi-bukkit-plugin:10.0.1")
+ implementation("dev.jorel:commandapi-bukkit-plugin:10.1.0")
// NBT API to use NBT-based arguments
implementation("de.tr7zw:item-nbt-api-plugin:2.12.2")
diff --git a/examples/bukkit/kotlindsl-gradle/README.md b/examples/bukkit/kotlindsl-gradle/README.md
index a47fa3852..9c773d5fa 100644
--- a/examples/bukkit/kotlindsl-gradle/README.md
+++ b/examples/bukkit/kotlindsl-gradle/README.md
@@ -9,7 +9,7 @@ Key points:
- Add the `commandapi-kotlin-bukkit` dependency to your project:
```kotlin
- compileOnly("dev.jorel:commandapi-bukkit-kotlin:10.0.1")
+ compileOnly("dev.jorel:commandapi-bukkit-kotlin:10.1.0")
```
- The Kotlin DSL must not be shaded into your plugin
diff --git a/examples/bukkit/kotlindsl-gradle/build.gradle.kts b/examples/bukkit/kotlindsl-gradle/build.gradle.kts
index 2f17630c7..c8da3bd4e 100644
--- a/examples/bukkit/kotlindsl-gradle/build.gradle.kts
+++ b/examples/bukkit/kotlindsl-gradle/build.gradle.kts
@@ -22,7 +22,7 @@ dependencies {
implementation("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
// The CommandAPI dependency used for Bukkit and it's forks
- implementation("dev.jorel:commandapi-bukkit-core:10.0.1")
+ implementation("dev.jorel:commandapi-bukkit-core:10.1.0")
// Due to all functions available in the kotlindsl being inlined, we only need this dependency at compile-time
- compileOnly("dev.jorel:commandapi-bukkit-kotlin:10.0.1")
+ compileOnly("dev.jorel:commandapi-bukkit-kotlin:10.1.0")
}
\ No newline at end of file
diff --git a/examples/bukkit/kotlindsl/README.md b/examples/bukkit/kotlindsl/README.md
index 4efba8a97..43cc69722 100644
--- a/examples/bukkit/kotlindsl/README.md
+++ b/examples/bukkit/kotlindsl/README.md
@@ -12,7 +12,7 @@ Key points:
dev.jorelcommandapi-kotlin-bukkit
- 10.0.1
+ 10.1.0
```
diff --git a/examples/bukkit/kotlindsl/pom.xml b/examples/bukkit/kotlindsl/pom.xml
index d6a60cd44..5b8ed0121 100644
--- a/examples/bukkit/kotlindsl/pom.xml
+++ b/examples/bukkit/kotlindsl/pom.xml
@@ -21,13 +21,13 @@
dev.jorelcommandapi-bukkit-core
- 10.0.1
+ 10.1.0provideddev.jorelcommandapi-bukkit-kotlin
- 10.0.1
+ 10.1.0
diff --git a/examples/bukkit/maven-annotations/README.md b/examples/bukkit/maven-annotations/README.md
index bf879f122..c34ab7f70 100644
--- a/examples/bukkit/maven-annotations/README.md
+++ b/examples/bukkit/maven-annotations/README.md
@@ -11,13 +11,13 @@ Key points:
dev.jorelcommandapi-bukkit-plugin
- 10.0.1
+ 10.1.0provideddev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0provided
@@ -37,7 +37,7 @@ Key points:
dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0
diff --git a/examples/bukkit/maven-annotations/pom.xml b/examples/bukkit/maven-annotations/pom.xml
index 88878a1ba..96b2f537f 100644
--- a/examples/bukkit/maven-annotations/pom.xml
+++ b/examples/bukkit/maven-annotations/pom.xml
@@ -28,7 +28,7 @@
dev.jorelcommandapi-bukkit-plugin
- 10.0.1
+ 10.1.0provided
@@ -36,7 +36,7 @@
dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0provided
@@ -69,7 +69,7 @@
dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.017
diff --git a/examples/bukkit/maven-shaded-annotations/README.md b/examples/bukkit/maven-shaded-annotations/README.md
index d51d57a92..6952bcce0 100644
--- a/examples/bukkit/maven-shaded-annotations/README.md
+++ b/examples/bukkit/maven-shaded-annotations/README.md
@@ -11,12 +11,12 @@ Key points:
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0provided
@@ -36,7 +36,7 @@ Key points:
dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0
diff --git a/examples/bukkit/maven-shaded-annotations/pom.xml b/examples/bukkit/maven-shaded-annotations/pom.xml
index be565d0a8..25e1945b4 100644
--- a/examples/bukkit/maven-shaded-annotations/pom.xml
+++ b/examples/bukkit/maven-shaded-annotations/pom.xml
@@ -28,14 +28,14 @@
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.0provided
@@ -62,7 +62,7 @@
dev.jorelcommandapi-annotations
- 10.0.1
+ 10.1.017
diff --git a/examples/bukkit/maven-shaded-tests/pom.xml b/examples/bukkit/maven-shaded-tests/pom.xml
index 557e12292..308df627c 100644
--- a/examples/bukkit/maven-shaded-tests/pom.xml
+++ b/examples/bukkit/maven-shaded-tests/pom.xml
@@ -37,7 +37,7 @@
dev.jorelcommandapi-bukkit-test-tests
- 10.0.1
+ 10.1.0test-jartest
@@ -46,7 +46,7 @@
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0
@@ -69,14 +69,14 @@
dev.jorelcommandapi-bukkit-test-impl
- 10.0.1
+ 10.1.0testdev.jorelcommandapi-bukkit-test-impl-1.20
- 10.0.1
+ 10.1.0test
diff --git a/examples/bukkit/maven-shaded/README.md b/examples/bukkit/maven-shaded/README.md
index 122f24506..0dda6f97e 100644
--- a/examples/bukkit/maven-shaded/README.md
+++ b/examples/bukkit/maven-shaded/README.md
@@ -10,7 +10,7 @@ Key points:
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0
```
diff --git a/examples/bukkit/maven-shaded/pom.xml b/examples/bukkit/maven-shaded/pom.xml
index 68b720a7b..719078cda 100644
--- a/examples/bukkit/maven-shaded/pom.xml
+++ b/examples/bukkit/maven-shaded/pom.xml
@@ -28,7 +28,7 @@
dev.jorelcommandapi-bukkit-shade
- 10.0.1
+ 10.1.0
diff --git a/examples/bukkit/maven/README.md b/examples/bukkit/maven/README.md
index 134e32810..5a139525f 100644
--- a/examples/bukkit/maven/README.md
+++ b/examples/bukkit/maven/README.md
@@ -10,7 +10,7 @@ Key points:
dev.jorelcommandapi-bukkit-plugin
- 10.0.1
+ 10.1.0provided
```
diff --git a/examples/bukkit/maven/pom.xml b/examples/bukkit/maven/pom.xml
index 2c6f5a11f..87aa01e7e 100644
--- a/examples/bukkit/maven/pom.xml
+++ b/examples/bukkit/maven/pom.xml
@@ -28,7 +28,7 @@
dev.jorelcommandapi-bukkit-plugin
- 10.0.1
+ 10.1.0provided
diff --git a/examples/velocity/gradle-groovy/README.md b/examples/velocity/gradle-groovy/README.md
index 4cf8904ff..3943e3b68 100644
--- a/examples/velocity/gradle-groovy/README.md
+++ b/examples/velocity/gradle-groovy/README.md
@@ -7,7 +7,7 @@ Key points:
- The `commandapi-velocity-core` dependency is used
```groovy
- implementation 'dev.jorel:commandapi-velocity-core:10.0.1'
+ implementation 'dev.jorel:commandapi-velocity-core:10.1.0'
```
- In the `@Plugin` annotation, `commandapi` is listed as a dependency:
diff --git a/examples/velocity/gradle-groovy/build.gradle b/examples/velocity/gradle-groovy/build.gradle
index 74cd0cfbc..b27b3a8d8 100644
--- a/examples/velocity/gradle-groovy/build.gradle
+++ b/examples/velocity/gradle-groovy/build.gradle
@@ -25,5 +25,5 @@ dependencies {
implementation 'com.velocitypowered:velocity-api:3.1.1'
// The CommandAPI dependency used for Velocity
- implementation 'dev.jorel:commandapi-velocity-core:10.0.1'
+ implementation 'dev.jorel:commandapi-velocity-core:10.1.0'
}
\ No newline at end of file
diff --git a/examples/velocity/gradle-kotlin/README.md b/examples/velocity/gradle-kotlin/README.md
index ab17f87f0..c8e4872b6 100644
--- a/examples/velocity/gradle-kotlin/README.md
+++ b/examples/velocity/gradle-kotlin/README.md
@@ -7,7 +7,7 @@ Key points:
- The `commandapi-velocity-core` dependency is used:
```kotlin
- implementation("dev.jorel:commandapi-velocity-core:10.0.1")
+ implementation("dev.jorel:commandapi-velocity-core:10.1.0")
```
- In the `@Plugin` annotation, `commandapi` is listed as a dependency:
diff --git a/examples/velocity/gradle-kotlin/build.gradle.kts b/examples/velocity/gradle-kotlin/build.gradle.kts
index 2ad472597..acefaf849 100644
--- a/examples/velocity/gradle-kotlin/build.gradle.kts
+++ b/examples/velocity/gradle-kotlin/build.gradle.kts
@@ -23,5 +23,5 @@ dependencies {
implementation("com.velocitypowered:velocity-api:3.1.1")
// The CommandAPI dependency used for Velocity
- implementation("dev.jorel:commandapi-velocity-core:10.0.1")
+ implementation("dev.jorel:commandapi-velocity-core:10.1.0")
}
\ No newline at end of file
diff --git a/examples/velocity/maven-shaded/README.md b/examples/velocity/maven-shaded/README.md
index 66a623387..3485cfb0c 100644
--- a/examples/velocity/maven-shaded/README.md
+++ b/examples/velocity/maven-shaded/README.md
@@ -10,7 +10,7 @@ Key points:
dev.jorelcommandapi-velocity-shade
- 10.0.1
+ 10.1.0
```
diff --git a/examples/velocity/maven-shaded/pom.xml b/examples/velocity/maven-shaded/pom.xml
index 9e5e8deb9..97f52a8a8 100644
--- a/examples/velocity/maven-shaded/pom.xml
+++ b/examples/velocity/maven-shaded/pom.xml
@@ -21,7 +21,7 @@
dev.jorelcommandapi-velocity-shade
- 10.0.1
+ 10.1.0
diff --git a/examples/velocity/maven/README.md b/examples/velocity/maven/README.md
index dc4a085a9..295b51e73 100644
--- a/examples/velocity/maven/README.md
+++ b/examples/velocity/maven/README.md
@@ -10,7 +10,7 @@ Key points:
dev.jorelcommandapi-velocity-core
- 10.0.1
+ 10.1.0provided
```
diff --git a/examples/velocity/maven/pom.xml b/examples/velocity/maven/pom.xml
index 32dcfabf4..d1f76cd00 100644
--- a/examples/velocity/maven/pom.xml
+++ b/examples/velocity/maven/pom.xml
@@ -21,7 +21,7 @@
dev.jorelcommandapi-velocity-core
- 10.0.1
+ 10.1.0provided
diff --git a/pom.xml b/pom.xml
index f0cc95dc8..bdc946046 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
dev.jorelcommandapi
- 10.0.1
+ 10.1.0pomcommandapi
@@ -49,9 +49,9 @@
- scm:git:git://github.com/JorelAli/CommandAPI.git
- scm:git:ssh://github.com:JorelAli/CommandAPI.git
- https://github.com/JorelAli/CommandAPI/tree/master
+ scm:git:git://github.com/CommandAPI/CommandAPI.git
+ scm:git:ssh://github.com:CommandAPI/CommandAPI.git
+ https://github.com/CommandAPI/CommandAPI/tree/master
@@ -215,13 +215,9 @@
- ossrh
- https://s01.oss.sonatype.org/content/repositories/snapshots
+ central
+ https://central.sonatype.com/repository/maven-snapshots/
-
- ossrh
- https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
-
@@ -252,16 +248,15 @@
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.13
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.7.0true
- ossrh
- https://s01.oss.sonatype.org/
- true
+ central
+ true
-
+