Minor code changes.

This commit is contained in:
MobiusDev
2016-04-26 09:16:45 +00:00
parent f568bc6255
commit 6a13705766
13 changed files with 25 additions and 40 deletions

View File

@@ -638,16 +638,9 @@ public class AutoSpawnHandler
return _locList.toArray(new Location[_locList.size()]);
}
public L2Npc[] getNPCInstanceList()
public List<L2Npc> getNPCInstanceList()
{
L2Npc[] ret;
synchronized (_npcList)
{
ret = new L2Npc[_npcList.size()];
_npcList.toArray(ret);
}
return ret;
return _npcList;
}
public List<L2Spawn> getSpawns()

View File

@@ -386,10 +386,7 @@ public class L2Party extends AbstractPlayerGroup
{
synchronized (this)
{
if (_tacticalSigns == null)
{
_tacticalSigns = new ConcurrentHashMap<>(1);
}
_tacticalSigns = new ConcurrentHashMap<>(1);
}
}
return _tacticalSigns;

View File

@@ -8320,7 +8320,7 @@ public final class L2PcInstance extends L2Playable
// Add Henna skills
for (SkillHolder skill : henna.getSkills())
{
if (!getAllSkills().contains(skill))
if (!getAllSkills().contains(skill.getSkill()))
{
addSkill(skill.getSkill(), true);
}

View File

@@ -128,7 +128,7 @@ public class Friend
public String getName()
{
if (_name == "")
if (_name.equals(""))
{
_name = CharNameTable.getInstance().getNameById(_friendOID);
}

View File

@@ -150,19 +150,17 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
PreparedStatement ps = con.prepareStatement(SQL_LOAD_GUARDS))
{
ps.setInt(1, _hall.getId());
try (ResultSet rset = ps.executeQuery())
final ResultSet rset = ps.executeQuery();
while (rset.next())
{
while (rset.next())
{
final L2Spawn spawn = new L2Spawn(rset.getInt("npcId"));
spawn.setX(rset.getInt("x"));
spawn.setY(rset.getInt("y"));
spawn.setZ(rset.getInt("z"));
spawn.setHeading(rset.getInt("heading"));
spawn.setRespawnDelay(rset.getInt("respawnDelay"));
spawn.setAmount(1);
_guards.add(spawn);
}
final L2Spawn spawn = new L2Spawn(rset.getInt("npcId"));
spawn.setX(rset.getInt("x"));
spawn.setY(rset.getInt("y"));
spawn.setZ(rset.getInt("z"));
spawn.setHeading(rset.getInt("heading"));
spawn.setRespawnDelay(rset.getInt("respawnDelay"));
spawn.setAmount(1);
_guards.add(spawn);
}
}
catch (Exception e)

View File

@@ -66,7 +66,7 @@ public class RequestAlchemyTryMixCube extends L2GameClientPacket
activeChar.sendPacket(ExTryMixCube.FAIL);
return;
}
if (activeChar.isInStoreMode() || activeChar.isInStoreMode())
if (activeChar.isInStoreMode())
{
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_ALCHEMY_WHILE_TRADING_OR_USING_A_PRIVATE_STORE_OR_SHOP);
activeChar.sendPacket(ExTryMixCube.FAIL);

View File

@@ -55,8 +55,8 @@ public final class RequestAnswerFriendInvite extends L2GameClientPacket
return;
}
if (player.getFriendList().containsValue(requestor.getObjectId()) //
|| requestor.getFriendList().containsValue(player.getObjectId()))
if (player.getFriendList().containsKey(requestor.getObjectId()) //
|| requestor.getFriendList().containsKey(player.getObjectId()))
{
requestor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.THIS_PLAYER_IS_ALREADY_REGISTERED_ON_YOUR_FRIENDS_LIST));
return;

View File

@@ -74,7 +74,7 @@ public class PledgeShowMemberListAll extends L2GameServerPacket
{
_name = subPledge.getName();
}
writeD((_name == "") || (_name == name) ? 0 : 1);
writeD((_name.equals("")) || (_name.equals(name)) ? 0 : 1);
writeD(_clan.getId());
writeD(Config.SERVER_ID);
writeD(_pledgeType);

View File

@@ -136,7 +136,7 @@ public class IPSubnet
{
return applyMask(((IPSubnet) o).getAddress());
}
else if (o instanceof InetAddress)
if (o instanceof InetAddress)
{
return applyMask(((InetAddress) o).getAddress());
}