From 134612fc8bc69f501e685ebf2fcff8b7a0118a4d Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sun, 20 Feb 2022 10:15:55 +0800 Subject: [PATCH] Fix the Command Config --- patches/server/0010-Add-fakeplayer-support.patch | 15 ++++++++++----- .../0011-Add-fakeplayer-action-support.patch | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/patches/server/0010-Add-fakeplayer-support.patch b/patches/server/0010-Add-fakeplayer-support.patch index a7149063..f1236b9b 100644 --- a/patches/server/0010-Add-fakeplayer-support.patch +++ b/patches/server/0010-Add-fakeplayer-support.patch @@ -192,7 +192,7 @@ index cd08f9b16c065be8f0eacaeba51d3e72d332daf9..c9616d519c01749dc30c8331af184a5e if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index a73c79e57f51a6ab0f0d0b37fa6c87ff9bd69325..4a91817fabf87a9e3eff06a23a0e13fc26e5d41b 100644 +index a73c79e57f51a6ab0f0d0b37fa6c87ff9bd69325..4b8d05838bd70a2932a36a5919436861b8e41c0b 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -6,6 +6,7 @@ import org.bukkit.Bukkit; @@ -203,17 +203,22 @@ index a73c79e57f51a6ab0f0d0b37fa6c87ff9bd69325..4a91817fabf87a9e3eff06a23a0e13fc import java.io.File; import java.lang.reflect.Method; -@@ -53,6 +54,9 @@ public final class LeavesConfig { +@@ -51,10 +52,12 @@ public final class LeavesConfig { + throw new RuntimeException(ex); // unreachable + } } ++ LeavesConfig.load(config); commands = new HashMap<>(); +- +- LeavesConfig.load(config); + if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) { + commands.put("bot", new BotCommand("bot")); + } - - LeavesConfig.load(config); } -@@ -99,6 +103,11 @@ public final class LeavesConfig { + + public static void load(final YamlConfiguration config) { +@@ -99,6 +102,11 @@ public final class LeavesConfig { snowballAndEggCanKnockback = getBoolean("settings.snowball-and-egg-can-knockback-player", snowballAndEggCanKnockback); } diff --git a/patches/server/0011-Add-fakeplayer-action-support.patch b/patches/server/0011-Add-fakeplayer-action-support.patch index 68f8dc54..1affea0e 100644 --- a/patches/server/0011-Add-fakeplayer-action-support.patch +++ b/patches/server/0011-Add-fakeplayer-action-support.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Add fakeplayer action support diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 4a91817fabf87a9e3eff06a23a0e13fc26e5d41b..e10ca71184524feaed92232436c06b54bed458ec 100644 +index 4b8d05838bd70a2932a36a5919436861b8e41c0b..def8ab8bf0537e648751b200de01607191426d56 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -56,6 +56,7 @@ public final class LeavesConfig { +@@ -57,6 +57,7 @@ public final class LeavesConfig { commands = new HashMap<>(); if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) { commands.put("bot", new BotCommand("bot")); + top.leavesmc.leaves.bot.agent.Actions.registerAll(); } + } - LeavesConfig.load(config); diff --git a/src/main/java/top/leavesmc/leaves/bot/Bot.java b/src/main/java/top/leavesmc/leaves/bot/Bot.java index 97b8cb057c139af76684088bdde71d96e95ada81..c2c4d592ae7991b94b5221255de22455df72b1b4 100644 --- a/src/main/java/top/leavesmc/leaves/bot/Bot.java