Removed pointless use of VolatileBoolean from sweeper conditions.

This commit is contained in:
MobiusDevelopment
2020-01-28 10:57:22 +00:00
parent 13554071b9
commit 7a20f03af5
30 changed files with 420 additions and 465 deletions

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }

View File

@@ -16,8 +16,6 @@
*/ */
package handlers.skillconditionhandlers; package handlers.skillconditionhandlers;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.WorldObject;
@@ -29,7 +27,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
/** /**
* @author Sdw * @author Zoey76
*/ */
public class OpSweeperSkillCondition implements ISkillCondition public class OpSweeperSkillCondition implements ISkillCondition
{ {
@@ -41,29 +39,29 @@ public class OpSweeperSkillCondition implements ISkillCondition
@Override @Override
public boolean canUse(Creature caster, Skill skill, WorldObject target) public boolean canUse(Creature caster, Skill skill, WorldObject target)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (caster.getActingPlayer() != null) if (caster.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = caster.getActingPlayer(); final PlayerInstance sweeper = caster.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (a.isDead()) if (attackable.isDead())
{ {
if (a.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(a.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -72,9 +70,9 @@ public class OpSweeperSkillCondition implements ISkillCondition
} }
} }
} }
}); }
} }
} }
return canSweep.get(); return canSweep;
} }
} }

View File

@@ -16,9 +16,8 @@
*/ */
package org.l2jmobius.gameserver.model.conditions; package org.l2jmobius.gameserver.model.conditions;
import java.util.concurrent.atomic.AtomicBoolean;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -50,29 +49,29 @@ public class ConditionPlayerCanSweep extends Condition
@Override @Override
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item) public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
{ {
final AtomicBoolean canSweep = new AtomicBoolean(false); boolean canSweep = false;
if (effector.getActingPlayer() != null) if (effector.getActingPlayer() != null)
{ {
final PlayerInstance sweeper = effector.getActingPlayer(); final PlayerInstance sweeper = effector.getActingPlayer();
if (skill != null) 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; final Attackable attackable = (Attackable) wo;
if (target.isDead()) if (attackable.isDead())
{ {
if (target.isSpoiled()) if (attackable.isSpoiled())
{ {
canSweep.set(target.checkSpoilOwner(sweeper, true)); canSweep = attackable.checkSpoilOwner(sweeper, true);
if (canSweep.get()) 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 else
@@ -81,9 +80,9 @@ public class ConditionPlayerCanSweep extends Condition
} }
} }
} }
}); }
} }
} }
return (_value == canSweep.get()); return _value == canSweep;
} }
} }