Replaced equals() on enum constants.
This commit is contained in:
@ -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()
|
||||
|
@ -417,7 +417,7 @@ public class DBSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if (npc.getDBStatus().equals(DBStatusType.ALIVE))
|
||||
if (npc.getDBStatus() == DBStatusType.ALIVE)
|
||||
{
|
||||
updateStatus(npc, false);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -455,6 +455,6 @@ public final class BuffInfo
|
||||
|
||||
public boolean isAbnormalType(AbnormalType type)
|
||||
{
|
||||
return _skill.getAbnormalType().equals(type);
|
||||
return _skill.getAbnormalType() == type;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user