You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/CommandAPIBukkit.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,9 @@ public void onEnable() {
217
217
if (paper.isFoliaPresent()) {
218
218
CommandAPI.logNormal("Skipping initial datapack reloading because Folia was detected");
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/CommandAPIBukkitConfig.java
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ public class CommandAPIBukkitConfig extends CommandAPIConfig<CommandAPIBukkitCon
12
12
13
13
// Default configuration
14
14
booleanshouldHookPaperReload = true;
15
+
booleanskipReloadDatapacks = false;
15
16
16
17
/**
17
18
* Creates a new CommandAPIBukkitConfig object. Variables in this
@@ -38,6 +39,18 @@ public CommandAPIBukkitConfig shouldHookPaperReload(boolean hooked) {
38
39
returnthis;
39
40
}
40
41
42
+
/**
43
+
* Sets whether the CommandAPI should skip its datapack reload step after the server
44
+
* has finished loading. This does not skip reloading of datapacks when invoked manually
45
+
* when {@link #shouldHookPaperReload(boolean)} is set.
46
+
* @param skip whether the CommandAPI should skip reloading datapacks when the server has finished loading
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/InternalBukkitConfig.java
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ public class InternalBukkitConfig extends InternalConfig {
14
14
15
15
// Whether to hook into paper's reload event to reload datapacks when /minecraft:reload is run
16
16
privatefinalbooleanshouldHookPaperReload;
17
+
18
+
privatefinalbooleanskipReloadDatapacks;
17
19
18
20
/**
19
21
* Creates an {@link InternalBukkitConfig} from a {@link CommandAPIBukkitConfig}
@@ -24,6 +26,7 @@ public InternalBukkitConfig(CommandAPIBukkitConfig config) {
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/src/main/java/dev/jorel/commandapi/CommandAPIMain.java
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/src/main/resources/config.yml
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,12 @@ use-latest-nms-version: false
50
50
# reloading datapacks.
51
51
hook-paper-reload: true
52
52
53
+
# Skips the initial datapack reload when the server loads (default: false)
54
+
# If "true", the CommandAPI will not reload datapacks when the server has finished
55
+
# loading. Datapacks will still be reloaded if performed manually when "hook-paper-reload"
Copy file name to clipboardExpand all lines: commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/src/main/java/dev/jorel/commandapi/CommandAPIMain.java
Copy file name to clipboardExpand all lines: docssrc/src/config.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,29 @@ hook-paper-reload: false
142
142
143
143
-----
144
144
145
+
146
+
### `skip-initial-datapack-reload`
147
+
148
+
Controls whether the CommandAPI should perform its initial datapack reload when the server has finished loading.
149
+
150
+
The CommandAPI automatically reloads all datapacks in a similar fashion to `/minecraft:reload` in order to propagate CommandAPI commands into datapack functions and tags. This operation may cause a slight delay to server startup and is not necessary if you are not using datapacks or functions that use CommandAPI commands. This operation can be skipped by setting this value to `false`.
151
+
152
+
Note that datapacks will still be reloaded if performed manually when `hook-paper-reload` is set to `true` and you run `/minecraft:reload`.
153
+
154
+
**Default value**
155
+
156
+
```yml
157
+
skip-initial-datapack-reload: false
158
+
```
159
+
160
+
**Example value**
161
+
162
+
```yml
163
+
skip-initial-datapack-reload: true
164
+
```
165
+
166
+
-----
167
+
145
168
### `plugins-to-convert`
146
169
147
170
Controls the list of plugins to process for command conversion. See [Command conversion](./conversionforowners.md) for more information.
0 commit comments