From 1d93fa53cd1fa7ae5caf9c88f0ec3dbf9dc01cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E9=A3=8E?= <1213457484@qq.com> Date: Tue, 27 May 2025 22:03:07 +0800 Subject: [PATCH] 1111 --- src/client/PlayerStats.java | 3 ++- src/gui/tw/AotuNpc.java | 32 ++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/client/PlayerStats.java b/src/client/PlayerStats.java index b788d14..9ca2ce4 100644 --- a/src/client/PlayerStats.java +++ b/src/client/PlayerStats.java @@ -641,7 +641,8 @@ public class PlayerStats implements Serializable { if (!first_login) { int currentDsbbh = dsbbh.incrementAndGet(); // 原子自增并获取最新值 for (AotuNpc npc : Start.aotuNpcs) { - Start.executor.schedule(() -> dsnpcfw(chra, npc, currentDsbbh), npc.getTime(), TimeUnit.MILLISECONDS); +// Start.executor.schedule(() -> dsnpcfw(chra, npc, currentDsbbh), npc.getTime(), TimeUnit.MILLISECONDS); + dsnpcfw(chra, npc, currentDsbbh); } } diff --git a/src/gui/tw/AotuNpc.java b/src/gui/tw/AotuNpc.java index a78faac..cd0c0e6 100644 --- a/src/gui/tw/AotuNpc.java +++ b/src/gui/tw/AotuNpc.java @@ -13,9 +13,9 @@ public class AotuNpc { int lv; - String mapId; + String mapId=""; - String noMapId; + String noMapId=""; int itemId; @@ -107,22 +107,30 @@ public class AotuNpc { if (mapIdList ==null ){ mapIdList =new ArrayList<>(); nomapIdList =new ArrayList<>(); - String[] split = this.mapId.split(","); - for (String s : split) { - mapIdList.add(Integer.parseInt(s)); + + if (!this.mapId.isEmpty()) { + String[] split = this.mapId.split(","); + for (String s : split) { + mapIdList.add(Integer.parseInt(s)); + } } - String[] split1 = this.noMapId.split(","); - for (String s : split1) { - nomapIdList.add(Integer.parseInt(s)); + + if (!this.noMapId.isEmpty()) { + String[] split = this.noMapId.split(","); + for (String s : split) { + nomapIdList.add(Integer.parseInt(s)); + } } } - for (Integer i : mapIdList) { - if (i == mapId){ + + for (Integer i : nomapIdList) { + if (i == mapId ){ return false; } } - for (Integer i : nomapIdList) { - if (i == mapId){ + + for (Integer i : mapIdList) { + if (i == mapId|| i == 0){ return true; } }