Replaced equals() on enum constants.

This commit is contained in:
MobiusDev 2018-09-09 18:41:22 +00:00
parent 31dadef4b8
commit dce4f54d60
143 changed files with 252 additions and 248 deletions

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{
if (type.equals(AcquireSkillType.TRANSFORM))
if (type == AcquireSkillType.TRANSFORM)
{
showTransformSkillList(player);
}

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
// Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
}
if (Config.HARDIN_RETAIL_LIMITATIONS)
{
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF))
if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{
continue;
}
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC))
if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{
continue;
}
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
}
case "33490-12.html":
{
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player))
if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{
htmltext = "33490-15.html";
}
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
}
case "giveSubCertify":
{
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA))
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{
return null;
}
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
}
case "learnSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
}
case "deleteSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
// TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead())
{
npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA))
if (attacker.getRace() == Race.ERTHEIA)
{
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
// Sex checks.
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
}
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
player.getAppearance().setSex(true);
}

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params)
{
_type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET))
if (_type != ModifyType.SET)
{
_hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER))
if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{
instance.setReenterTime();
}

View File

@ -530,7 +530,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId()));
@ -549,7 +549,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId()));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance()
{
return _mode.equals(ManorMode.MAINTENANCE);
return _mode == ManorMode.MAINTENANCE;
}
public final boolean isManorApproved()
{
return _mode.equals(ManorMode.APPROVED);
return _mode == ManorMode.APPROVED;
}
public final boolean isModifiablePeriod()
{
return _mode.equals(ManorMode.MODIFIABLE);
return _mode == ManorMode.MODIFIABLE;
}
public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue;
}
if (npc.getDBStatus().equals(DBStatusType.ALIVE))
if (npc.getDBStatus() == DBStatusType.ALIVE)
{
updateStatus(npc, false);
}

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target);
boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/
public boolean hasRandomAnimation()
{
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE));
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
}
/**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override
public boolean isMovementDisabled()
{
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE);
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
}
public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay)
{
// Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH))
if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{
setReenterTime();
}
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player);
// Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN))
if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
}

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
}
// Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL))
if (_removeBuffType == InstanceRemoveBuffType.ALL)
{
for (L2Playable playable : affected)
{
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel
for (GroupType t : GroupType.values())
{
if (!t.equals(playerGroup) && groupMaskContains(t))
if (t != playerGroup && groupMaskContains(t))
{
return t;
}
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY))
if (type == GroupType.PARTY)
{
pGroup = player.getParty();
}
else if (type.equals(GroupType.COMMAND_CHANNEL))
else if (type == GroupType.COMMAND_CHANNEL)
{
pGroup = player.getCommandChannel();
}

View File

@ -70,7 +70,7 @@ public interface ILocational
*/
default boolean isInFrontOf(ILocational target)
{
return Position.FRONT.equals(Position.getPosition(this, target));
return Position.FRONT == Position.getPosition(this, target);
}
/**
@ -79,7 +79,7 @@ public interface ILocational
*/
default boolean isOnSideOf(ILocational target)
{
return Position.SIDE.equals(Position.getPosition(this, target));
return Position.SIDE == Position.getPosition(this, target);
}
/**
@ -88,6 +88,6 @@ public interface ILocational
*/
default boolean isBehind(ILocational target)
{
return Position.BACK.equals(Position.getPosition(this, target));
return Position.BACK == Position.getPosition(this, target);
}
}

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
}
}
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER))
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type)
{
return _skill.getAbnormalType().equals(type);
return _skill.getAbnormalType() == type;
}
}

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL))
{
// TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE))
if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{
continue;
}

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/
public boolean isNoblesse()
{
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN);
return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
}
/**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{
if (type.equals(AcquireSkillType.TRANSFORM))
if (type == AcquireSkillType.TRANSFORM)
{
showTransformSkillList(player);
}

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
// Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
}
if (Config.HARDIN_RETAIL_LIMITATIONS)
{
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF))
if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{
continue;
}
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC))
if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{
continue;
}
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
}
case "33490-12.html":
{
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player))
if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{
htmltext = "33490-15.html";
}
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
}
case "giveSubCertify":
{
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA))
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{
return null;
}
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
}
case "learnSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
}
case "deleteSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
// TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead())
{
npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA))
if (attacker.getRace() == Race.ERTHEIA)
{
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
// Sex checks.
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
}
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
player.getAppearance().setSex(true);
}

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params)
{
_type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET))
if (_type != ModifyType.SET)
{
_hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER))
if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{
instance.setReenterTime();
}

View File

@ -530,7 +530,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId()));
@ -549,7 +549,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId()));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance()
{
return _mode.equals(ManorMode.MAINTENANCE);
return _mode == ManorMode.MAINTENANCE;
}
public final boolean isManorApproved()
{
return _mode.equals(ManorMode.APPROVED);
return _mode == ManorMode.APPROVED;
}
public final boolean isModifiablePeriod()
{
return _mode.equals(ManorMode.MODIFIABLE);
return _mode == ManorMode.MODIFIABLE;
}
public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue;
}
if (npc.getDBStatus().equals(DBStatusType.ALIVE))
if (npc.getDBStatus() == DBStatusType.ALIVE)
{
updateStatus(npc, false);
}

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target);
boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/
public boolean hasRandomAnimation()
{
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE));
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
}
/**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override
public boolean isMovementDisabled()
{
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE);
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
}
public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay)
{
// Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH))
if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{
setReenterTime();
}
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player);
// Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN))
if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
}

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
}
// Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL))
if (_removeBuffType == InstanceRemoveBuffType.ALL)
{
for (L2Playable playable : affected)
{
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel
for (GroupType t : GroupType.values())
{
if (!t.equals(playerGroup) && groupMaskContains(t))
if (t != playerGroup && groupMaskContains(t))
{
return t;
}
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY))
if (type == GroupType.PARTY)
{
pGroup = player.getParty();
}
else if (type.equals(GroupType.COMMAND_CHANNEL))
else if (type == GroupType.COMMAND_CHANNEL)
{
pGroup = player.getCommandChannel();
}

View File

@ -70,7 +70,7 @@ public interface ILocational
*/
default boolean isInFrontOf(ILocational target)
{
return Position.FRONT.equals(Position.getPosition(this, target));
return Position.FRONT == Position.getPosition(this, target);
}
/**
@ -79,7 +79,7 @@ public interface ILocational
*/
default boolean isOnSideOf(ILocational target)
{
return Position.SIDE.equals(Position.getPosition(this, target));
return Position.SIDE == Position.getPosition(this, target);
}
/**
@ -88,6 +88,6 @@ public interface ILocational
*/
default boolean isBehind(ILocational target)
{
return Position.BACK.equals(Position.getPosition(this, target));
return Position.BACK == Position.getPosition(this, target);
}
}

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
}
}
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER))
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type)
{
return _skill.getAbnormalType().equals(type);
return _skill.getAbnormalType() == type;
}
}

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL))
{
// TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE))
if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{
continue;
}

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/
public boolean isNoblesse()
{
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN);
return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
}
/**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{
if (type.equals(AcquireSkillType.TRANSFORM))
if (type == AcquireSkillType.TRANSFORM)
{
showTransformSkillList(player);
}

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
// Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
}
if (Config.HARDIN_RETAIL_LIMITATIONS)
{
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF))
if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{
continue;
}
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC))
if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{
continue;
}
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
}
case "33490-12.html":
{
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player))
if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{
htmltext = "33490-15.html";
}
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
}
case "giveSubCertify":
{
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA))
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{
return null;
}
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
}
case "learnSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
}
case "deleteSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
// TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead())
{
npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA))
if (attacker.getRace() == Race.ERTHEIA)
{
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
// Sex checks.
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
}
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
player.getAppearance().setSex(true);
}

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params)
{
_type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET))
if (_type != ModifyType.SET)
{
_hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER))
if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{
instance.setReenterTime();
}

View File

@ -546,7 +546,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1));
@ -565,7 +565,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance()
{
return _mode.equals(ManorMode.MAINTENANCE);
return _mode == ManorMode.MAINTENANCE;
}
public final boolean isManorApproved()
{
return _mode.equals(ManorMode.APPROVED);
return _mode == ManorMode.APPROVED;
}
public final boolean isModifiablePeriod()
{
return _mode.equals(ManorMode.MODIFIABLE);
return _mode == ManorMode.MODIFIABLE;
}
public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue;
}
if (npc.getDBStatus().equals(DBStatusType.ALIVE))
if (npc.getDBStatus() == DBStatusType.ALIVE)
{
updateStatus(npc, false);
}

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target);
boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/
public boolean hasRandomAnimation()
{
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE));
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
}
/**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override
public boolean isMovementDisabled()
{
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE);
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
}
public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay)
{
// Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH))
if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{
setReenterTime();
}
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player);
// Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN))
if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
}

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
}
// Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL))
if (_removeBuffType == InstanceRemoveBuffType.ALL)
{
for (L2Playable playable : affected)
{
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel
for (GroupType t : GroupType.values())
{
if (!t.equals(playerGroup) && groupMaskContains(t))
if (t != playerGroup && groupMaskContains(t))
{
return t;
}
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY))
if (type == GroupType.PARTY)
{
pGroup = player.getParty();
}
else if (type.equals(GroupType.COMMAND_CHANNEL))
else if (type == GroupType.COMMAND_CHANNEL)
{
pGroup = player.getCommandChannel();
}

View File

@ -70,7 +70,7 @@ public interface ILocational
*/
default boolean isInFrontOf(ILocational target)
{
return Position.FRONT.equals(Position.getPosition(this, target));
return Position.FRONT == Position.getPosition(this, target);
}
/**
@ -79,7 +79,7 @@ public interface ILocational
*/
default boolean isOnSideOf(ILocational target)
{
return Position.SIDE.equals(Position.getPosition(this, target));
return Position.SIDE == Position.getPosition(this, target);
}
/**
@ -88,6 +88,6 @@ public interface ILocational
*/
default boolean isBehind(ILocational target)
{
return Position.BACK.equals(Position.getPosition(this, target));
return Position.BACK == Position.getPosition(this, target);
}
}

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
}
}
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER))
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type)
{
return _skill.getAbnormalType().equals(type);
return _skill.getAbnormalType() == type;
}
}

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL))
{
// TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE))
if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{
continue;
}

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/
public boolean isNoblesse()
{
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN);
return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
}
/**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{
if (type.equals(AcquireSkillType.TRANSFORM))
if (type == AcquireSkillType.TRANSFORM)
{
showTransformSkillList(player);
}

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100)))
if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
// Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
}
if (Config.HARDIN_RETAIL_LIMITATIONS)
{
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF))
if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{
continue;
}
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC))
if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{
continue;
}
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player)
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
}
case "33490-12.html":
{
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player))
if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{
htmltext = "33490-15.html";
}
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
}
case "giveSubCertify":
{
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA))
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{
return null;
}
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
}
case "learnSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
}
case "deleteSubSkill":
{
if (player.getRace().equals(Race.ERTHEIA))
// TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{
htmltext = "33490-15.html";
}

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead())
{
npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA))
if (attacker.getRace() == Race.ERTHEIA)
{
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
// Sex checks.
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
}
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
player.getAppearance().setSex(true);
}

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params)
{
_type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET))
if (_type != ModifyType.SET)
{
_hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER))
if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{
instance.setReenterTime();
}

View File

@ -546,7 +546,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1));
@ -565,7 +565,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{
if (player.isMageClass())
{

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance()
{
return _mode.equals(ManorMode.MAINTENANCE);
return _mode == ManorMode.MAINTENANCE;
}
public final boolean isManorApproved()
{
return _mode.equals(ManorMode.APPROVED);
return _mode == ManorMode.APPROVED;
}
public final boolean isModifiablePeriod()
{
return _mode.equals(ManorMode.MODIFIABLE);
return _mode == ManorMode.MODIFIABLE;
}
public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue;
}
if (npc.getDBStatus().equals(DBStatusType.ALIVE))
if (npc.getDBStatus() == DBStatusType.ALIVE)
{
updateStatus(npc, false);
}

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target);
boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/
public boolean hasRandomAnimation()
{
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE));
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
}
/**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override
public boolean isMovementDisabled()
{
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE);
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
}
public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay)
{
// Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH))
if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{
setReenterTime();
}
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player);
// Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN))
if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
}

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
}
// Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL))
if (_removeBuffType == InstanceRemoveBuffType.ALL)
{
for (L2Playable playable : affected)
{
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel
for (GroupType t : GroupType.values())
{
if (!t.equals(playerGroup) && groupMaskContains(t))
if (t != playerGroup && groupMaskContains(t))
{
return t;
}
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY))
if (type == GroupType.PARTY)
{
pGroup = player.getParty();
}
else if (type.equals(GroupType.COMMAND_CHANNEL))
else if (type == GroupType.COMMAND_CHANNEL)
{
pGroup = player.getCommandChannel();
}

View File

@ -70,7 +70,7 @@ public interface ILocational
*/
default boolean isInFrontOf(ILocational target)
{
return Position.FRONT.equals(Position.getPosition(this, target));
return Position.FRONT == Position.getPosition(this, target);
}
/**
@ -79,7 +79,7 @@ public interface ILocational
*/
default boolean isOnSideOf(ILocational target)
{
return Position.SIDE.equals(Position.getPosition(this, target));
return Position.SIDE == Position.getPosition(this, target);
}
/**
@ -88,6 +88,6 @@ public interface ILocational
*/
default boolean isBehind(ILocational target)
{
return Position.BACK.equals(Position.getPosition(this, target));
return Position.BACK == Position.getPosition(this, target);
}
}

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
}
}
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER))
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type)
{
return _skill.getAbnormalType().equals(type);
return _skill.getAbnormalType() == type;
}
}

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL))
{
// TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE))
if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{
continue;
}

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/
public boolean isNoblesse()
{
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN);
return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
}
/**

View File

@ -41,7 +41,7 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
for (int i = 0; i < count; i++)
{
final int bossId = packet.readD();
if (DBSpawnManager.getInstance().getNpcStatusId(bossId).equals(DBStatusType.ALIVE))
if (DBSpawnManager.getInstance().getNpcStatusId(bossId) == DBStatusType.ALIVE)
{
_bossIds.add(bossId);
}

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
// Sex checks.
boolean sexChange = false;
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{

View File

@ -714,17 +714,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance()
{
return _mode.equals(ManorMode.MAINTENANCE);
return _mode == ManorMode.MAINTENANCE;
}
public final boolean isManorApproved()
{
return _mode.equals(ManorMode.APPROVED);
return _mode == ManorMode.APPROVED;
}
public final boolean isModifiablePeriod()
{
return _mode.equals(ManorMode.MODIFIABLE);
return _mode == ManorMode.MODIFIABLE;
}
public final String getCurrentModeName()

View File

@ -205,7 +205,7 @@ public final class DayNightSpawnManager
continue;
}
if ((boss != null) && (boss.getId() == 25328) && boss.getRaidStatus().equals(RaidBossSpawnManager.StatusEnum.ALIVE))
if ((boss != null) && (boss.getId() == 25328) && boss.getRaidStatus() == RaidBossSpawnManager.StatusEnum.ALIVE)
{
handleHellmans(boss, mode);
}

View File

@ -343,7 +343,7 @@ public class RaidBossSpawnManager
continue;
}
if (boss.getRaidStatus().equals(StatusEnum.ALIVE))
if (boss.getRaidStatus() == StatusEnum.ALIVE)
{
updateStatus(boss, false);
}

View File

@ -293,7 +293,7 @@ public class L2Npc extends L2Character
*/
public boolean hasRandomAnimation()
{
return ((Config.MAX_NPC_ANIMATION > 0) && isRandomAnimationEnabled() && !getAiType().equals(AIType.CORPSE));
return ((Config.MAX_NPC_ANIMATION > 0) && isRandomAnimationEnabled() && getAiType() != AIType.CORPSE);
}
/**
@ -1579,7 +1579,7 @@ public class L2Npc extends L2Character
@Override
public boolean isMovementDisabled()
{
return super.isMovementDisabled() || !canMove() || getAiType().equals(AIType.CORPSE);
return super.isMovementDisabled() || !canMove() || getAiType() == AIType.CORPSE;
}
public AIType getAiType()

View File

@ -464,7 +464,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
return false;
}
if (oldCID.equals(newCID.getParent()))
if (oldCID == newCID.getParent())
{
return true;
}

View File

@ -380,7 +380,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
// Sex checks.
if (player.getRace().equals(Race.KAMAEL))
if (player.getRace() == Race.KAMAEL)
{
switch (classidval)
{
@ -414,7 +414,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
}
if (player.getRace().equals(Race.ERTHEIA))
if (player.getRace() == Race.ERTHEIA)
{
player.getAppearance().setSex(true);
}

Some files were not shown because too many files have changed in this diff Show More