9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 12:29:15 +00:00
This commit is contained in:
XiaoMoMi
2025-04-04 05:27:29 +08:00
parent 6ea0b1e9a6
commit 81fc801bd9
2 changed files with 12 additions and 10 deletions

View File

@@ -58,15 +58,17 @@ public class ReloadCommand extends BukkitCommandFeature<CommandSender> {
} else if (argument == ReloadArgument.ALL) {
plugin().scheduler().executeAsync(() -> {
plugin().reload((a, b) -> {
try {
long time1 = System.currentTimeMillis();
plugin().packManager().generateResourcePack();
long time2 = System.currentTimeMillis();
handleFeedback(context, MessageConstants.COMMAND_RELOAD_ALL_SUCCESS, Component.text(a + b + time2 - time1), Component.text(a), Component.text(b), Component.text(time2 - time1));
} catch (Exception e) {
handleFeedback(context, MessageConstants.COMMAND_RELOAD_ALL_FAILURE);
plugin().logger().warn("Failed to generate resource pack", e);
}
plugin().scheduler().async().execute(() -> {
try {
long time1 = System.currentTimeMillis();
plugin().packManager().generateResourcePack();
long time2 = System.currentTimeMillis();
handleFeedback(context, MessageConstants.COMMAND_RELOAD_ALL_SUCCESS, Component.text(a + b + time2 - time1), Component.text(a), Component.text(b), Component.text(time2 - time1));
} catch (Exception e) {
handleFeedback(context, MessageConstants.COMMAND_RELOAD_ALL_FAILURE);
plugin().logger().warn("Failed to generate resource pack", e);
}
});
});
});
}