diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index b54203f087..9bd79e394f 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 4bddfbcba9..c6a359d343 100644 --- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java index 51bc28fddf..0b9afe4813 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.instancezone; import java.util.ArrayList; import java.util.Collection; +import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -175,23 +176,6 @@ public class InstanceWorld return _instance.getNpcs(); } - /** - * Get alive NPCs from instance. - * @return set of NPCs from instance - */ - public List getAliveNpcs() - { - final List 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. * @param id IDs of NPCs which should be found @@ -199,7 +183,7 @@ public class InstanceWorld */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if (CommonUtil.contains(id, npc.getId())) @@ -221,7 +205,7 @@ public class InstanceWorld @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -232,6 +216,41 @@ public class InstanceWorld return result; } + /** + * Get alive NPCs from instance. + * @return set of NPCs from instance + */ + public List getAliveNpcs() + { + final List 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 getAliveNpcs(int... id) + { + final List 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. * @param @@ -243,7 +262,7 @@ public class InstanceWorld @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) @@ -254,24 +273,6 @@ public class InstanceWorld 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 getAliveNpcs(int... id) - { - final List 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. * @param id ID of NPC to be found diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java index 51bc28fddf..0b9afe4813 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/instancezone/InstanceWorld.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.instancezone; import java.util.ArrayList; import java.util.Collection; +import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -175,23 +176,6 @@ public class InstanceWorld return _instance.getNpcs(); } - /** - * Get alive NPCs from instance. - * @return set of NPCs from instance - */ - public List getAliveNpcs() - { - final List 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. * @param id IDs of NPCs which should be found @@ -199,7 +183,7 @@ public class InstanceWorld */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if (CommonUtil.contains(id, npc.getId())) @@ -221,7 +205,7 @@ public class InstanceWorld @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -232,6 +216,41 @@ public class InstanceWorld return result; } + /** + * Get alive NPCs from instance. + * @return set of NPCs from instance + */ + public List getAliveNpcs() + { + final List 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 getAliveNpcs(int... id) + { + final List 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. * @param @@ -243,7 +262,7 @@ public class InstanceWorld @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _instance.getNpcs()) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) @@ -254,24 +273,6 @@ public class InstanceWorld 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 getAliveNpcs(int... id) - { - final List 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. * @param id ID of NPC to be found diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 6417df98c9..5172d566a8 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index bd2adaf27f..fd808f8ad2 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 4bddfbcba9..c6a359d343 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 4bddfbcba9..c6a359d343 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc)) diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/instancezone/Instance.java index 4bddfbcba9..c6a359d343 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/instancezone/Instance.java @@ -377,7 +377,7 @@ public class Instance implements IIdentifiable, INamable */ public List getPlayersInsideRadius(ILocational object, int radius) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Player player : _players) { if (player.isInsideRadius3D(object, radius)) @@ -460,8 +460,11 @@ public class Instance implements IIdentifiable, INamable */ public List getSpawnGroup(String name) { - final List spawns = new ArrayList<>(); - _spawns.stream().forEach(spawnTemplate -> spawns.addAll(spawnTemplate.getGroupsByName(name))); + final List spawns = new LinkedList<>(); + for (SpawnTemplate spawnTemplate : _spawns) + { + spawns.addAll(spawnTemplate.getGroupsByName(name)); + } return spawns; } @@ -585,7 +588,7 @@ public class Instance implements IIdentifiable, INamable */ public List getNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (CommonUtil.contains(id, npc.getId())) @@ -607,7 +610,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && clazz.isInstance(npc)) @@ -624,7 +627,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs() { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if (npc.getCurrentHp() > 0) @@ -642,7 +645,7 @@ public class Instance implements IIdentifiable, INamable */ public List getAliveNpcs(int... id) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((npc.getCurrentHp() > 0) && CommonUtil.contains(id, npc.getId())) @@ -664,7 +667,7 @@ public class Instance implements IIdentifiable, INamable @SuppressWarnings("unchecked") public final List getAliveNpcs(Class clazz, int... ids) { - final List result = new ArrayList<>(); + final List result = new LinkedList<>(); for (Npc npc : _npcs) { if ((((ids.length == 0) || CommonUtil.contains(ids, npc.getId())) && (npc.getCurrentHp() > 0)) && clazz.isInstance(npc))