v1.1.9: 不在开拓时限内时向玩家发送聊天提示,并修复日志被 CANCELED 事件刷屏
这个提交包含在:
@@ -35,6 +35,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@Environment(value=EnvType.CLIENT)
|
||||
/**
|
||||
@@ -175,6 +176,8 @@ implements SubtitleChatMonitor.Listener, BaritoneBridge.PathListener {
|
||||
this.status = "\u4e0d\u5728\u5f00\u62d3\u65f6\u9650\u5185\uff0811:00-22:00\uff09\uff0c\u65e0\u6cd5\u5f00\u62d3";
|
||||
this.setState(State.IDLE, this.status);
|
||||
this.log("\u542f\u52a8\u5931\u8d25\uff1a\u4e0d\u5728\u5f00\u62d3\u65f6\u9650\u5185\uff0c\u5f53\u524d\u73b0\u5b9e\u65f6\u95f4 " + LocalTime.now().format(LOG_TIME_FORMAT));
|
||||
// 给玩家发送聊天栏提示,避免玩家未打开 GUI 时看不到原因
|
||||
client.player.sendMessage(Text.literal("[AutoStore] \u4e0d\u5728\u5f00\u62d3\u65f6\u9650\u5185\uff0811:00-22:00\uff09\uff0c\u65e0\u6cd5\u5f00\u62d3"), false);
|
||||
return false;
|
||||
}
|
||||
this.config = requestedConfig.copy();
|
||||
@@ -242,6 +245,7 @@ implements SubtitleChatMonitor.Listener, BaritoneBridge.PathListener {
|
||||
this.stop();
|
||||
this.status = "\u5df2\u5230\u5f00\u62d3\u65f6\u9650\u5916\uff0811:00-22:00\uff09\uff0c\u4efb\u52a1\u505c\u6b62";
|
||||
this.log("\u5df2\u5230\u5f00\u62d3\u65f6\u9650\u5916\uff0c\u505c\u6b62\u4efb\u52a1\uff08\u5f53\u524d\u73b0\u5b9e\u65f6\u95f4 " + LocalTime.now().format(LOG_TIME_FORMAT) + "\uff09");
|
||||
client.player.sendMessage(Text.literal("[AutoStore] \u5df2\u5230\u5f00\u62d3\u65f6\u9650\u5916\uff0811:00-22:00\uff09\uff0c\u4efb\u52a1\u505c\u6b62"), false);
|
||||
return;
|
||||
}
|
||||
if (this.tickAutoFood(client)) {
|
||||
@@ -537,10 +541,13 @@ implements SubtitleChatMonitor.Listener, BaritoneBridge.PathListener {
|
||||
} else if (event == PathEvent.CALC_FAILED) {
|
||||
this.pathCalcFailed = true;
|
||||
}
|
||||
// 只记录关键事件,避免路径中间态刷屏
|
||||
// 仅在任务运行中记录关键事件,避免空闲时 Baritone 高频 CANCELED/中间态刷屏
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
// 只记录关键事件,且跳过高频的 CANCELED(空闲/重寻路时每秒触发多次,无排查价值)
|
||||
if (event == PathEvent.CALC_STARTED || event == PathEvent.CALC_FINISHED_NOW_EXECUTING
|
||||
|| event == PathEvent.CALC_FAILED || event == PathEvent.AT_GOAL
|
||||
|| event == PathEvent.CANCELED) {
|
||||
|| event == PathEvent.CALC_FAILED || event == PathEvent.AT_GOAL) {
|
||||
this.log("\u5bfb\u8def\u4e8b\u4ef6\uff1a" + event);
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户