From f6aa49d610e47b40ffa72d09e3cb0b02c3e9edc7 Mon Sep 17 00:00:00 2001 From: willkroboth <46540330+willkroboth@users.noreply.github.com> Date: Wed, 20 Aug 2025 11:40:25 -0400 Subject: [PATCH 1/8] Update to version 11.0.0-SNAPSHOT --- docs/en/dev-setup/annotations.md | 12 ++++++------ docs/en/dev-setup/setup.md | 6 +++--- docs/en/dev-setup/shading.md | 12 ++++++------ docs/en/kotlin-dsl/intro.md | 6 +++--- docs/en/test/setup.md | 12 ++++++------ docs/en/velocity/intro.md | 6 +++--- reference-code/gradle/libs.versions.toml | 10 +++++----- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/en/dev-setup/annotations.md b/docs/en/dev-setup/annotations.md index 8624b361..6919e019 100644 --- a/docs/en/dev-setup/annotations.md +++ b/docs/en/dev-setup/annotations.md @@ -22,7 +22,7 @@ The annotation system effectively needs to be added twice: Once for compilation dev.jorel commandapi-annotations - 10.1.2 + 11.0.0-SNAPSHOT provided @@ -42,7 +42,7 @@ The annotation system effectively needs to be added twice: Once for compilation dev.jorel commandapi-annotations - 10.1.2 + 11.0.0-SNAPSHOT @@ -81,8 +81,8 @@ The annotation system effectively needs to be added twice: Once for compilation ```groovy dependencies { - compileOnly "dev.jorel:commandapi-annotations:10.1.2" - annotationProcessor "dev.jorel:commandapi-annotations:10.1.2" + compileOnly "dev.jorel:commandapi-annotations:11.0.0-SNAPSHOT" + annotationProcessor "dev.jorel:commandapi-annotations:11.0.0-SNAPSHOT" } ``` @@ -90,8 +90,8 @@ The annotation system effectively needs to be added twice: Once for compilation ```kotlin dependencies { - compileOnly("dev.jorel:commandapi-annotations:10.1.2") - annotationProcessor("dev.jorel:commandapi-annotations:10.1.2") + compileOnly("dev.jorel:commandapi-annotations:11.0.0-SNAPSHOT") + annotationProcessor("dev.jorel:commandapi-annotations:11.0.0-SNAPSHOT") } ``` diff --git a/docs/en/dev-setup/setup.md b/docs/en/dev-setup/setup.md index c4b7d4f1..38fe0fe2 100644 --- a/docs/en/dev-setup/setup.md +++ b/docs/en/dev-setup/setup.md @@ -51,7 +51,7 @@ If you've never used a build system before, I highly recommend it! It makes it e dev.jorel commandapi-bukkit-core - 10.1.2 + 11.0.0-SNAPSHOT provided @@ -90,7 +90,7 @@ If you've never used a build system before, I highly recommend it! It makes it e ```groovy dependencies { - compileOnly "dev.jorel:commandapi-bukkit-core:10.1.2" + compileOnly "dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT" } ``` @@ -99,7 +99,7 @@ If you've never used a build system before, I highly recommend it! It makes it e ```kotlin dependencies { - compileOnly("dev.jorel:commandapi-bukkit-core:10.1.2") + compileOnly("dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT") } ``` diff --git a/docs/en/dev-setup/shading.md b/docs/en/dev-setup/shading.md index dc9fcb2a..c3e007b6 100644 --- a/docs/en/dev-setup/shading.md +++ b/docs/en/dev-setup/shading.md @@ -113,7 +113,7 @@ Add the CommandAPI shade dependency: dev.jorel commandapi-bukkit-shade - 10.1.2 + 11.0.0-SNAPSHOT ``` @@ -125,7 +125,7 @@ Add the CommandAPI shade dependency: dev.jorel commandapi-bukkit-shade-mojang-mapped - 10.1.2 + 11.0.0-SNAPSHOT ``` @@ -221,7 +221,7 @@ Next, we declare our dependencies: ```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-shade:10.1.2" + implementation "dev.jorel:commandapi-bukkit-shade:11.0.0-SNAPSHOT" } ``` @@ -229,7 +229,7 @@ dependencies { ```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-shade-mojang-mapped:10.1.2" + implementation "dev.jorel:commandapi-bukkit-shade-mojang-mapped:11.0.0-SNAPSHOT" } ``` @@ -239,7 +239,7 @@ dependencies { ```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-shade:10.1.2") + implementation("dev.jorel:commandapi-bukkit-shade:11.0.0-SNAPSHOT") } ``` @@ -247,7 +247,7 @@ dependencies { ```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-shade-mojang-mapped:10.1.2") + implementation("dev.jorel:commandapi-bukkit-shade-mojang-mapped:11.0.0-SNAPSHOT") } ``` diff --git a/docs/en/kotlin-dsl/intro.md b/docs/en/kotlin-dsl/intro.md index 54abf6a3..e638e51d 100644 --- a/docs/en/kotlin-dsl/intro.md +++ b/docs/en/kotlin-dsl/intro.md @@ -26,7 +26,7 @@ To install the DSL, you need to add the `commandapi-bukkit-kotlin` dependency in dev.jorel commandapi-bukkit-kotlin - 10.1.2 + 11.0.0-SNAPSHOT ``` @@ -106,7 +106,7 @@ Next, you need to add the dependency: ```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-kotlin:10.1.2" + implementation "dev.jorel:commandapi-bukkit-kotlin:11.0.0-SNAPSHOT" } ``` @@ -115,7 +115,7 @@ dependencies { ```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-kotlin:10.1.2") + implementation("dev.jorel:commandapi-bukkit-kotlin:11.0.0-SNAPSHOT") } ``` diff --git a/docs/en/test/setup.md b/docs/en/test/setup.md index 5956afa8..1a85abd7 100644 --- a/docs/en/test/setup.md +++ b/docs/en/test/setup.md @@ -29,7 +29,7 @@ When you add the dependencies for MockBukkit and `commandapi-bukkit-test-toolkit dev.jorel commandapi-bukkit-test-toolkit - 10.1.2 + 11.0.0-SNAPSHOT test @@ -37,7 +37,7 @@ When you add the dependencies for MockBukkit and `commandapi-bukkit-test-toolkit dev.jorel commandapi-bukkit-core - 10.1.2 + 11.0.0-SNAPSHOT provided @@ -70,10 +70,10 @@ dependencies { // See https://github.com/MockBukkit/MockBukkit?tab=readme-ov-file#mag-usage for latest version testImplementation 'com.github.seeseemelk:MockBukkit-v1.21:3.128.0' - testImplementation 'dev.jorel:commandapi-bukkit-test-toolkit:10.1.2' + testImplementation 'dev.jorel:commandapi-bukkit-test-toolkit:11.0.0-SNAPSHOT' // May be the shade dependency and/or mojang-mapped - compileOnly 'dev.jorel:commandapi-bukkit-core:10.1.2' + compileOnly 'dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT' // Can also be paper-api compileOnly 'org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT' @@ -91,10 +91,10 @@ dependencies { // See https://github.com/MockBukkit/MockBukkit?tab=readme-ov-file#mag-usage for latest version testImplementation("com.github.seeseemelk:MockBukkit-v1.21:3.128.0") - testImplementation("dev.jorel:commandapi-bukkit-test-toolkit:10.1.2") + testImplementation("dev.jorel:commandapi-bukkit-test-toolkit:11.0.0-SNAPSHOT") // May be the shade dependency and/or mojang-mapped - compileOnly("dev.jorel:commandapi-bukkit-core:10.1.2") + compileOnly("dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT") // Can also be paper-api compileOnly("org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT") diff --git a/docs/en/velocity/intro.md b/docs/en/velocity/intro.md index dbe9da29..2d5e3c79 100644 --- a/docs/en/velocity/intro.md +++ b/docs/en/velocity/intro.md @@ -26,7 +26,7 @@ Add the dependency to your list of dependencies in your build script: dev.jorel commandapi-velocity-shade - 10.1.2 + 11.0.0-SNAPSHOT ``` @@ -38,7 +38,7 @@ Add the dependency to your list of dependencies in your build script: ```groovy dependencies { - implementation "dev.jorel:commandapi-velocity-shade:10.1.2" + implementation "dev.jorel:commandapi-velocity-shade:11.0.0-SNAPSHOT" } ``` @@ -47,7 +47,7 @@ dependencies { ```kotlin dependencies { - implementation("dev.jorel:commandapi-velocity-shade:10.1.2") + implementation("dev.jorel:commandapi-velocity-shade:11.0.0-SNAPSHOT") } ``` diff --git a/reference-code/gradle/libs.versions.toml b/reference-code/gradle/libs.versions.toml index bf73e249..a63fe69f 100644 --- a/reference-code/gradle/libs.versions.toml +++ b/reference-code/gradle/libs.versions.toml @@ -7,11 +7,11 @@ com-mojang-authlib = "3.3.39" com-mojang-brigadier = "1.0.17" com-velocitypowered-velocity-api = "3.4.0-SNAPSHOT" de-tr7zw-item-nbt-api = "2.11.1" -dev-jorel-commandapi-annotations = "10.1.2" -dev-jorel-commandapi-bukkit-core = "10.1.2" -dev-jorel-commandapi-bukkit-kotlin = "10.1.2" -dev-jorel-commandapi-bukkit-test-toolkit = "10.1.2" -dev-jorel-commandapi-velocity-shade = "10.1.2" +dev-jorel-commandapi-annotations = "11.0.0-SNAPSHOT" +dev-jorel-commandapi-bukkit-core = "11.0.0-SNAPSHOT" +dev-jorel-commandapi-bukkit-kotlin = "11.0.0-SNAPSHOT" +dev-jorel-commandapi-bukkit-test-toolkit = "11.0.0-SNAPSHOT" +dev-jorel-commandapi-velocity-shade = "11.0.0-SNAPSHOT" io-papermc-paper-paper-api = "1.21-R0.1-SNAPSHOT" net-kyori-adventure-platform-bukkit = "4.2.0" org-jetbrains-kotlin-kotlin-stdlib = "2.0.0" From 8e2b80096a97199cfdc3bfaf7f4b3b0698f3f887 Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:04:48 +0100 Subject: [PATCH 2/8] Add documentation for https://github.com/CommandAPI/CommandAPI/pull/517 --- docs/.vitepress/theme/upgrading/upgrading.ts | 1 + .../en/create-commands/arguments/arguments.md | 128 +++++++++--------- .../types/chat/adventure-chat-arguments.md | 20 +-- docs/en/dev-setup/setup.md | 39 +++++- docs/en/dev-setup/shading.md | 52 ++++--- docs/en/kotlin-dsl/intro.md | 39 +++++- docs/en/upgrading-parts/10.1.2-to-11.0.0.md | 43 ++++++ docs/en/user-setup/config.md | 62 +++++++++ 8 files changed, 286 insertions(+), 98 deletions(-) create mode 100644 docs/en/upgrading-parts/10.1.2-to-11.0.0.md diff --git a/docs/.vitepress/theme/upgrading/upgrading.ts b/docs/.vitepress/theme/upgrading/upgrading.ts index 0c39b932..95d0fe78 100644 --- a/docs/.vitepress/theme/upgrading/upgrading.ts +++ b/docs/.vitepress/theme/upgrading/upgrading.ts @@ -19,6 +19,7 @@ export const upgradingInfos: UpgradingInfo[] = [ {from: '9.0.3', to: '9.1.0'}, {from: '9.2.0', to: '9.3.0'}, {from: '9.7.0', to: '10.0.0'}, + {from: '10.1.2', to: '11.0.0'} ] export const keyVersions = Array.from(new Set(upgradingInfos.map(info => [info.from, info.to]).flat())); diff --git a/docs/en/create-commands/arguments/arguments.md b/docs/en/create-commands/arguments/arguments.md index ebdf4694..419a7cb7 100644 --- a/docs/en/create-commands/arguments/arguments.md +++ b/docs/en/create-commands/arguments/arguments.md @@ -72,67 +72,67 @@ To access arguments, they have to be casted to the type that the argument repres The type to cast each argument (declared in the `dev.jorel.commandapi.arguments` package) is listed below: -| Argument class | Data type | -|------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [`AngleArgument`](./types/misc/angle-arguments) | `float` | -| [`AdvancementArgument`](./types/misc/advancement-arguments) | `org.bukkit.advancement.Advancement` | -| [`AdventureChatArgument`](./types/chat/adventure-chat-arguments) | `net.kyori.adventure.text.Component` | -| [`AdventureChatColorArgument`](./types/chat/adventure-chat-arguments#adventure-chat-color-argument) | `net.kyori.adventure.text.format.NamedTextColor` | -| [`AdventureChatComponentArgument`](./types/chat/adventure-chat-arguments#adventure-chat-component-argument) | `net.kyori.adventure.text.Component` | -| [`AxisArgument`](./types/position/axis-arguments) | `java.util.EnumSet` | -| [`BiomeArgument`](./types/misc/biome-arguments) | `org.bukkit.block.Biome` | -| [`BiomeArgument.NamespacedKey`](./types/misc/biome-arguments) | `org.bukkit.NamespacedKey` | -| [`BlockPredicateArgument`](./types/predicate/block-predicate-arguments) | `java.util.function.Predicate`
 `` | -| [`BlockStateArgument`](./types/misc/blockstate-arguments) | `org.bukkit.block.data.BlockData` | -| [`BooleanArgument`](./types/primitive-arguments#boolean-arguments) | `boolean` | -| [`ChatArgument`](./types/chat/spigot-chat-arguments#chat-argument) | `net.md_5.bungee.api.chat.BaseComponent[]` | -| [`ChatColorArgument`](./types/chat/spigot-chat-arguments#chat-color-argument) | `org.bukkit.ChatColor` | -| [`ChatComponentArgument`](./types/chat/spigot-chat-arguments#chat-component-argument) | `net.md_5.bungee.api.chat.BaseComponent[]` | -| [`CommandArgument`](./types/command-arguments) | `dev.jorel.commandapi.wrappers.CommandResult` | -| [`CustomArgument`](./types/custom-arguments) | `T` | -| [`DoubleArgument`](./types/primitive-arguments#numerical-arguments) | `double` | -| [`EnchantmentArgument`](./types/misc/enchantment-arguments) | `org.bukkit.enchantments.Enchantment` | -| [`EntitySelectorArgument.ManyEntities`](./types/entities-arguments#entity-selector-argument) | `Collection` | -| [`EntitySelectorArgument.ManyPlayers`](./types/entities-arguments#entity-selector-argument) | `Collection` | -| [`EntitySelectorArgument.OneEntity`](./types/entities-arguments#entity-selector-argument) | `org.bukkit.entity.Entity` | -| [`EntitySelectorArgument.OnePlayer`](./types/entities-arguments#entity-selector-argument) | `org.bukkit.entity.Player` | -| [`EntityTypeArgument`](./types/entities-arguments#entity-type-argument) | `org.bukkit.entity.EntityType` | -| [`FloatArgument`](./types/primitive-arguments#numerical-arguments) | `float` | -| [`FloatRangeArgument`](./types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.FloatRange` | -| [`FunctionArgument`](../functions-and-tags/function-arguments) | `dev.jorel.commandapi.wrappers.FunctionWrapper[]` | -| [`GreedyStringArgument`](./types/string-arguments#greedy-string-argument) | `String` | -| [`IntegerArgument`](./types/primitive-arguments#numerical-arguments) | `int` | -| [`IntegerRangeArgument`](./types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.IntegerRange` | -| [`ItemStackArgument`](./types/misc/itemstack-arguments) | `org.bukkit.inventory.ItemStack` | -| [`ItemStackPredicateArgument`](./types/predicate/itemstack-predicate-arguments) | `java.util.function.Predicate`
 `` | -| [`ListArgument`](./types/list-arguments) | `java.util.Collection` | -| [`LiteralArgument`](./types/literal/literal-arguments) | N/A | -| [`Location2DArgument`](./types/position/location-arguments#2d-location) | `dev.jorel.commandapi.wrappers.Location2D` | -| [`LocationArgument`](./types/position/location-arguments#3d-location) | `org.bukkit.Location` | -| [`LongArgument`](./types/primitive-arguments#numerical-arguments) | `long` | -| [`LootTableArgument`](./types/misc/loottable-arguments) | `org.bukkit.loot.LootTable` | -| [`MapArgument`](./types/map-arguments) | `java.util.LinkedHashMap` | -| [`MathOperationArgument`](./types/misc/mathoperation-arguments) | `dev.jorel.commandapi.wrappers.MathOperation` | -| [`MultiLiteralArgument`](./types/literal/multiliteral-arguments) | `String` | -| [`NamespacedKeyArgument`](./types/misc/namespacedkey-arguments) | `org.bukkit.NamespacedKey` | -| [`NBTCompoundArgument`](./types/nbt-arguments) | The cast type changes depending on whether you're shading the CommandAPI or using the CommandAPI as a plugin:
  • Shading:
    `T` (implemented yourself)

  • Plugin:
    `dev.jorel.commandapi.nbtapi.NBTContainer`
| -| [`ObjectiveArgument`](./types/scoreboard/objective-arguments#objective-argument) | `org.bukkit.scoreboard.Objective` | -| [`ObjectiveCriteriaArgument`](./types/scoreboard/objective-arguments#objective-criteria-argument) | `String` | -| [`OfflinePlayerArgument`](./types/entities-arguments#offlineplayer-argument) | `org.bukkit.OfflinePlayer` | -| [`ParticleArgument`](./types/misc/particle-arguments) | `dev.jorel.commandapi.wrappers.ParticleData` | -| [`PlayerArgument`](./types/entities-arguments#player-argument) | `org.bukkit.entity.Player` | -| [`PotionEffectArgument`](./types/misc/potion-arguments) | `org.bukkit.potion.PotionEffectType` | -| [`PotionEffectArgument.NamespacedKey`](./types/misc/potion-arguments) | `org.bukkit.NamespacedKey` | -| [`RecipeArgument`](./types/misc/recipe-arguments) | The cast type changes depending on your Minecraft version:
  • Version 1.14.4 and below:
    `org.bukkit.inventory.Recipe`

  • 1.15 and above:
    `org.bukkit.inventory.ComplexRecipe`
| -| [`RotationArgument`](./types/position/rotation-arguments) | `dev.jorel.commandapi.wrappers.Rotation` | -| [`ScoreboardSlotArgument`](./types/scoreboard/scoreboard-arguments#scoreboard-slot-argument) | `dev.jorel.commandapi.wrappers.ScoreboardSlot` | -| [`ScoreHolderArgument.Single`](./types/scoreboard/scoreboard-arguments#score-holder-argument) | `String` | -| [`ScoreHolderArgument.Multiple`](./types/scoreboard/scoreboard-arguments#score-holder-argument) | `Collection` | -| [`SoundArgument`](./types/misc/sound-arguments) | `org.bukkit.Sound` | -| [`SoundArgument.NamespacedKey`](./types/misc/sound-arguments) | `org.bukkit.NamespacedKey` | -| [`StringArgument`](./types/string-arguments#string-argument) | `String` | -| [`TeamArgument`](./types/scoreboard/team-arguments) | `org.bukkit.scoreboard.Team` | -| [`TextArgument`](./types/string-arguments#text-argument) | `String` | -| [`TimeArgument`](./types/misc/time-arguments) | `int` | -| [`UUIDArgument`](./types/misc/uuid-arguments) | `java.util.UUID` | -| [`WorldArgument`](./types/misc/world-arguments) | `org.bukkit.World` | \ No newline at end of file +| Argument class | Data type | +|--------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [`AngleArgument`](./types/misc/angle-arguments) | `float` | +| [`AdvancementArgument`](./types/misc/advancement-arguments) | `org.bukkit.advancement.Advancement` | +| [`AxisArgument`](./types/position/axis-arguments) | `java.util.EnumSet` | +| [`BiomeArgument`](./types/misc/biome-arguments) | `org.bukkit.block.Biome` | +| [`BiomeArgument.NamespacedKey`](./types/misc/biome-arguments) | `org.bukkit.NamespacedKey` | +| [`BlockPredicateArgument`](./types/predicate/block-predicate-arguments) | `java.util.function.Predicate`
 `` | +| [`BlockStateArgument`](./types/misc/blockstate-arguments) | `org.bukkit.block.data.BlockData` | +| [`BooleanArgument`](./types/primitive-arguments#boolean-arguments) | `boolean` | +| [`ChatArgument` (on Paper)](./types/chat/adventure-chat-arguments#adventure-chat-argument) | `net.kyori.adventure.text.Component` | +| [`ChatColorArgument` (on Paper)](./types/chat/adventure-chat-arguments#adventure-chat-color-argument) | `net.kyori.adventure.text.format.NamedTextColor` | +| [`ChatComponentArgument` (on Paper)](./types/chat/adventure-chat-arguments#adventure-chat-component-argument) | `net.kyori.adventure.text.Component` | +| [`ChatArgument` (on Spigot)](./types/chat/spigot-chat-arguments#chat-argument) | `net.md_5.bungee.api.chat.BaseComponent[]` | +| [`ChatColorArgument` (on Spigot)](./types/chat/spigot-chat-arguments#chat-color-argument) | `org.bukkit.ChatColor` | +| [`ChatComponentArgument` (on Spigot)](./types/chat/spigot-chat-arguments#chat-component-argument) | `net.md_5.bungee.api.chat.BaseComponent[]` | +| [`CommandArgument`](./types/command-arguments) | `dev.jorel.commandapi.wrappers.CommandResult` | +| [`CustomArgument`](./types/custom-arguments) | `T` | +| [`DoubleArgument`](./types/primitive-arguments#numerical-arguments) | `double` | +| [`EnchantmentArgument`](./types/misc/enchantment-arguments) | `org.bukkit.enchantments.Enchantment` | +| [`EntitySelectorArgument.ManyEntities`](./types/entities-arguments#entity-selector-argument) | `Collection` | +| [`EntitySelectorArgument.ManyPlayers`](./types/entities-arguments#entity-selector-argument) | `Collection` | +| [`EntitySelectorArgument.OneEntity`](./types/entities-arguments#entity-selector-argument) | `org.bukkit.entity.Entity` | +| [`EntitySelectorArgument.OnePlayer`](./types/entities-arguments#entity-selector-argument) | `org.bukkit.entity.Player` | +| [`EntityTypeArgument`](./types/entities-arguments#entity-type-argument) | `org.bukkit.entity.EntityType` | +| [`FloatArgument`](./types/primitive-arguments#numerical-arguments) | `float` | +| [`FloatRangeArgument`](./types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.FloatRange` | +| [`FunctionArgument`](../functions-and-tags/function-arguments) | `dev.jorel.commandapi.wrappers.FunctionWrapper[]` | +| [`GreedyStringArgument`](./types/string-arguments#greedy-string-argument) | `String` | +| [`IntegerArgument`](./types/primitive-arguments#numerical-arguments) | `int` | +| [`IntegerRangeArgument`](./types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.IntegerRange` | +| [`ItemStackArgument`](./types/misc/itemstack-arguments) | `org.bukkit.inventory.ItemStack` | +| [`ItemStackPredicateArgument`](./types/predicate/itemstack-predicate-arguments) | `java.util.function.Predicate`
 `` | +| [`ListArgument`](./types/list-arguments) | `java.util.Collection` | +| [`LiteralArgument`](./types/literal/literal-arguments) | N/A | +| [`Location2DArgument`](./types/position/location-arguments#2d-location) | `dev.jorel.commandapi.wrappers.Location2D` | +| [`LocationArgument`](./types/position/location-arguments#3d-location) | `org.bukkit.Location` | +| [`LongArgument`](./types/primitive-arguments#numerical-arguments) | `long` | +| [`LootTableArgument`](./types/misc/loottable-arguments) | `org.bukkit.loot.LootTable` | +| [`MapArgument`](./types/map-arguments) | `java.util.LinkedHashMap` | +| [`MathOperationArgument`](./types/misc/mathoperation-arguments) | `dev.jorel.commandapi.wrappers.MathOperation` | +| [`MultiLiteralArgument`](./types/literal/multiliteral-arguments) | `String` | +| [`NamespacedKeyArgument`](./types/misc/namespacedkey-arguments) | `org.bukkit.NamespacedKey` | +| [`NBTCompoundArgument`](./types/nbt-arguments) | The cast type changes depending on whether you're shading the CommandAPI or using the CommandAPI as a plugin:
  • Shading:
    `T` (implemented yourself)

  • Plugin:
    `dev.jorel.commandapi.nbtapi.NBTContainer`
| +| [`ObjectiveArgument`](./types/scoreboard/objective-arguments#objective-argument) | `org.bukkit.scoreboard.Objective` | +| [`ObjectiveCriteriaArgument`](./types/scoreboard/objective-arguments#objective-criteria-argument) | `String` | +| [`OfflinePlayerArgument`](./types/entities-arguments#offlineplayer-argument) | `org.bukkit.OfflinePlayer` | +| [`ParticleArgument`](./types/misc/particle-arguments) | `dev.jorel.commandapi.wrappers.ParticleData` | +| [`PlayerArgument`](./types/entities-arguments#player-argument) | `org.bukkit.entity.Player` | +| [`PotionEffectArgument`](./types/misc/potion-arguments) | `org.bukkit.potion.PotionEffectType` | +| [`PotionEffectArgument.NamespacedKey`](./types/misc/potion-arguments) | `org.bukkit.NamespacedKey` | +| [`RecipeArgument`](./types/misc/recipe-arguments) | The cast type changes depending on your Minecraft version:
  • Version 1.14.4 and below:
    `org.bukkit.inventory.Recipe`

  • 1.15 and above:
    `org.bukkit.inventory.ComplexRecipe`
| +| [`RotationArgument`](./types/position/rotation-arguments) | `dev.jorel.commandapi.wrappers.Rotation` | +| [`ScoreboardSlotArgument`](./types/scoreboard/scoreboard-arguments#scoreboard-slot-argument) | `dev.jorel.commandapi.wrappers.ScoreboardSlot` | +| [`ScoreHolderArgument.Single`](./types/scoreboard/scoreboard-arguments#score-holder-argument) | `String` | +| [`ScoreHolderArgument.Multiple`](./types/scoreboard/scoreboard-arguments#score-holder-argument) | `Collection` | +| [`SoundArgument`](./types/misc/sound-arguments) | `org.bukkit.Sound` | +| [`SoundArgument.NamespacedKey`](./types/misc/sound-arguments) | `org.bukkit.NamespacedKey` | +| [`StringArgument`](./types/string-arguments#string-argument) | `String` | +| [`TeamArgument`](./types/scoreboard/team-arguments) | `org.bukkit.scoreboard.Team` | +| [`TextArgument`](./types/string-arguments#text-argument) | `String` | +| [`TimeArgument`](./types/misc/time-arguments) | `int` | +| [`UUIDArgument`](./types/misc/uuid-arguments) | `java.util.UUID` | +| [`WorldArgument`](./types/misc/world-arguments) | `org.bukkit.World` | \ No newline at end of file diff --git a/docs/en/create-commands/arguments/types/chat/adventure-chat-arguments.md b/docs/en/create-commands/arguments/types/chat/adventure-chat-arguments.md index 6b38e197..15ccea2c 100644 --- a/docs/en/create-commands/arguments/types/chat/adventure-chat-arguments.md +++ b/docs/en/create-commands/arguments/types/chat/adventure-chat-arguments.md @@ -8,21 +8,23 @@ authors: # Adventure chat arguments -:::info +From Paper 1.16.5 build #473 onwards, Paper now includes [Kyori's Adventure API](https://github.com/KyoriPowered/adventure-platform). This library is a replacement of the BungeeCord chat API and has all the same functionality as the BungeeCord chat API (and more!). The documentation for this API can be found [here](https://docs.adventure.kyori.net/index.html). -The two following classes, `AdventureChatComponentArgument` and `AdventureChatArgument` depend on a Paper-based server which has the Adventure library. If you use this class on a server without the Adventure library, it will throw a `PaperAdventureNotFoundException` +Since this functions very similar to the Spigot chat arguments, this page won't reiterate everything about how it works, we'll just outline some examples of how to use these arguments instead. +Additionally, the names used here may be confusing as they are the same names as on the [Spigot chat arguments](spigot-chat-arguments.md) page but have different return types. This is because the classes on this page are only accessible using `commandapi-paper-core` or `commandapi-paper-shade` +while the arguments on the Spigot chat arguments page are only available when using `commandapi-spigot-core` or `commandapi-spigot-shade`. -::: +:::info -From Paper 1.16.5 build #473 onwards, Paper now includes [Kyori's Adventure API](https://github.com/KyoriPowered/adventure-platform). This library is a replacement of the BungeeCord chat API and has all the same functionality as the BungeeCord chat API (and more!). The documentation for this API can be found [here](https://docs.adventure.kyori.net/index.html). +The three following classes, `ChatColorArgument`, `ChatComponentArgument` and `ChatArgument` depend on a Paper based server which has the Adventure library. If you use any of these classes on a server without the Adventure library, they will throw a `PaperAdventureNotFoundException`. -Since this functions very similar to the Spigot chat arguments, this page won't reiterate everything about how it works, we'll just outline some examples of how to use these arguments instead. +::: ## Adventure chat color argument ![Chatcolor argument in-game, displaying a list of Minecraft chat colors](/images/arguments/chatcolor.png) -The `AdventureChatColorArgument` class is used to represent a given chat color (e.g., red or green). This argument returns the `NamedTextColor` object. If `reset` is passed to this argument, this will return `NamedTextColor.WHITE`. +The `ChatColorArgument` class is used to represent a given chat color (e.g., red or green). This argument returns the `NamedTextColor` object. If `reset` is passed to this argument, this will return `NamedTextColor.WHITE`. ::::tip Example – Username color changing plugin @@ -47,7 +49,7 @@ We then use the `ChatColorArgument` to change the player's name color: ## Adventure chat component argument -The `AdventureChatComponentArgument` class accepts raw chat-based JSON as valid input, as declared [here](https://minecraft.wiki/w/Raw_JSON_text_format). This is converted into Adventure's `Component` class. +The `ChatComponentArgument` class accepts raw chat-based JSON as valid input, as declared [here](https://minecraft.wiki/w/Raw_JSON_text_format). This is converted into Adventure's `Component` class. ::::tip Example – Opening a book with raw JSON content @@ -72,11 +74,11 @@ We can construct a book using the Adventure API's `Book.book(Component, Componen ## Adventure chat argument -The `AdventureChatArgument` class is the equivalent Adventure API class for the `ChatArgument` - it represents infinitely long strings similar to the `GreedyStringArgument` and allows entity selectors such as `@e`, `@p` and so on. The `AdventureChatArgument` returns a `Component`, similar to the `AdventureChatComponentArgument`. +The `ChatArgument` represents infinitely long strings similar to the `GreedyStringArgument` and allows entity selectors such as `@e`, `@p` and so on. The `ChatArgument` returns a `Component`, similar to the `ChatComponentArgument`. ::::tip Example – Sending personalized messages to players -We'll take the same example from the `ChatArgument` class, but using the `AdventureChatArgument` instead - We want to create a personalized message broadcasted to all users using a chat component that allows entity selectors. For this command, we want the following syntax: +We want to create a personalized message broadcasted to all users using a chat component that allows entity selectors. For this command, we want the following syntax: ```mccmd /pbroadcast diff --git a/docs/en/dev-setup/setup.md b/docs/en/dev-setup/setup.md index 38fe0fe2..5988ca4d 100644 --- a/docs/en/dev-setup/setup.md +++ b/docs/en/dev-setup/setup.md @@ -46,16 +46,30 @@ If you've never used a build system before, I highly recommend it! It makes it e - Add the dependency to your `pom.xml`: +:::tabs +===Paper ```xml dev.jorel - commandapi-bukkit-core + commandapi-paper-core 11.0.0-SNAPSHOT provided ``` +===Spigot + ```xml + + + dev.jorel + commandapi-spigot-core + 11.0.0-SNAPSHOT + provided + + + ``` +:::
@@ -88,21 +102,38 @@ If you've never used a build system before, I highly recommend it! It makes it e
+ :::tabs + ===Paper ```groovy dependencies { - compileOnly "dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT" + compileOnly "dev.jorel:commandapi-paper-core:11.0.0-SNAPSHOT" } ``` + ===Spigot + ```groovy + dependencies { + compileOnly "dev.jorel:commandapi-spigot-core:11.0.0-SNAPSHOT" + } + ``` + :::
+ :::tabs + ===Paper ```kotlin dependencies { - compileOnly("dev.jorel:commandapi-bukkit-core:11.0.0-SNAPSHOT") + compileOnly("dev.jorel:commandapi-paper-core:11.0.0-SNAPSHOT") } ``` - + ===Spigot + ```kotlin + dependencies { + compileOnly("dev.jorel:commandapi-spigot-core:11.0.0-SNAPSHOT") + } + ``` + :::
diff --git a/docs/en/dev-setup/shading.md b/docs/en/dev-setup/shading.md index c3e007b6..0c3d871e 100644 --- a/docs/en/dev-setup/shading.md +++ b/docs/en/dev-setup/shading.md @@ -37,32 +37,44 @@ The `onLoad(CommandAPIConfig)` method initializes the CommandAPI's loading seque public class CommandAPIConfig { CommandAPIConfig verboseOutput(boolean value); // Enables verbose logging CommandAPIConfig silentLogs(boolean value); // Disables ALL logging (except errors) - CommandAPIConfig useLatestNMSVersion(boolean value); // Whether the latest NMS implementation should be used or not - CommandAPIConfig beLenientForMinorVersions(boolean value); // Whether the CommandAPI should be more lenient with minor Minecraft versions - CommandAPIConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing CommandAPIConfig dispatcherFile(File file); // If not null, the CommandAPI will create a JSON file with Brigadier's command tree CommandAPIConfig setNamespace(String namespace); // The namespace to use when the CommandAPI registers a command - - CommandAPIConfig initializeNBTAPI(Class nbtContainerClass, Function nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info } ``` The `CommandAPIConfig` class follows a typical builder pattern (without you having to run `.build()` at the end), which lets you easily construct configuration instances. -However, the `CommandAPIConfig` class is abstract and can’t be used to configure the CommandAPI directly. Instead, you must use a subclass of `CommandAPIConfig` that corresponds to the platform you’re developing for. For example, when developing for Bukkit, you should use the `CommandAPIBukkitConfig` class. +However, the `CommandAPIConfig` class is abstract and can’t be used to configure the CommandAPI directly. Instead, you must use a subclass of `CommandAPIConfig` that corresponds to the platform you’re developing for. For example, when developing for a Bukkit-based server, you should use the `CommandAPIPaperConfig` or the `CommandAPISpigotConfig` class. +:::tabs +===Bukkit ```java -public class CommandAPIBukkitConfig extends CommandAPIConfig { - CommandAPIBukkitConfig(JavaPlugin plugin); +public abstract class CommandAPIBukkitConfig extends CommandAPIConfig { + CommandAPIBukkitConfig useLatestNMSVersion(boolean value); // Whether the latest NMS implementation should be used or not + CommandAPIBukkitConfig beLenientForMinorVersions(boolean value); // Whether the CommandAPI should be more lenient with minor Minecraft versions + CommandAPIBukkitConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing + CommandAPIConfig initializeNBTAPI(Class nbtContainerClass, Function nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info +} +``` +===Paper +```java +public class CommandAPIPaperConfig extends CommandAPIBukkitConfig { + CommandAPIPaperConfig(LifecycleEventOwner lifecycleEventOwner); +} +``` +===Spigot +```java +public class CommandAPISpigotConfig extends CommandAPIBukkitConfig { + CommandAPISpigotConfig(JavaPlugin plugin); - CommandAPIBukkitConfig shouldHookPaperReload(boolean hooked); // Whether the CommandAPI should hook into the Paper-exclusive ServerResourcesReloadedEvent - CommandAPIBukkitConfig skipReloadDatapacks(boolean skip); // Whether the CommandAPI should reload datapacks on server load + CommandAPISpigotConfig skipReloadDatapacks(boolean skip); // Whether the CommandAPI should reload datapacks on server load } ``` +::: -In order to create a `CommandAPIBukkitConfig` object, you must give it a reference to your `JavaPlugin` instance. The CommandAPI always uses this to register events, so it is required when loading the CommandAPI on Bukkit. There are also Bukkit-specific features, such as the `hook-paper-reload` configuration option, which may be configured using a `CommandAPIBukkitConfig` instance. +In order to create a `CommandAPIPaperConfig` or a `CommandAPISpigotConfig` object, you must give it a reference to your `JavaPlugin` instance. The CommandAPI always uses this to register events, so it is required when loading the CommandAPI on Bukkit. There are also platform-specific features, such as the `hook-paper-reload` configuration option on Paper, which may be configured using a `CommandAPIPaperConfig` instance. For example, to load the CommandAPI on Bukkit with all logging disabled, you can use the following: @@ -112,11 +124,12 @@ Add the CommandAPI shade dependency: dev.jorel - commandapi-bukkit-shade + commandapi-spigot-shade 11.0.0-SNAPSHOT ``` +
@@ -124,11 +137,12 @@ Add the CommandAPI shade dependency: dev.jorel - commandapi-bukkit-shade-mojang-mapped + commandapi-paper-shade 11.0.0-SNAPSHOT ``` +
You can shade the CommandAPI easily by adding the `maven-shade-plugin` to your build sequence: @@ -221,17 +235,19 @@ Next, we declare our dependencies: ```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-shade:11.0.0-SNAPSHOT" + implementation "dev.jorel:commandapi-spigot-shade:11.0.0-SNAPSHOT" } ``` +
```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-shade-mojang-mapped:11.0.0-SNAPSHOT" + implementation "dev.jorel:commandapi-paper-shade:11.0.0-SNAPSHOT" } ``` +
@@ -239,17 +255,19 @@ dependencies { ```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-shade:11.0.0-SNAPSHOT") + implementation("dev.jorel:commandapi-spigot-shade:11.0.0-SNAPSHOT") } ``` +
```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-shade-mojang-mapped:11.0.0-SNAPSHOT") + implementation("dev.jorel:commandapi-paper-shade:11.0.0-SNAPSHOT") } ``` +
diff --git a/docs/en/kotlin-dsl/intro.md b/docs/en/kotlin-dsl/intro.md index e638e51d..895930fc 100644 --- a/docs/en/kotlin-dsl/intro.md +++ b/docs/en/kotlin-dsl/intro.md @@ -15,21 +15,34 @@ This DSL provides many methods to easily add arguments to your command structure ## Installing the DSL -To install the DSL, you need to add the `commandapi-bukkit-kotlin` dependency into your `pom.xml` or your `build.gradle`, making sure to specify the server flavor you are developing for: +To install the DSL, you need to add the Kotlin DSL dependency into your build script, making sure to specify the server flavor you are developing for: ### Adding the dependency
+:::tabs +===Paper ```xml dev.jorel - commandapi-bukkit-kotlin + commandapi-kotlin-paper 11.0.0-SNAPSHOT ``` +===Spigot +```xml + + + dev.jorel + commandapi-kotlin-spigot + 11.0.0 + + +``` +::: Next, you need to add Kotlin to your project. For this, you first need to add the dependency: @@ -104,20 +117,38 @@ Next, you need to add the dependency:
+:::tabs +===Paper ```groovy dependencies { - implementation "dev.jorel:commandapi-bukkit-kotlin:11.0.0-SNAPSHOT" + implementation "dev.jorel:commandapi-kotlin-paper:11.0.0" } ``` +===Spigot +```groovy +dependencies { + implementation "dev.jorel:commandapi-kotlin-spigot:11.0.0" +} +``` +:::
+:::tabs +===Paper +```kotlin +dependencies { + implementation("dev.jorel:commandapi-kotlin-paper:11.0.0") +} +``` +===Spigot ```kotlin dependencies { - implementation("dev.jorel:commandapi-bukkit-kotlin:11.0.0-SNAPSHOT") + implementation("dev.jorel:commandapi-kotlin-spigot:11.0.0") } ``` +:::
diff --git a/docs/en/upgrading-parts/10.1.2-to-11.0.0.md b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md new file mode 100644 index 00000000..05357c11 --- /dev/null +++ b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md @@ -0,0 +1,43 @@ +### CommandAPI restructure + +#### General module changes + +For 11.0.0, the `commandapi-bukkit-xxx` modules have mostly been removed in favour of new platform specific modules that have been made for Paper or Spigot respectively: + +- `commandapi-paper-xxx` +- `commandapi-spigot-xxx` + +In order to update please replace your `commandapi-bukkit-xxx` dependency with either `commandapi-paper-xxx` or `commandapi-spigot-xxx`. + +:::danger **Developer's Note:** + +The fact that Paper is a fork of Spigot does not mean that the Spigot modules work on Paper. Paper has, especially in newer versions, made changes to internal systems the CommandAPI +uses. There are no guarantees that the Spigot modules will work on Paper in any kind or form. + +Similarly, if you try to use the Paper modules on Spigot you will face registration issues and potential `NoClassDefFoundError`s, depending on the server version you use. +There again is no guarantee for any kind of compatibility. + +::: + +Additionally, the Kotlin module artifact names have changed. Instead of following the pattern `commandapi-bukkit-xxx`, they have now been updated as follows: + +- `commandapi-core-kotlin`: was changed to `commandapi-kotlin-core` +- `commandapi-bukkit-kotlin`: was changed to `commandapi-kotlin-bukkit` + +#### Code changes + +The `CommandAPIBukkitConfig` class has been converted into an abstract class and is no longer used to construct a config instance. Instead, use the new `CommandAPIPaperConfig` or +`CommandAPISpigot` classes, depending on the module you use. + +Further changes have been made to arguments that work with components. The classes `AdventureChatArgument`, `AdventureChatComponentArgument` and `AdventureChatColorArgument` have been +removed. Instead, the `ChatArgument`, `ChatComponentArgument` and `ChatColorArgument` have been implemented platform specific and return different types on Paper and Spigot. +On Paper, Adventure components are used while Spigot uses BungeeCord components. + +More argument changes have been made: + +- The `FloatRangeArgument` has been renamed to `DoubleRangeArgument` and now returns a `DoubleRange` object +- The `PlayerArgument` and `OfflinePlayerArgument` have been replaced by the `PlayerProfileArgument` which returns a `List<PlayerProfile>`. The `PlayerProfile` class changes depending on if you are on Paper or on Spigot. Use the `EntitySelectorArgument.OnePlayer` if you want a `Player` object. +- The `AsyncOfflinePlayerArgument` has been replaced by the `AsyncPlayerProfileArgument` +- The `ChatArgument`, `ChatComponentArgument` and `ChatColorArgument` do no longer have any `Adventure` prefixes and return different types depending on the platform. +- The `ChatArgument` returns a `SignedMessage` object on Paper +- The `BlockStateArgument` now returns a `BlockState` object instead of a `BlockData` object \ No newline at end of file diff --git a/docs/en/user-setup/config.md b/docs/en/user-setup/config.md index 69fb3c67..80952750 100644 --- a/docs/en/user-setup/config.md +++ b/docs/en/user-setup/config.md @@ -16,6 +16,8 @@ The default `config.yml` is shown below: ::: details **config.yml** +:::tabs +===Paper ```yaml # Verbose outputs (default: false) # If "true", outputs command registration and unregistration logs in the console @@ -85,7 +87,67 @@ other-commands-to-convert: [] # plugin to this list. skip-sender-proxy: [] ``` +===Spigot +```yaml +# Verbose outputs (default: false) +# If "true", outputs command registration and unregistration logs in the console +verbose-outputs: false + +# Silent logs (default: false) +# If "true", turns off all logging from the CommandAPI, except for errors. +silent-logs: false + +# Messages +# Controls messages that the CommandAPI displays to players +messages: + + # Missing executor implementation (default: "This command has no implementations for %s") + # The message to display to senders when a command has no executor. Available + # parameters are: + # %s - the executor class (lowercase) + # %S - the executor class (normal case) + missing-executor-implementation: This command has no implementations for %s + +# Create dispatcher JSON (default: false) +# If "true", the CommandAPI creates a command_registration.json file showing the +# mapping of registered commands. This is designed to be used by developers - +# setting this to "false" will improve command registration performance. +create-dispatcher-json: false + +# Use latest version (default: false) +# If "true", the CommandAPI will use the latest available NMS implementation +# when the CommandAPI is used. This avoids all checks to see if the latest NMS +# implementation is actually compatible with the current Minecraft version. +use-latest-nms-version: false +# Be lenient with version checks when loading for new minor Minecraft versions (default: false) +# If "true", the CommandAPI loads NMS implementations for potentially unsupported Minecraft versions. +# For example, this setting may allow updating from 1.21.1 to 1.21.2 as only the minor version is changing +# but will not allow an update from 1.21.2 to 1.22. +# Keep in mind that implementations may vary and actually updating the CommandAPI might be necessary. +be-lenient-for-minor-versions: false + +# Skips the initial datapack reload when the server loads (default: false) +# If "true", the CommandAPI will not reload datapacks when the server has finished +# loading. Datapacks will still be reloaded if performed manually when "hook-paper-reload" +# is set to "true" and /minecraft:reload is run. +skip-initial-datapack-reload: false + +# Plugins to convert (default: []) +# Controls the list of plugins to process for command conversion. +plugins-to-convert: [] + +# Other commands to convert (default: []) +# A list of other commands to convert. This should be used for commands which +# are not declared in a plugin.yml file. +other-commands-to-convert: [] + +# Skip sender proxy (default: []) +# Determines whether the proxy sender should be skipped when converting a +# command. If you are having issues with plugin command conversion, add the +# plugin to this list. +skip-sender-proxy: [] +``` ::: ## Configuration settings From 085078ec84a4b453e5ab188fedb02e5165323398 Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:30:53 +0100 Subject: [PATCH 3/8] Add diff language support --- docs/.vitepress/config.mts | 7 ++++++- docs/en/upgrading-parts/10.1.2-to-11.0.0.md | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index d0ad3708..b54e7fe5 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -113,8 +113,13 @@ const vitepressOptions: UserConfig = { }] }).then(_ => { }) + shiki.loadLanguage({ + name: 'diff', + scopeName: 'source.diff' + }).then(_ => { + }) }, - config: (md) => { + config: ( md) => { tabsPlugin(md); injectUpgradingPartsPlugin(md); mermaidSpaceConverter(md); diff --git a/docs/en/upgrading-parts/10.1.2-to-11.0.0.md b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md index 05357c11..5a3f4701 100644 --- a/docs/en/upgrading-parts/10.1.2-to-11.0.0.md +++ b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md @@ -9,6 +9,21 @@ For 11.0.0, the `commandapi-bukkit-xxx` modules have mostly been removed in favo In order to update please replace your `commandapi-bukkit-xxx` dependency with either `commandapi-paper-xxx` or `commandapi-spigot-xxx`. +More dependency-related changes have taken place, here they all are listed: + +```diff +commandapi-bukkit-xxx // [!code --] +commandapi-paper-xxx // [!code ++] +commandapi-spigot-xxx // [!code ++] + +commandapi-core-kotlin // [!code --] +commandapi-kotlin-core // [!code ++] + +commandapi-bukkit-kotlin // [!code --] +commandapi-kotlin-paper // [!code ++] +commandapi-kotlin-spigot // [!code ++] +``` + :::danger **Developer's Note:** The fact that Paper is a fork of Spigot does not mean that the Spigot modules work on Paper. Paper has, especially in newer versions, made changes to internal systems the CommandAPI @@ -19,11 +34,6 @@ There again is no guarantee for any kind of compatibility. ::: -Additionally, the Kotlin module artifact names have changed. Instead of following the pattern `commandapi-bukkit-xxx`, they have now been updated as follows: - -- `commandapi-core-kotlin`: was changed to `commandapi-kotlin-core` -- `commandapi-bukkit-kotlin`: was changed to `commandapi-kotlin-bukkit` - #### Code changes The `CommandAPIBukkitConfig` class has been converted into an abstract class and is no longer used to construct a config instance. Instead, use the new `CommandAPIPaperConfig` or From 2516a3aae8a9b93072094b9d0dc2a6834289c3c9 Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Fri, 22 Aug 2025 21:02:13 +0200 Subject: [PATCH 4/8] Update mappings preference switch to say "Paper" and "Spigot" instead of "Mojmap" and "Reobf" --- docs/.vitepress/theme/preference/PreferenceSwitch.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/.vitepress/theme/preference/PreferenceSwitch.vue b/docs/.vitepress/theme/preference/PreferenceSwitch.vue index 8bd96e53..64bc1ab8 100644 --- a/docs/.vitepress/theme/preference/PreferenceSwitch.vue +++ b/docs/.vitepress/theme/preference/PreferenceSwitch.vue @@ -123,14 +123,14 @@ onMounted(() => {
- + - +
From d81cac5c653e7a3fa2738e5f95bdd4ec7913fdda Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Fri, 22 Aug 2025 21:22:39 +0200 Subject: [PATCH 5/8] Document the updated config options --- docs/en/dev-setup/shading.md | 3 +-- docs/en/upgrading-parts/10.1.2-to-11.0.0.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/en/dev-setup/shading.md b/docs/en/dev-setup/shading.md index 0c3d871e..265b6ec6 100644 --- a/docs/en/dev-setup/shading.md +++ b/docs/en/dev-setup/shading.md @@ -52,8 +52,7 @@ However, the `CommandAPIConfig` class is abstract and can’t be used to configu ===Bukkit ```java public abstract class CommandAPIBukkitConfig extends CommandAPIConfig { - CommandAPIBukkitConfig useLatestNMSVersion(boolean value); // Whether the latest NMS implementation should be used or not - CommandAPIBukkitConfig beLenientForMinorVersions(boolean value); // Whether the CommandAPI should be more lenient with minor Minecraft versions + CommandAPIBukkitConfig fallbackToLatestNMS(boolean fallbackToLatestNMS); // Whether the CommandAPI should fall back to the latest NMS version if no implementation for the current version was found CommandAPIBukkitConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing CommandAPIConfig initializeNBTAPI(Class nbtContainerClass, Function nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info } diff --git a/docs/en/upgrading-parts/10.1.2-to-11.0.0.md b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md index 5a3f4701..1fd74134 100644 --- a/docs/en/upgrading-parts/10.1.2-to-11.0.0.md +++ b/docs/en/upgrading-parts/10.1.2-to-11.0.0.md @@ -43,11 +43,20 @@ Further changes have been made to arguments that work with components. The class removed. Instead, the `ChatArgument`, `ChatComponentArgument` and `ChatColorArgument` have been implemented platform specific and return different types on Paper and Spigot. On Paper, Adventure components are used while Spigot uses BungeeCord components. -More argument changes have been made: +**More argument changes have been made:** - The `FloatRangeArgument` has been renamed to `DoubleRangeArgument` and now returns a `DoubleRange` object - The `PlayerArgument` and `OfflinePlayerArgument` have been replaced by the `PlayerProfileArgument` which returns a `List<PlayerProfile>`. The `PlayerProfile` class changes depending on if you are on Paper or on Spigot. Use the `EntitySelectorArgument.OnePlayer` if you want a `Player` object. - The `AsyncOfflinePlayerArgument` has been replaced by the `AsyncPlayerProfileArgument` - The `ChatArgument`, `ChatComponentArgument` and `ChatColorArgument` do no longer have any `Adventure` prefixes and return different types depending on the platform. - The `ChatArgument` returns a `SignedMessage` object on Paper -- The `BlockStateArgument` now returns a `BlockState` object instead of a `BlockData` object \ No newline at end of file +- The `BlockStateArgument` now returns a `BlockState` object instead of a `BlockData` object + +#### Config changes + +The `use-latest-nms-version` and `be-lenient-for-minor-versions` config options have been removed and have been replaced by the new `fallback-to-latest-nms` config option. +This config options combines the functionality of the former config options by first trying to load the correct version and if it can't find a matching implementation for the current version, +it, if set to `true`, will load the latest implementation. +On Paper it is set to `true` by default and on Spigot it is set to `false`. + +Furthermore, any config options relating to reloading datapacks have been removed on Paper as they are not needed anymore. \ No newline at end of file From 7408d7ec79d92c5a1935d7d53c1a6cb8d9f66455 Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Fri, 22 Aug 2025 21:38:30 +0200 Subject: [PATCH 6/8] Update default configs --- docs/en/user-setup/config.md | 53 ++++++++---------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/docs/en/user-setup/config.md b/docs/en/user-setup/config.md index 80952750..25bdc247 100644 --- a/docs/en/user-setup/config.md +++ b/docs/en/user-setup/config.md @@ -44,33 +44,11 @@ messages: # setting this to "false" will improve command registration performance. create-dispatcher-json: false -# Use latest version (default: false) -# If "true", the CommandAPI will use the latest available NMS implementation -# when the CommandAPI is used. This avoids all checks to see if the latest NMS -# implementation is actually compatible with the current Minecraft version. -use-latest-nms-version: false - -# Be lenient with version checks when loading for new minor Minecraft versions (default: false) -# If "true", the CommandAPI loads NMS implementations for potentially unsupported Minecraft versions. -# For example, this setting may allow updating from 1.21.1 to 1.21.2 as only the minor version is changing -# but will not allow an update from 1.21.2 to 1.22. -# Keep in mind that implementations may vary and actually updating the CommandAPI might be necessary. -be-lenient-for-minor-versions: false - -# Hook into Paper's ServerResourcesReloadedEvent (default: false) -# If "true", and the CommandAPI detects it is running on a Paper server, it will -# hook into Paper's ServerResourcesReloadedEvent to detect when /minecraft:reload is run. -# This allows the CommandAPI to automatically call its custom datapack-reloading -# function which allows CommandAPI commands to be used in datapacks. -# If you set this to false, CommandAPI commands may not work inside datapacks after -# reloading datapacks. -hook-paper-reload: false - -# Skips the initial datapack reload when the server loads (default: true) -# If "true", the CommandAPI will not reload datapacks when the server has finished -# loading. Datapacks will still be reloaded if performed manually when "hook-paper-reload" -# is set to "true" and /minecraft:reload is run. -skip-initial-datapack-reload: true +# Fallback to latest version (default: true) +# If "true", the CommandAPI will fall back to the latest available NMS +# implementation when the CommandAPI is used and no implementation for the +# current Minecraft version was found. +fallback-to-latest-nms: true # Plugins to convert (default: []) # Controls the list of plugins to process for command conversion. @@ -114,24 +92,17 @@ messages: # setting this to "false" will improve command registration performance. create-dispatcher-json: false -# Use latest version (default: false) -# If "true", the CommandAPI will use the latest available NMS implementation -# when the CommandAPI is used. This avoids all checks to see if the latest NMS -# implementation is actually compatible with the current Minecraft version. -use-latest-nms-version: false - -# Be lenient with version checks when loading for new minor Minecraft versions (default: false) -# If "true", the CommandAPI loads NMS implementations for potentially unsupported Minecraft versions. -# For example, this setting may allow updating from 1.21.1 to 1.21.2 as only the minor version is changing -# but will not allow an update from 1.21.2 to 1.22. -# Keep in mind that implementations may vary and actually updating the CommandAPI might be necessary. -be-lenient-for-minor-versions: false +# Fallback to latest version (default: false) +# If "true", the CommandAPI will fall back to the latest available NMS +# implementation when the CommandAPI is used and no implementation for the +# current Minecraft version was found. +fallback-to-latest-nms: false -# Skips the initial datapack reload when the server loads (default: false) +# Skips the initial datapack reload when the server loads (default: true) # If "true", the CommandAPI will not reload datapacks when the server has finished # loading. Datapacks will still be reloaded if performed manually when "hook-paper-reload" # is set to "true" and /minecraft:reload is run. -skip-initial-datapack-reload: false +skip-initial-datapack-reload: true # Plugins to convert (default: []) # Controls the list of plugins to process for command conversion. From 759a92c451597a5e711cd1437b79fd1ed42504f6 Mon Sep 17 00:00:00 2001 From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> Date: Fri, 22 Aug 2025 22:04:09 +0200 Subject: [PATCH 7/8] Rename "mappings" preference to "paper-spigot" and use that on the config page --- .../theme/preference/PreferenceSwitch.vue | 12 +++---- docs/en/dev-setup/shading.md | 14 ++++---- docs/en/user-setup/config.md | 32 ++++++------------- 3 files changed, 22 insertions(+), 36 deletions(-) diff --git a/docs/.vitepress/theme/preference/PreferenceSwitch.vue b/docs/.vitepress/theme/preference/PreferenceSwitch.vue index 64bc1ab8..9810ce1f 100644 --- a/docs/.vitepress/theme/preference/PreferenceSwitch.vue +++ b/docs/.vitepress/theme/preference/PreferenceSwitch.vue @@ -122,7 +122,7 @@ onMounted(() => { /> -
+
{