L2Attackable no longer implements Runnable.

This commit is contained in:
MobiusDev
2018-04-26 15:26:26 +00:00
parent 8f200b5606
commit 841d3213fd
8 changed files with 16 additions and 73 deletions

View File

@@ -64,7 +64,7 @@ import com.l2jmobius.gameserver.util.Util;
/**
* This class manages AI of L2Attackable.
*/
public class L2AttackableAI extends L2CharacterAI implements Runnable
public class L2AttackableAI extends L2CharacterAI
{
private static final Logger LOGGER = Logger.getLogger(L2AttackableAI.class.getName());
@@ -98,13 +98,6 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
_globalAggro = -10; // 10 seconds timeout of ATTACK after respawn
}
@Override
public void run()
{
// Launch actions corresponding to the Event Think
onEvtThink();
}
/**
* @param target The targeted WorldObject
* @return {@code true} if target can be auto attacked due aggression.
@@ -206,7 +199,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
// If not idle - create an AI task (schedule onEvtThink repeatedly)
if (_aiTask == null)
{
_aiTask = ThreadPool.scheduleAtFixedRate(this, 1000, 1000);
_aiTask = ThreadPool.scheduleAtFixedRate(this::onEvtThink, 1000, 1000);
}
}