1 second delay for mob movements

This commit is contained in:
2023-10-16 14:02:48 -05:00
parent 6f990d488f
commit e3d6a32554
+8
View File
@@ -721,6 +721,14 @@ public class MobAI {
try { try {
if(mob.getTimestamps().containsKey("lastChase") == false) {
mob.getTimestamps().put("lastChase", System.currentTimeMillis());
return;//ensure mob timestamps have the lastChase parameter
}
if(mob.getTimestamps().get("lastChase") + 1000 < System.currentTimeMillis())
return; // only allows mobs to chase once a second
if (!MovementUtilities.canMove(mob)) if (!MovementUtilities.canMove(mob))
return; return;