Răsfoiți Sursa

Visibility - method overrides private method of superclass. L2AttackableAI is only extended by L2ControllableMobAI, so this is a decent solution.

Juris 10 ani în urmă
părinte
comite
8fa8f899a5

+ 3 - 3
L2J_Server/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -403,7 +403,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 		super.onIntentionAttack(target);
 	}
 	
-	private void thinkCast()
+	protected void thinkCast()
 	{
 		if (checkTargetLost(getCastTarget()))
 		{
@@ -428,7 +428,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 	 * <li>If the actor is a L2MonsterInstance that can't attack, order to it to random walk (1/100)</li>
 	 * </ul>
 	 */
-	private void thinkActive()
+	protected void thinkActive()
 	{
 		L2Attackable npc = getActiveChar();
 		
@@ -710,7 +710,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 	 * </ul>
 	 * TODO: Manage casting rules to healer mobs (like Ant Nurses)
 	 */
-	private void thinkAttack()
+	protected void thinkAttack()
 	{
 		final L2Attackable npc = getActiveChar();
 		if (npc.isCastingNow())

+ 7 - 4
L2J_Server/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java

@@ -46,7 +46,7 @@ import com.l2jserver.util.Rnd;
  * AI for controllable mobs
  * @author littlecrow
  */
-public class L2ControllableMobAI extends L2AttackableAI
+public final class L2ControllableMobAI extends L2AttackableAI
 {
 	public static final int AI_IDLE = 1;
 	public static final int AI_NORMAL = 2;
@@ -128,6 +128,7 @@ public class L2ControllableMobAI extends L2AttackableAI
 		}
 	}
 	
+	@Override
 	protected void thinkCast()
 	{
 		L2Attackable npc = (L2Attackable) _actor;
@@ -261,6 +262,7 @@ public class L2ControllableMobAI extends L2AttackableAI
 		_accessor.doAttack(getForcedTarget());
 	}
 	
+	@Override
 	protected void thinkAttack()
 	{
 		if ((getAttackTarget() == null) || getAttackTarget().isAlikeDead())
@@ -367,7 +369,8 @@ public class L2ControllableMobAI extends L2AttackableAI
 		}
 	}
 	
-	private void thinkActive()
+	@Override
+	protected void thinkActive()
 	{
 		setAttackTarget(findNextRndTarget());
 		L2Character hated;
@@ -388,7 +391,7 @@ public class L2ControllableMobAI extends L2AttackableAI
 		}
 	}
 	
-	private boolean autoAttackCondition(L2Character target)
+	private boolean checkAutoAttackCondition(L2Character target)
 	{
 		if ((target == null) || !(_actor instanceof L2Attackable))
 		{
@@ -469,7 +472,7 @@ public class L2ControllableMobAI extends L2AttackableAI
 			
 			L2Character target = (L2Character) obj;
 			
-			if (autoAttackCondition(target))
+			if (checkAutoAttackCondition(target))
 			{
 				potentialTarget.add(target);
 			}