Instance use of LinkedList for unknown length lists.
This commit is contained in:
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.instancezone;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@@ -175,23 +176,6 @@ public class InstanceWorld
|
|||||||
return _instance.getNpcs();
|
return _instance.getNpcs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get alive NPCs from instance.
|
|
||||||
* @return set of NPCs from instance
|
|
||||||
*/
|
|
||||||
public List<Npc> getAliveNpcs()
|
|
||||||
{
|
|
||||||
final List<Npc> result = new ArrayList<>();
|
|
||||||
for (Npc npc : _instance.getNpcs())
|
|
||||||
{
|
|
||||||
if (npc.getCurrentHp() > 0)
|
|
||||||
{
|
|
||||||
result.add(npc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get spawned NPCs from instance with specific IDs.
|
* Get spawned NPCs from instance with specific IDs.
|
||||||
* @param id IDs of NPCs which should be found
|
* @param id IDs of NPCs which should be found
|
||||||
@@ -199,7 +183,7 @@ public class InstanceWorld
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -221,7 +205,7 @@ public class InstanceWorld
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -232,6 +216,41 @@ public class InstanceWorld
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get alive NPCs from instance.
|
||||||
|
* @return set of NPCs from instance
|
||||||
|
*/
|
||||||
|
public List<Npc> getAliveNpcs()
|
||||||
|
{
|
||||||
|
final List<Npc> result = new LinkedList<>();
|
||||||
|
for (Npc npc : _instance.getNpcs())
|
||||||
|
{
|
||||||
|
if (npc.getCurrentHp() > 0)
|
||||||
|
{
|
||||||
|
result.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get alive NPCs from instance with specific IDs.
|
||||||
|
* @param id IDs of NPCs which should be found
|
||||||
|
* @return list of filtered NPCs from instance
|
||||||
|
*/
|
||||||
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
|
{
|
||||||
|
final List<Npc> result = new LinkedList<>();
|
||||||
|
for (Npc npc : _instance.getNpcs())
|
||||||
|
{
|
||||||
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
|
{
|
||||||
|
result.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get spawned and alive NPCs from instance with specific IDs and class type.
|
* Get spawned and alive NPCs from instance with specific IDs and class type.
|
||||||
* @param <T>
|
* @param <T>
|
||||||
@@ -243,7 +262,7 @@ public class InstanceWorld
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
@@ -254,24 +273,6 @@ public class InstanceWorld
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get alive NPCs from instance with specific IDs.
|
|
||||||
* @param id IDs of NPCs which should be found
|
|
||||||
* @return list of filtered NPCs from instance
|
|
||||||
*/
|
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
|
||||||
{
|
|
||||||
final List<Npc> result = new ArrayList<>();
|
|
||||||
for (Npc npc : _instance.getNpcs())
|
|
||||||
{
|
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
|
||||||
{
|
|
||||||
result.add(npc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get first found spawned NPC with specific ID.
|
* Get first found spawned NPC with specific ID.
|
||||||
* @param id ID of NPC to be found
|
* @param id ID of NPC to be found
|
||||||
|
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.instancezone;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@@ -175,23 +176,6 @@ public class InstanceWorld
|
|||||||
return _instance.getNpcs();
|
return _instance.getNpcs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get alive NPCs from instance.
|
|
||||||
* @return set of NPCs from instance
|
|
||||||
*/
|
|
||||||
public List<Npc> getAliveNpcs()
|
|
||||||
{
|
|
||||||
final List<Npc> result = new ArrayList<>();
|
|
||||||
for (Npc npc : _instance.getNpcs())
|
|
||||||
{
|
|
||||||
if (npc.getCurrentHp() > 0)
|
|
||||||
{
|
|
||||||
result.add(npc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get spawned NPCs from instance with specific IDs.
|
* Get spawned NPCs from instance with specific IDs.
|
||||||
* @param id IDs of NPCs which should be found
|
* @param id IDs of NPCs which should be found
|
||||||
@@ -199,7 +183,7 @@ public class InstanceWorld
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -221,7 +205,7 @@ public class InstanceWorld
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -232,6 +216,41 @@ public class InstanceWorld
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get alive NPCs from instance.
|
||||||
|
* @return set of NPCs from instance
|
||||||
|
*/
|
||||||
|
public List<Npc> getAliveNpcs()
|
||||||
|
{
|
||||||
|
final List<Npc> result = new LinkedList<>();
|
||||||
|
for (Npc npc : _instance.getNpcs())
|
||||||
|
{
|
||||||
|
if (npc.getCurrentHp() > 0)
|
||||||
|
{
|
||||||
|
result.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get alive NPCs from instance with specific IDs.
|
||||||
|
* @param id IDs of NPCs which should be found
|
||||||
|
* @return list of filtered NPCs from instance
|
||||||
|
*/
|
||||||
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
|
{
|
||||||
|
final List<Npc> result = new LinkedList<>();
|
||||||
|
for (Npc npc : _instance.getNpcs())
|
||||||
|
{
|
||||||
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
|
{
|
||||||
|
result.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get spawned and alive NPCs from instance with specific IDs and class type.
|
* Get spawned and alive NPCs from instance with specific IDs and class type.
|
||||||
* @param <T>
|
* @param <T>
|
||||||
@@ -243,7 +262,7 @@ public class InstanceWorld
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _instance.getNpcs())
|
for (Npc npc : _instance.getNpcs())
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
@@ -254,24 +273,6 @@ public class InstanceWorld
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get alive NPCs from instance with specific IDs.
|
|
||||||
* @param id IDs of NPCs which should be found
|
|
||||||
* @return list of filtered NPCs from instance
|
|
||||||
*/
|
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
|
||||||
{
|
|
||||||
final List<Npc> result = new ArrayList<>();
|
|
||||||
for (Npc npc : _instance.getNpcs())
|
|
||||||
{
|
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
|
||||||
{
|
|
||||||
result.add(npc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get first found spawned NPC with specific ID.
|
* Get first found spawned NPC with specific ID.
|
||||||
* @param id ID of NPC to be found
|
* @param id ID of NPC to be found
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
@@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
public List<Player> getPlayersInsideRadius(ILocational object, int radius)
|
||||||
{
|
{
|
||||||
final List<Player> result = new ArrayList<>();
|
final List<Player> result = new LinkedList<>();
|
||||||
for (Player player : _players)
|
for (Player player : _players)
|
||||||
{
|
{
|
||||||
if (player.isInsideRadius3D(object, radius))
|
if (player.isInsideRadius3D(object, radius))
|
||||||
@@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<SpawnGroup> getSpawnGroup(String name)
|
public List<SpawnGroup> getSpawnGroup(String name)
|
||||||
{
|
{
|
||||||
final List<SpawnGroup> spawns = new ArrayList<>();
|
final List<SpawnGroup> spawns = new LinkedList<>();
|
||||||
_spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name)));
|
for (SpawnTemplate spawnTemplate : _spawns)
|
||||||
|
{
|
||||||
|
spawns.addAll(spawnTemplate.getGroupsByName(name));
|
||||||
|
}
|
||||||
return spawns;
|
return spawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getNpcs(int... id)
|
public List<Npc> getNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (CommonUtil.contains(id, npc.getId()))
|
if (CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc))
|
||||||
@@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs()
|
public List<Npc> getAliveNpcs()
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() > 0)
|
if (npc.getCurrentHp() > 0)
|
||||||
@@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
*/
|
*/
|
||||||
public List<Npc> getAliveNpcs(int... id)
|
public List<Npc> getAliveNpcs(int... id)
|
||||||
{
|
{
|
||||||
final List<Npc> result = new ArrayList<>();
|
final List<Npc> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId()))
|
||||||
@@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
public final <T extends Creature> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||||
{
|
{
|
||||||
final List<T> result = new ArrayList<>();
|
final List<T> result = new LinkedList<>();
|
||||||
for (Npc npc : _npcs)
|
for (Npc npc : _npcs)
|
||||||
{
|
{
|
||||||
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))
|
||||||
|
Reference in New Issue
Block a user