revert mob ai

This commit is contained in:
2025-03-28 16:19:58 -05:00
parent 7e66b290bd
commit b51eb34410
2 changed files with 14 additions and 15 deletions
+13 -14
View File
@@ -28,26 +28,25 @@ public class MobAIThread implements Runnable{
AI_CAST_FREQUENCY = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue());
AI_BASE_AGGRO_RANGE = (int)(60 * Float.parseFloat(ConfigManager.MB_AI_AGGRO_RANGE.getValue()));
while (true) {
for (Zone zone : ZoneManager.getAllZones()) {
if (zone != null && zone.zoneMobSet != null) {
synchronized (zone.zoneMobSet) {
for (Mob mob : zone.zoneMobSet) {
try {
if (mob != null) {
MobAI.DetermineAction(mob);
try {
for (Zone zone : ZoneManager.getAllZones()) {
if (zone != null && zone.zoneMobSet != null) {
synchronized (zone.zoneMobSet) {
for (Mob mob : zone.zoneMobSet) {
try {
if (mob != null) {
MobAI.DetermineAction(mob);
}
} catch (Exception e) {
Logger.error("Error processing Mob [Name: {}, UUID: {}]", mob.getName(), mob.getObjectUUID(), e);
}
} catch (Exception e) {
Logger.error("Error processing Mob [Name: {}, UUID: {}]", mob.getName(), mob.getObjectUUID(), e);
}
}
}
}
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Logger.error("AI Thread interrupted", e);
Thread.currentThread().interrupt();
}catch(Exception e){
Logger.error(e.getMessage());
}
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ public class BaneThread implements Runnable {
while (true) {
try {
BaneManager.pulse_banes();
Thread.sleep(100); // Pause for 100ms to reduce CPU usage
Thread.sleep(1000); // Pause for 100ms to reduce CPU usage
} catch (InterruptedException e) {
Logger.error("Thread interrupted", e);
Thread.currentThread().interrupt();