Use of isEmpty method when possible.
This commit is contained in:
@@ -451,7 +451,7 @@ public class Attackable extends Npc
|
||||
|
||||
final PartyContainer mostDamageParty;
|
||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
||||
mostDamageParty = damagingParties.size() > 0 ? damagingParties.get(0) : null;
|
||||
mostDamageParty = !damagingParties.isEmpty() ? damagingParties.get(0) : null;
|
||||
|
||||
// Calculate raidboss points
|
||||
if (_isRaid && !_isRaidMinion)
|
||||
|
@@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||
if (skills.size() > 0)
|
||||
if (!skills.isEmpty())
|
||||
{
|
||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
||||
}
|
||||
@@ -486,7 +486,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS);
|
||||
if (skills.size() > 0)
|
||||
if (!skills.isEmpty())
|
||||
{
|
||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||
}
|
||||
|
@@ -129,7 +129,7 @@ public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||
|
||||
// Check inventory capacity
|
||||
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||
if (!rewards.isEmpty() && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||
{
|
||||
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||
|
@@ -66,7 +66,7 @@ public class AcquireSkillList implements IClientOutgoingPacket
|
||||
packet.writeQ(skill.getLevelUpSp());
|
||||
packet.writeC(skill.getGetLevel());
|
||||
packet.writeC(0x00); // Skill dual class level.
|
||||
if (skill.getRequiredItems().size() > 0)
|
||||
if (!skill.getRequiredItems().isEmpty())
|
||||
{
|
||||
for (ItemHolder item : skill.getRequiredItems())
|
||||
{
|
||||
|
Reference in New Issue
Block a user