From 82d809ff5abf9e90807a84117efb13d75b495083 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Mon, 5 May 2025 09:25:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(core):=20=E4=B8=80=E4=BA=9B=E5=AF=B9?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8C=85=E6=89=98=E7=AE=A1=E5=92=8C=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8C=85=E7=94=9F=E6=88=90=E7=9A=84=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukkit/plugin/command/feature/ReloadCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ReloadCommand.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ReloadCommand.java index 00056ba91..079dcf240 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ReloadCommand.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/command/feature/ReloadCommand.java @@ -4,6 +4,7 @@ import net.kyori.adventure.text.Component; import net.momirealms.craftengine.bukkit.plugin.command.BukkitCommandFeature; import net.momirealms.craftengine.core.plugin.CraftEngine; import net.momirealms.craftengine.core.plugin.command.CraftEngineCommandManager; +import net.momirealms.craftengine.core.plugin.locale.LocalizedException; import net.momirealms.craftengine.core.plugin.locale.MessageConstants; import org.bukkit.command.CommandSender; import org.incendo.cloud.Command; @@ -68,7 +69,9 @@ public class ReloadCommand extends BukkitCommandFeature { long time2 = System.currentTimeMillis(); long packTime = time2 - time1; handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_SUCCESS, Component.text(packTime)); - + } catch (LocalizedException e) { + handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_FAILURE); + plugin().logger().warn(e.getMessage()); } catch (Exception e) { handleFeedback(context, MessageConstants.COMMAND_RELOAD_PACK_FAILURE); plugin().logger().warn("Failed to generate resource pack", e); @@ -89,6 +92,9 @@ public class ReloadCommand extends BukkitCommandFeature { Component.text(reloadResult.syncTime()), Component.text(packTime) ); + } catch (LocalizedException e) { + handleFeedback(context, MessageConstants.COMMAND_RELOAD_ALL_FAILURE); + plugin().logger().warn(e.getMessage()); } finally { RELOAD_PACK_FLAG = false; }