Removed stream usage from Attackable.
This commit is contained in:
@@ -707,10 +707,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -981,7 +990,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -989,6 +1007,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -691,10 +691,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -965,7 +974,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -973,6 +991,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -691,10 +691,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -965,7 +974,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -973,6 +991,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -691,10 +691,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -965,7 +974,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -973,6 +991,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -702,10 +702,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -976,7 +985,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -984,6 +1002,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -702,10 +702,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -976,7 +985,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -984,6 +1002,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -702,10 +702,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -976,7 +985,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -984,6 +1002,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -702,10 +702,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -976,7 +985,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -984,6 +1002,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -708,10 +708,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -982,7 +991,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -990,6 +1008,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -689,10 +689,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -963,7 +972,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -971,6 +989,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -703,10 +703,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -977,7 +986,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -985,6 +1003,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -723,10 +723,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -997,7 +1006,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1005,6 +1023,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -723,10 +723,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -997,7 +1006,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1005,6 +1023,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -723,10 +723,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -997,7 +1006,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1005,6 +1023,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -723,10 +723,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -997,7 +1006,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1005,6 +1023,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -707,10 +707,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -981,7 +990,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -989,6 +1007,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -736,10 +736,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -1010,7 +1019,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1018,6 +1036,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -743,10 +743,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -1017,7 +1026,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1025,6 +1043,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -750,10 +750,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -1024,7 +1033,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1032,6 +1050,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -750,10 +750,19 @@ public class Attackable extends Npc
|
||||
@Override
|
||||
public void addAttackerToAttackByList(Creature creature)
|
||||
{
|
||||
if ((creature == null) || (creature == this) || getAttackByList().stream().anyMatch(o -> o.get() == creature))
|
||||
if ((creature == null) || (creature == this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == creature)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getAttackByList().add(new WeakReference<>(creature));
|
||||
}
|
||||
|
||||
@@ -1024,7 +1033,16 @@ public class Attackable extends Npc
|
||||
result.add(mostHated);
|
||||
|
||||
final Creature secondMostHatedFinal = secondMostHated;
|
||||
if (getAttackByList().stream().anyMatch(o -> o.get() == secondMostHatedFinal))
|
||||
boolean found = false;
|
||||
for (WeakReference<Creature> ref : getAttackByList())
|
||||
{
|
||||
if (ref.get() == secondMostHatedFinal)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
result.add(secondMostHated);
|
||||
}
|
||||
@@ -1032,6 +1050,7 @@ public class Attackable extends Npc
|
||||
{
|
||||
result.add(null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user