Skip to content

Commit f612282

Browse files
committed
Add an option to the plugin config
1 parent c8459cf commit f612282

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/src/main/java/dev/jorel/commandapi/CommandAPIMain.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public void onLoad() {
5151
.missingExecutorImplementationMessage(fileConfig.getString("messages.missing-executor-implementation"))
5252
.dispatcherFile(fileConfig.getBoolean("create-dispatcher-json") ? new File(getDataFolder(), "command_registration.json") : null)
5353
.shouldHookPaperReload(fileConfig.getBoolean("hook-paper-reload"))
54-
.skipReloadDatapacks(fileConfig.getBoolean("skip-initial-datapack-reload"));
54+
.skipReloadDatapacks(fileConfig.getBoolean("skip-initial-datapack-reload"))
55+
.lenientForMinorVersions(fileConfig.getBoolean("lenient-for-minor-versions"));
5556

5657
for (String pluginName : fileConfig.getStringList("skip-sender-proxy")) {
5758
if (Bukkit.getPluginManager().getPlugin(pluginName) != null) {

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin-mojang-mapped/src/main/resources/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ create-dispatcher-json: false
4141
# implementation is actually compatible with the current Minecraft version.
4242
use-latest-nms-version: false
4343

44+
# Be lenient with version checks when loading for new minor Minecraft versions (default: false)
45+
# If "true", the CommandAPI loads NMS implementations for (potentially unsupported) Minecraft versions.
46+
# For example, this setting may allow updating from 1.21.1 to 1.21.2 as only the minor version is changing
47+
# but will not allow an update from 1.21.2 to 1.22
48+
# Keep in mind that implementations my vary and actually updating the CommandAPI might be necessary.
49+
lenient-for-minor-versions: false
50+
4451
# Hook into Paper's ServerResourcesReloadedEvent (default: true)
4552
# If "true", and the CommandAPI detects it is running on a Paper server, it will
4653
# hook into Paper's ServerResourcesReloadedEvent to detect when /minecraft:reload is run.

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/src/main/java/dev/jorel/commandapi/CommandAPIMain.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public void onLoad() {
5151
.missingExecutorImplementationMessage(fileConfig.getString("messages.missing-executor-implementation"))
5252
.dispatcherFile(fileConfig.getBoolean("create-dispatcher-json") ? new File(getDataFolder(), "command_registration.json") : null)
5353
.shouldHookPaperReload(fileConfig.getBoolean("hook-paper-reload"))
54-
.skipReloadDatapacks(fileConfig.getBoolean("skip-initial-datapack-reload"));
54+
.skipReloadDatapacks(fileConfig.getBoolean("skip-initial-datapack-reload"))
55+
.lenientForMinorVersions(fileConfig.getBoolean("lenient-for-minor-versions"));
5556

5657
for (String pluginName : fileConfig.getStringList("skip-sender-proxy")) {
5758
if (Bukkit.getPluginManager().getPlugin(pluginName) != null) {

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/src/main/resources/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ create-dispatcher-json: false
4141
# implementation is actually compatible with the current Minecraft version.
4242
use-latest-nms-version: false
4343

44+
# Be lenient with version checks when loading for new minor Minecraft versions (default: false)
45+
# If "true", the CommandAPI loads NMS implementations for (potentially unsupported) Minecraft versions.
46+
# For example, this setting may allow updating from 1.21.1 to 1.21.2 as only the minor version is changing
47+
# but will not allow an update from 1.21.2 to 1.22
48+
# Keep in mind that implementations my vary and actually updating the CommandAPI might be necessary.
49+
lenient-for-minor-versions: false
50+
4451
# Hook into Paper's ServerResourcesReloadedEvent (default: true)
4552
# If "true", and the CommandAPI detects it is running on a Paper server, it will
4653
# hook into Paper's ServerResourcesReloadedEvent to detect when /minecraft:reload is run.

0 commit comments

Comments
 (0)