Skip to content

Commit 2873d18

Browse files
committed
Start dealing with the code review
- Functions page needs a rewrite - The IntegerRange/DoubleRange argument page needs a new screenshot - Apparently there might be some rendering issues with the diff on the upgrade page to 11.0.0?
1 parent 446df85 commit 2873d18

File tree

7 files changed

+52
-45
lines changed

7 files changed

+52
-45
lines changed

docs/en/create-commands/arguments/suggestions/safe-suggestions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ The list of supported arguments are displayed in the following table. The parame
5151
| [`AxisArgument`](../types/position/axis-arguments) | `java.util.EnumSet<org.bukkit.Axis>` |
5252
| [`BiomeArgument`](../types/misc/biome-arguments) | `org.bukkit.block.Biome` |
5353
| [`BooleanArgument`](../types/primitive-arguments) | **`Boolean`** |
54-
| [`ChatColorArgument`](../types/chat/spigot-chat-arguments#chat-color-argument) | `org.bukkit.ChatColor` |
54+
| [`ChatColorArgument`](../types/chat/spigot-chat-arguments#chat-color-argument) | `net.kyori.adventure.text.format.NamedTextColor` |
5555
| [`DoubleArgument`](../types/primitive-arguments#numerical-arguments) | **`Double`** |
56+
| [`DoubleRangeArgument`](../types/ranged-arguments#the-integer-range-and-double-range-class) | `dev.jorel.commandapi.wrappers.DoubleRange` |
5657
| [`EnchantmentArgument`](../types/misc/enchantment-arguments) | `org.bukkit.enchantments.Enchantment` |
5758
| [`EntityTypeArgument`](../types/entities-arguments#entity-type-argument) | `org.bukkit.entity.EntityType` |
5859
| [`FloatArgument`](../types/primitive-arguments#numerical-arguments) | **`Float`** |
59-
| [`FloatRangeArgument`](../types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.FloatRange` |
6060
| [`FunctionArgument`](../../functions-and-tags/function-arguments) | **`org.bukkit.NamespacedKey`** |
6161
| [`GreedyStringArgument`](../types/string-arguments#greedy-string-argument) | `String` |
6262
| [`IntegerArgument`](../types/primitive-arguments#numerical-arguments) | **`Integer`** |
63-
| [`IntegerRangeArgument`](../types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.IntegerRange` |
63+
| [`IntegerRangeArgument`](../types/ranged-arguments#the-integer-range-and-double-range-class) | `dev.jorel.commandapi.wrappers.IntegerRange` |
6464
| [`ItemStackArgument`](../types/misc/itemstack-arguments) | `org.bukkit.inventory.ItemStack` |
6565
| [`Location2DArgument`](../types/position/location-arguments#2d-location) | `dev.jorel.commandapi.wrappers.Location2D` |
6666
| [`LocationArgument`](../types/position/location-arguments#3d-location) | `org.bukkit.Location` |
@@ -91,14 +91,14 @@ The list of supported arguments are displayed in the following table. The parame
9191
| [`BooleanArgument`](../types/primitive-arguments) | **`Boolean`** |
9292
| [`ChatColorArgument`](../types/chat/spigot-chat-arguments#chat-color-argument) | `org.bukkit.ChatColor` |
9393
| [`DoubleArgument`](../types/primitive-arguments#numerical-arguments) | **`Double`** |
94+
| [`DoubleRangeArgument`](../types/ranged-arguments#the-integer-range-and-double-range-class) | `dev.jorel.commandapi.wrappers.DoubleRange` |
9495
| [`EnchantmentArgument`](../types/misc/enchantment-arguments) | `org.bukkit.enchantments.Enchantment` |
9596
| [`EntityTypeArgument`](../types/entities-arguments#entity-type-argument) | `org.bukkit.entity.EntityType` |
9697
| [`FloatArgument`](../types/primitive-arguments#numerical-arguments) | **`Float`** |
97-
| [`FloatRangeArgument`](../types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.FloatRange` |
9898
| [`FunctionArgument`](../../functions-and-tags/function-arguments) | **`org.bukkit.NamespacedKey`** |
9999
| [`GreedyStringArgument`](../types/string-arguments#greedy-string-argument) | `String` |
100100
| [`IntegerArgument`](../types/primitive-arguments#numerical-arguments) | **`Integer`** |
101-
| [`IntegerRangeArgument`](../types/ranged-arguments#the-integerrange--floatrange-class) | `dev.jorel.commandapi.wrappers.IntegerRange` |
101+
| [`IntegerRangeArgument`](../types/ranged-arguments#the-integer-range-and-double-range-class) | `dev.jorel.commandapi.wrappers.IntegerRange` |
102102
| [`ItemStackArgument`](../types/misc/itemstack-arguments) | `org.bukkit.inventory.ItemStack` |
103103
| [`Location2DArgument`](../types/position/location-arguments#2d-location) | `dev.jorel.commandapi.wrappers.Location2D` |
104104
| [`LocationArgument`](../types/position/location-arguments#3d-location) | `org.bukkit.Location` |

docs/en/create-commands/arguments/types/ranged-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `DoubleRange` class has the following methods:
4343
class DoubleRange {
4444
public double getLowerBound();
4545
public double getUpperBound();
46-
public boolean isInRange(float);
46+
public boolean isInRange(double);
4747
}
4848
```
4949

docs/en/create-commands/registration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Places where you can register commands are listed below:
210210
| When to load | What to do |
211211
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
212212
| `bootstrap(BootstrapContext)` method | Register commands to be used in Minecraft functions ([see the Function section for more info](./functions-and-tags/functions)) |
213-
| `onLoad()`/`onEnable()` method | Register regular commands not available in datapacks by default |
213+
| `onLoad()`/`onEnable()` method | Register regular commands not available in datapacks |
214214

215215
</div>
216216
<div class="spigot">

docs/en/dev-setup/shading.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,47 +33,29 @@ If you want to handle reloading, the CommandAPI has minimal support for it with
3333

3434
The `onLoad(CommandAPIConfig)` method initializes the CommandAPI's loading sequence. This must be called _before_ you start to access the CommandAPI and must be placed in your plugin's `onLoad()` method. The argument `CommandAPIConfig` is used to configure how the CommandAPI works. The `CommandAPIConfig` class has the following parameters which let you set how the CommandAPI works similar to the `config.yml`, which is described [here](../user-setup/config).
3535

36-
```java
37-
public class CommandAPIConfig {
38-
CommandAPIConfig verboseOutput(boolean value); // Enables verbose logging
39-
CommandAPIConfig silentLogs(boolean value); // Disables ALL logging (except errors)
40-
CommandAPIConfig dispatcherFile(File file); // If not null, the CommandAPI will create a JSON file with Brigadier's command tree
41-
CommandAPIConfig setNamespace(String namespace); // The namespace to use when the CommandAPI registers a command
42-
}
43-
```
44-
4536
The `CommandAPIConfig` class follows a typical builder pattern (without you having to run `.build()` at the end), which lets you easily construct configuration instances.
4637

47-
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.
38+
<div class="paper">
4839

49-
<!-- TODO: Add tabs and explanations for other platforms -->
40+
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 Paper server, you should use the `CommandAPIPaperConfig` class.
5041

51-
:::tabs
52-
===Bukkit
5342
```java
54-
public abstract class CommandAPIBukkitConfig extends CommandAPIConfig {
55-
CommandAPIBukkitConfig fallbackToLatestNMS(boolean fallbackToLatestNMS); // Whether the CommandAPI should fall back to the latest NMS version if no implementation for the current version was found
56-
CommandAPIBukkitConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing
57-
<T> CommandAPIConfig initializeNBTAPI(Class<T> nbtContainerClass, Function<Object, T> nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info
58-
}
59-
```
60-
===Paper
61-
```java
62-
public class CommandAPIPaperConfig extends CommandAPIBukkitConfig {
63-
CommandAPIPaperConfig(LifecycleEventOwner lifecycleEventOwner);
64-
}
65-
```
66-
===Spigot
67-
```java
68-
public class CommandAPISpigotConfig extends CommandAPIBukkitConfig {
69-
CommandAPISpigotConfig(JavaPlugin plugin);
70-
71-
CommandAPISpigotConfig skipReloadDatapacks(boolean skip); // Whether the CommandAPI should reload datapacks on server load
43+
public class CommandAPIPaperConfig {
44+
// Create a new config object
45+
CommandAPIPaperConfig(PluginMeta pluginMeta, LifecycleEventOwner lifecycleEventOwner);
46+
47+
// General CommandAPI configuration
48+
CommandAPIPaperConfig verboseOutput(boolean value); // Enables verbose logging
49+
CommandAPIPaperConfig silentLogs(boolean value); // Disables ALL logging (except errors)
50+
CommandAPIPaperConfig dispatcherFile(File file); // If not null, the CommandAPI will create a JSON file with Brigadier's command tree
51+
CommandAPIPaperConfig setNamespace(String namespace); // The namespace to use when the CommandAPI registers a command
52+
53+
// General CommandAPI configuration for Bukkit-based servers
54+
CommandAPIPaperConfig fallbackToLatestNMS(boolean fallbackToLatestNMS); // Whether the CommandAPI should fall back to the latest NMS version if no implementation for the current version was found
55+
CommandAPIPaperConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing
56+
<T> CommandAPIPaperConfig initializeNBTAPI(Class<T> nbtContainerClass, Function<Object, T> nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info
7257
}
7358
```
74-
:::
75-
76-
<div class="paper">
7759

7860
In order to create a `CommandAPIPaperConfig` object, you must give it a reference to your `PluginMeta` and a `LifecycleEventOwner` instance, meaning either a `JavaPlugin` or `BootstrapContext` instance. The CommandAPI always uses this to register events, so it is required when loading the CommandAPI on Paper.
7961

@@ -89,6 +71,29 @@ For example, to load the CommandAPI on Paper with all logging disabled, you can
8971
</div>
9072
<div class="spigot">
9173

74+
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 Spigot server, you should use the `CommandAPISpigotConfig` class.
75+
76+
```java
77+
public class CommandAPISpigotConfig {
78+
// Create a new config object
79+
CommandAPISpigotConfig(JavaPlugin plugin);
80+
81+
// General CommandAPI configuration
82+
CommandAPISpigotConfig verboseOutput(boolean value); // Enables verbose logging
83+
CommandAPISpigotConfig silentLogs(boolean value); // Disables ALL logging (except errors)
84+
CommandAPISpigotConfig dispatcherFile(File file); // If not null, the CommandAPI will create a JSON file with Brigadier's command tree
85+
CommandAPISpigotConfig setNamespace(String namespace); // The namespace to use when the CommandAPI registers a command
86+
87+
// General CommandAPI configuration for Bukkit-based servers
88+
CommandAPISpigotConfig fallbackToLatestNMS(boolean fallbackToLatestNMS); // Whether the CommandAPI should fall back to the latest NMS version if no implementation for the current version was found
89+
CommandAPISpigotConfig missingExecutorImplementationMessage(String value); // Set message to display when executor implementation is missing
90+
<T> CommandAPISpigotConfig initializeNBTAPI(Class<T> nbtContainerClass, Function<Object, T> nbtContainerConstructor); // Initializes hooks with an NBT API. See NBT arguments documentation page for more info
91+
92+
// Spigot-specific configuration
93+
CommandAPISpigotConfig skipReloadDatapacks(boolean skip); // Whether the CommandAPI should reload datapacks on server load
94+
}
95+
```
96+
9297
In order to create 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 Spigot.
9398

9499
For example, to load the CommandAPI on Spigot with all logging disabled, you can use the following:
@@ -102,6 +107,8 @@ For example, to load the CommandAPI on Spigot with all logging disabled, you can
102107

103108
</div>
104109

110+
<!-- TODO: Add tabs and explanations for other platforms -->
111+
105112
### Enabling & Disabling
106113

107114
The `onEnable()` method initializes the CommandAPI's enabling sequence. Similar to the `onLoad(CommandAPIConfig)` method, this must be placed in your plugin's `onEnable()` method. This isn't as strict as the `onLoad(CommandAPIConfig)` method, and can be placed anywhere in your `onEnable()` method.

0 commit comments

Comments
 (0)