Dropped isSkillDisabledByReuse method.

This commit is contained in:
MobiusDev 2018-06-07 20:47:56 +00:00
parent 44d2d37c69
commit e60a34f37b
8 changed files with 16 additions and 87 deletions

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -2342,21 +2342,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is disabled.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(int hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final int hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
@ -2368,6 +2359,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}

View File

@ -1558,32 +1558,23 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return true;
}
return isSkillDisabledByReuse(skill.getReuseHashCode());
}
/**
* Verifies if the skill is under reuse.
* @param hashCode the skill hash code
* @return {@code true} if the skill is disabled, {@code false} otherwise
*/
public boolean isSkillDisabledByReuse(long hashCode)
{
if (_disabledSkills == null)
{
return false;
}
final long hashCode = skill.getReuseHashCode();
final Long stamp = _disabledSkills.get(hashCode);
if (stamp == null)
{
return false;
}
if (stamp < System.currentTimeMillis())
{
_disabledSkills.remove(hashCode);
return false;
}
return true;
}