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);
}
}

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);
}
}

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);
}
}

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);
}
}

View File

@ -58,7 +58,7 @@ import com.l2jmobius.gameserver.templates.item.L2WeaponType;
* This class manages AI of L2Attackable.<BR>
* <BR>
*/
public class L2AttackableAI extends L2CharacterAI implements Runnable
public class L2AttackableAI extends L2CharacterAI
{
// protected static final Logger LOGGER = Logger.getLogger(L2AttackableAI.class);
@ -90,13 +90,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();
}
/**
* Return True if the target is autoattackable (depends on the actor type).<BR>
* <BR>
@ -312,10 +305,9 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
public synchronized void startAITask()
{
// 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);
}
}

View File

@ -69,7 +69,7 @@ import com.l2jmobius.gameserver.util.Util;
* This class manages AI of L2Attackable.
* @author Zoey76
*/
public class L2AttackableAI extends L2CharacterAI implements Runnable
public class L2AttackableAI extends L2CharacterAI
{
// private static final Logger LOGGER = Logger.getLogger(L2AttackableAI.class.getName());
@ -132,13 +132,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();
}
/**
* <B><U> Actor is a L2GuardInstance</U> :</B>
* <ul>
@ -323,7 +316,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);
}
}

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);
}
}

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);
}
}