From 003a68a7e138e91bfbc6cca4ab7653dce1587d93 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 8 Jan 2023 11:51:53 +0000 Subject: [PATCH] Removed stream usage from BlockActions effect. --- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- .../handlers/effecthandlers/BlockActions.java | 27 ++++++++++++++----- .../gameserver/model/actor/Creature.java | 4 +-- 52 files changed, 572 insertions(+), 234 deletions(-) diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8814f17fe..25e4fe148d 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8814f17fe..25e4fe148d 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8814f17fe..25e4fe148d 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8814f17fe..25e4fe148d 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 546f788e27..f459c48277 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 546f788e27..f459c48277 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 546f788e27..f459c48277 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index e242945486..c3f9db5c65 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0015062f1d..c468d9bc95 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0015062f1d..c468d9bc95 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java index fc148552c9..0dd84aed7c 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5592,12 +5592,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java index 14e63528e7..62d539abc6 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5592,12 +5592,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java index 227edc8271..d9eba81ce3 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java index 227edc8271..d9eba81ce3 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index 227edc8271..d9eba81ce3 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index 227edc8271..d9eba81ce3 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index c9b05cec9c..45ad139bc5 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5571,12 +5571,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index a054cf35bc..d9b38eec60 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index 5ad7baaba0..14bf2c369a 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index a054cf35bc..d9b38eec60 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index 832088028c..09fa0b9f81 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5595,12 +5595,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index 227edc8271..d9eba81ce3 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java index 78fb832250..848140efa3 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5608,12 +5608,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4518e79c40..305d015ace 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5627,12 +5627,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java index a7f5494e5a..929a14ff7a 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5647,12 +5647,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); } diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java index a092c1c0fc..0b1f4459bf 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/handlers/effecthandlers/BlockActions.java @@ -16,9 +16,8 @@ */ package handlers.effecthandlers; -import java.util.Arrays; +import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.ai.CtrlIntention; @@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill; */ public class BlockActions extends AbstractEffect { - private final Set _allowedSkills; + private final Set _allowedSkills = new HashSet<>(); public BlockActions(StatSet params) { - final String[] allowedSkills = params.getString("allowedSkills", "").split(";"); - _allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet()); + for (String skill : params.getString("allowedSkills", "").split(";")) + { + if (!skill.isEmpty()) + { + _allowedSkills.add(Integer.parseInt(skill)); + } + } } @Override @@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect return; } - _allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.addBlockActionsAllowedSkill(skillId); + } + effected.startParalyze(); + // Cancel running skill casters. effected.abortAllSkillCasters(); } @@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect @Override public void onExit(Creature effector, Creature effected, Skill skill) { - _allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill); + for (Integer skillId : _allowedSkills) + { + effected.removeBlockActionsAllowedSkill(skillId); + } + if (effected.isPlayable()) { if (effected.isSummon()) diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java index 117bff2706..d830df8e6d 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -5647,12 +5647,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe return _effectList.hasAbnormalType(abnormalType); } - public void addBlockActionsAllowedSkill(int skillId) + public void addBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet(); } - public void removeBlockActionsAllowedSkill(int skillId) + public void removeBlockActionsAllowedSkill(Integer skillId) { _blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null); }