Fixed Refined Ring of Core usage.

This commit is contained in:
MobiusDev
2019-01-16 06:32:13 +00:00
parent 4d53efedff
commit 899c47daaf
64 changed files with 606 additions and 190 deletions

View File

@ -192,7 +192,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private boolean _isFlying = false;
private boolean _blockActions = false;
private volatile Map<Integer, AtomicInteger> _blockActionsAllowedSkills;
private volatile Map<Integer, AtomicInteger> _blockActionsAllowedSkills = new ConcurrentHashMap<>();
private CharStat _stat;
private CharStatus _status;
@ -5197,30 +5197,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void addBlockActionsAllowedSkill(int skillId)
{
if (_blockActionsAllowedSkills == null)
{
synchronized (this)
{
if (_blockActionsAllowedSkills == null)
{
_blockActionsAllowedSkills = new ConcurrentHashMap<>();
}
}
}
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
}
public void removeBlockActionsAllowedSkill(int skillId)
{
if (_blockActionsAllowedSkills != null)
{
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
}
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
}
public boolean isBlockedActionsAllowedSkill(Skill skill)
{
return (_blockActionsAllowedSkills != null) && _blockActionsAllowedSkills.containsKey(skill.getId());
return _blockActionsAllowedSkills.containsKey(skill.getId());
}
/**

View File

@ -56,7 +56,8 @@ public enum EffectFlag
PROTECT_DEATH_PENALTY,
CHAT_BLOCK,
FAKE_DEATH,
DUELIST_FURY;
DUELIST_FURY,
FEAR;
public long getMask()
{