|
34 | 34 | * Capabilities for the Bukkit module |
35 | 35 | */ |
36 | 36 | public enum CloudBukkitCapabilities implements CloudCapability { |
| 37 | + /** |
| 38 | + * Whether Brigadier is present in the current environment. Certain parser types require this, and are able to work |
| 39 | + * even if a capability for Brigadier command registration is not present (as long as this capability is present). |
| 40 | + */ |
37 | 41 | BRIGADIER(CraftBukkitReflection.classExists("com.mojang.brigadier.tree.CommandNode") |
38 | 42 | && CraftBukkitReflection.findOBCClass("command.BukkitCommandWrapper") != null), |
39 | 43 |
|
| 44 | + /** |
| 45 | + * Whether support for native Brigadier command registration is available |
| 46 | + * through the Paper API ({@code PaperCommandManager#registerBrigadier} from {@code cloud-paper}). |
| 47 | + */ |
40 | 48 | NATIVE_BRIGADIER(CraftBukkitReflection.classExists( |
41 | 49 | "com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent")), |
42 | 50 |
|
| 51 | + /** |
| 52 | + * Whether support for Brigadier command registration is available through Commodore |
| 53 | + * ({@link BukkitCommandManager#registerBrigadier}). |
| 54 | + * |
| 55 | + * <p><b>Note:</b> As of 1.19.2, Commodore simply delegates to the same Paper API as cloud is capable of using directly, |
| 56 | + * doing nothing on non-Paper Bukkit implementations. As such, this capability will not be present in 1.19.2+ environments. |
| 57 | + * Users should prefer using {@code PaperCommandManager} from {@code cloud-paper} and checking for |
| 58 | + * {@link #NATIVE_BRIGADIER}.</p> |
| 59 | + */ |
43 | 60 | COMMODORE_BRIGADIER(BRIGADIER.capable() |
44 | 61 | && !NATIVE_BRIGADIER.capable() |
45 | 62 | && !CraftBukkitReflection.classExists("org.bukkit.entity.Warden")), |
46 | 63 |
|
| 64 | + /** |
| 65 | + * Whether asynchronous command completions are supported through the Paper API. |
| 66 | + */ |
47 | 67 | ASYNCHRONOUS_COMPLETION(CraftBukkitReflection.classExists( |
48 | 68 | "com.destroystokyo.paper.event.server.AsyncTabCompleteEvent")); |
49 | 69 |
|
|
0 commit comments