diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java index a14192847a..927e5b9685 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/skillconditionhandlers/OpSweeperSkillCondition.java @@ -16,8 +16,6 @@ */ package handlers.skillconditionhandlers; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.WorldObject; @@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.network.SystemMessageId; /** - * @author Sdw + * @author Zoey76 */ public class OpSweeperSkillCondition implements ISkillCondition { @@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition @Override public boolean canUse(Creature caster, Skill skill, WorldObject target) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (caster.getActingPlayer() != null) { final PlayerInstance sweeper = caster.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, target, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, target)) { - if (o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable a = (Attackable) o; - if (a.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (a.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(a.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!a.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(a.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition } } } - }); + } } } - return canSweep.get(); + return canSweep; } } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java index 74606dce2b..d2d124550b 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/conditions/ConditionPlayerCanSweep.java @@ -16,9 +16,8 @@ */ package org.l2jmobius.gameserver.model.conditions; -import java.util.concurrent.atomic.AtomicBoolean; - import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition @Override public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) { - final AtomicBoolean canSweep = new AtomicBoolean(false); + boolean canSweep = false; if (effector.getActingPlayer() != null) { final PlayerInstance sweeper = effector.getActingPlayer(); if (skill != null) { - skill.forEachTargetAffected(sweeper, effected, o -> + for (WorldObject wo : skill.getTargetsAffected(sweeper, effected)) { - if ((o != null) && o.isAttackable()) + if ((wo != null) && wo.isAttackable()) { - final Attackable target = (Attackable) o; - if (target.isDead()) + final Attackable attackable = (Attackable) wo; + if (attackable.isDead()) { - if (target.isSpoiled()) + if (attackable.isSpoiled()) { - canSweep.set(target.checkSpoilOwner(sweeper, true)); - if (canSweep.get()) + canSweep = attackable.checkSpoilOwner(sweeper, true); + if (canSweep) { - canSweep.set(!target.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true)); + canSweep = !attackable.isOldCorpse(sweeper, Config.CORPSE_CONSUME_SKILL_ALLOWED_TIME_BEFORE_DECAY, true); } - if (canSweep.get()) + if (canSweep) { - canSweep.set(sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true)); + canSweep = sweeper.getInventory().checkInventorySlotsAndWeight(attackable.getSpoilLootItems(), true, true); } } else @@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition } } } - }); + } } } - return (_value == canSweep.get()); + return _value == canSweep; } }