Use of isEmpty method when possible.
This commit is contained in:
@@ -454,7 +454,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
||||||
|
|
||||||
if (Hero.getInstance().getHeroes().size() > 0)
|
if (!Hero.getInstance().getHeroes().isEmpty())
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
||||||
|
|||||||
+4
-4
@@ -66,7 +66,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
||||||
packet.writeD(933); // unk, 933 all time
|
packet.writeD(933); // unk, 933 all time
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
switch (_tabId)
|
switch (_tabId)
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeString(player.getString("clanName")); // clan name
|
packet.writeString(player.getString("clanName")); // clan name
|
||||||
packet.writeD(id); // rank
|
packet.writeD(id); // rank
|
||||||
|
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id2 : _snapshotList.keySet())
|
for (Integer id2 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -137,7 +137,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeString(plr.getString("name"));
|
packet.writeString(plr.getString("name"));
|
||||||
packet.writeString(plr.getString("clanName"));
|
packet.writeString(plr.getString("clanName"));
|
||||||
packet.writeD(id2);
|
packet.writeD(id2);
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id3 : _snapshotList.keySet())
|
for (Integer id3 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeString(player.getString("name"));
|
packet.writeString(player.getString("name"));
|
||||||
packet.writeString(player.getString("clanName"));
|
packet.writeString(player.getString("clanName"));
|
||||||
packet.writeD(i); // class rank
|
packet.writeD(i); // class rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
final Map<Integer, StatSet> snapshotRaceList = new ConcurrentHashMap<>();
|
final Map<Integer, StatSet> snapshotRaceList = new ConcurrentHashMap<>();
|
||||||
int j = 1;
|
int j = 1;
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id : _playerList.keySet())
|
for (Integer id : _playerList.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
+8
-8
@@ -60,7 +60,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeC(_scope);
|
packet.writeC(_scope);
|
||||||
packet.writeD(_race);
|
packet.writeD(_race);
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
switch (_group)
|
switch (_group)
|
||||||
{
|
{
|
||||||
@@ -80,7 +80,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(id); // server rank
|
packet.writeD(id); // server rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id2 : _snapshotList.keySet())
|
for (Integer id2 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -128,7 +128,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(plr.getInt("race"));
|
packet.writeD(plr.getInt("race"));
|
||||||
packet.writeD(id2); // server rank
|
packet.writeD(id2); // server rank
|
||||||
|
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id3 : _snapshotList.keySet())
|
for (Integer id3 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -177,7 +177,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(i); // server rank
|
packet.writeD(i); // server rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
final Map<Integer, StatSet> snapshotRaceList = new ConcurrentHashMap<>();
|
final Map<Integer, StatSet> snapshotRaceList = new ConcurrentHashMap<>();
|
||||||
int j = 1;
|
int j = 1;
|
||||||
@@ -289,7 +289,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(id); // clan rank
|
packet.writeD(id); // clan rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id2 : _snapshotList.keySet())
|
for (Integer id2 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -316,7 +316,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
}
|
}
|
||||||
case 3: // friend
|
case 3: // friend
|
||||||
{
|
{
|
||||||
if (_player.getFriendList().size() > 0)
|
if (!_player.getFriendList().isEmpty())
|
||||||
{
|
{
|
||||||
final Set<Integer> friendList = ConcurrentHashMap.newKeySet();
|
final Set<Integer> friendList = ConcurrentHashMap.newKeySet();
|
||||||
int count = 1;
|
int count = 1;
|
||||||
@@ -347,7 +347,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(id); // friend rank
|
packet.writeD(id); // friend rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id2 : _snapshotList.keySet())
|
for (Integer id2 : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
@@ -384,7 +384,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(_player.getBaseClass());
|
packet.writeD(_player.getBaseClass());
|
||||||
packet.writeD(_player.getRace().ordinal());
|
packet.writeD(_player.getRace().ordinal());
|
||||||
packet.writeD(1); // clan rank
|
packet.writeD(1); // clan rank
|
||||||
if (_snapshotList.size() > 0)
|
if (!_snapshotList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id : _snapshotList.keySet())
|
for (Integer id : _snapshotList.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
||||||
|
|
||||||
if (Hero.getInstance().getHeroes().size() > 0)
|
if (!Hero.getInstance().getHeroes().isEmpty())
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
||||||
|
|||||||
+2
-2
@@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
||||||
packet.writeD(933); // unk, 933 all time
|
packet.writeD(933); // unk, 933 all time
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId];
|
final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_rankingType), ClassId.getClassId(_classId));
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_rankingType), ClassId.getClassId(_classId));
|
||||||
@@ -144,7 +144,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeString(player.getString("clanName")); // clan name
|
packet.writeString(player.getString("clanName")); // clan name
|
||||||
packet.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank
|
packet.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank
|
||||||
|
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
int snapshotRank = 1;
|
int snapshotRank = 1;
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket
|
|||||||
packet.writeC(_tabId);
|
packet.writeC(_tabId);
|
||||||
packet.writeC(_type);
|
packet.writeC(_type);
|
||||||
packet.writeD(_race);
|
packet.writeD(_race);
|
||||||
if ((_playerList.size() > 0) && (_type != 255) && (_race != 255))
|
if (!_playerList.isEmpty() && (_type != 255) && (_race != 255))
|
||||||
{
|
{
|
||||||
final RankingCategory category = RankingCategory.values()[_tabId];
|
final RankingCategory category = RankingCategory.values()[_tabId];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_type), Race.values()[_race]);
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_type), Race.values()[_race]);
|
||||||
@@ -152,7 +152,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeQ(player.getInt("points")); // server rank
|
packet.writeQ(player.getInt("points")); // server rank
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket
|
|||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet);
|
OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet);
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (Integer id : _playerList.keySet())
|
for (Integer id : _playerList.keySet())
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id : _playerList.keySet())
|
for (Integer id : _playerList.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -66,7 +66,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(_ordinal);
|
packet.writeD(_ordinal);
|
||||||
packet.writeD(_player.getClassId().getId());
|
packet.writeD(_player.getClassId().getId());
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
final RankingCategory category = RankingCategory.values()[_group];
|
final RankingCategory category = RankingCategory.values()[_group];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope));
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope));
|
||||||
@@ -159,7 +159,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank
|
packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
int snapshotRank = 1;
|
int snapshotRank = 1;
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
|
|||||||
+1
-1
@@ -446,7 +446,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
OutgoingPackets.EX_OLYMPIAD_HERO_AND_LEGEND_INFO.writeId(packet);
|
||||||
|
|
||||||
if (Hero.getInstance().getHeroes().size() > 0)
|
if (!Hero.getInstance().getHeroes().isEmpty())
|
||||||
{
|
{
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
PreparedStatement statement = con.prepareStatement(GET_HEROES))
|
||||||
|
|||||||
+2
-2
@@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
packet.writeD(_serverId); // 0 - all servers, server id - for caller server
|
||||||
packet.writeD(933); // unk, 933 all time
|
packet.writeD(933); // unk, 933 all time
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId];
|
final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_rankingType), ClassId.getClassId(_classId));
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_rankingType), ClassId.getClassId(_classId));
|
||||||
@@ -144,7 +144,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket
|
|||||||
packet.writeString(player.getString("clanName")); // clan name
|
packet.writeString(player.getString("clanName")); // clan name
|
||||||
packet.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank
|
packet.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank
|
||||||
|
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
int snapshotRank = 1;
|
int snapshotRank = 1;
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket
|
|||||||
packet.writeC(_tabId);
|
packet.writeC(_tabId);
|
||||||
packet.writeC(_type);
|
packet.writeC(_type);
|
||||||
packet.writeD(_race);
|
packet.writeD(_race);
|
||||||
if ((_playerList.size() > 0) && (_type != 255) && (_race != 255))
|
if (!_playerList.isEmpty() && (_type != 255) && (_race != 255))
|
||||||
{
|
{
|
||||||
final RankingCategory category = RankingCategory.values()[_tabId];
|
final RankingCategory category = RankingCategory.values()[_tabId];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_type), Race.values()[_race]);
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_type), Race.values()[_race]);
|
||||||
@@ -152,7 +152,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeQ(player.getInt("points")); // server rank
|
packet.writeQ(player.getInt("points")); // server rank
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket
|
|||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet);
|
OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet);
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (Integer id : _playerList.keySet())
|
for (Integer id : _playerList.keySet())
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet);
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
for (Integer id : _playerList.keySet())
|
for (Integer id : _playerList.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -66,7 +66,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(_ordinal);
|
packet.writeD(_ordinal);
|
||||||
packet.writeD(_player.getClassId().getId());
|
packet.writeD(_player.getClassId().getId());
|
||||||
|
|
||||||
if (_playerList.size() > 0)
|
if (!_playerList.isEmpty())
|
||||||
{
|
{
|
||||||
final RankingCategory category = RankingCategory.values()[_group];
|
final RankingCategory category = RankingCategory.values()[_group];
|
||||||
writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope));
|
writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope));
|
||||||
@@ -159,7 +159,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket
|
|||||||
packet.writeD(player.getInt("classId"));
|
packet.writeD(player.getInt("classId"));
|
||||||
packet.writeD(player.getInt("race"));
|
packet.writeD(player.getInt("race"));
|
||||||
packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank
|
packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank
|
||||||
if (snapshot.size() > 0)
|
if (!snapshot.isEmpty())
|
||||||
{
|
{
|
||||||
int snapshotRank = 1;
|
int snapshotRank = 1;
|
||||||
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
for (Entry<Integer, StatSet> ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ public class GameServer
|
|||||||
printSection("Quests");
|
printSection("Quests");
|
||||||
if (!Config.ALT_DEV_NO_QUESTS)
|
if (!Config.ALT_DEV_NO_QUESTS)
|
||||||
{
|
{
|
||||||
if (QuestManager.getInstance().getQuests().size() == 0)
|
if (QuestManager.getInstance().getQuests().isEmpty())
|
||||||
{
|
{
|
||||||
QuestManager.getInstance().reloadAllQuests();
|
QuestManager.getInstance().reloadAllQuests();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -218,7 +218,7 @@ public class FortSiegeGuardAI extends CreatureAI implements Runnable
|
|||||||
final Attackable npc = (Attackable) _actor;
|
final Attackable npc = (Attackable) _actor;
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class SiegeGuardAI extends CreatureAI implements Runnable
|
|||||||
final Attackable npc = (Attackable) _actor;
|
final Attackable npc = (Attackable) _actor;
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -503,7 +503,7 @@ public class Disablers implements ISkillHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((Config.RESTORE_CANCELLED_BUFFS_SECONDS > 0) && (cancelledBuffs.size() > 0))
|
if ((Config.RESTORE_CANCELLED_BUFFS_SECONDS > 0) && !cancelledBuffs.isEmpty())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new CancelSkillRestoreTask((PlayerInstance) target, cancelledBuffs), Config.RESTORE_CANCELLED_BUFFS_SECONDS * 1000);
|
ThreadPool.schedule(new CancelSkillRestoreTask((PlayerInstance) target, cancelledBuffs), Config.RESTORE_CANCELLED_BUFFS_SECONDS * 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -525,7 +525,7 @@ public class PetitionManager
|
|||||||
{
|
{
|
||||||
final StringBuilder htmlContent = new StringBuilder("<html><body><center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
|
final StringBuilder htmlContent = new StringBuilder("<html><body><center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
|
||||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");
|
final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");
|
||||||
if (_pendingPetitions.size() == 0)
|
if (_pendingPetitions.isEmpty())
|
||||||
{
|
{
|
||||||
htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
|
htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class MobGroup
|
|||||||
{
|
{
|
||||||
removeDead();
|
removeDead();
|
||||||
|
|
||||||
if (getMobs().size() == 0)
|
if (getMobs().isEmpty())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ public class MobGroup
|
|||||||
{
|
{
|
||||||
removeDead();
|
removeDead();
|
||||||
|
|
||||||
if (getMobs().size() == 0)
|
if (getMobs().isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -6649,7 +6649,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_chanceSkills.size() == 0)
|
if (_chanceSkills.isEmpty())
|
||||||
{
|
{
|
||||||
_chanceSkills = null;
|
_chanceSkills = null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -132,7 +132,7 @@ public class ClassMasterInstance extends FolkInstance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel) != null) && (Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel).size() > 0))
|
if ((Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel) != null) && !Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel).isEmpty())
|
||||||
{
|
{
|
||||||
sb.append("<br><br>Item(s) required for class change:");
|
sb.append("<br><br>Item(s) required for class change:");
|
||||||
sb.append("<table width=220>");
|
sb.append("<table width=220>");
|
||||||
|
|||||||
+3
-3
@@ -9799,7 +9799,7 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Triggered skills cannot be used directly
|
// Triggered skills cannot be used directly
|
||||||
if ((_triggeredSkills.size() > 0) && (_triggeredSkills.get(skill.getId()) != null))
|
if (!_triggeredSkills.isEmpty() && (_triggeredSkills.get(skill.getId()) != null))
|
||||||
{
|
{
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
@@ -10570,7 +10570,7 @@ public class PlayerInstance extends Playable
|
|||||||
public void unsummonAllCubics()
|
public void unsummonAllCubics()
|
||||||
{
|
{
|
||||||
// Unsummon Cubics
|
// Unsummon Cubics
|
||||||
if (_cubics.size() > 0)
|
if (!_cubics.isEmpty())
|
||||||
{
|
{
|
||||||
for (CubicInstance cubic : _cubics.values())
|
for (CubicInstance cubic : _cubics.values())
|
||||||
{
|
{
|
||||||
@@ -10691,7 +10691,7 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
ItemInstance item;
|
ItemInstance item;
|
||||||
IItemHandler handler;
|
IItemHandler handler;
|
||||||
if ((_activeSoulShots == null) || (_activeSoulShots.size() == 0))
|
if ((_activeSoulShots == null) || (_activeSoulShots.isEmpty()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -171,7 +171,7 @@ public class WarehouseInstance extends FolkInstance
|
|||||||
private void showDepositWindowFreight(PlayerInstance player)
|
private void showDepositWindowFreight(PlayerInstance player)
|
||||||
{
|
{
|
||||||
// No other chars in the account of this player
|
// No other chars in the account of this player
|
||||||
if (player.getAccountChars().size() == 0)
|
if (player.getAccountChars().isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.THAT_CHARACTER_DOES_NOT_EXIST);
|
player.sendPacket(SystemMessageId.THAT_CHARACTER_DOES_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -65,10 +65,10 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int id = stat.ordinal();
|
final int id = stat.ordinal();
|
||||||
final Calculator c = _creature.getCalculators()[id];
|
final Calculator calc = _creature.getCalculators()[id];
|
||||||
|
|
||||||
// If no Func object found, no modifier is applied
|
// If no Func object found, no modifier is applied
|
||||||
if ((c == null) || (c.size() == 0))
|
if ((calc == null) || (calc.size() == 0))
|
||||||
{
|
{
|
||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class CreatureStat
|
|||||||
env.baseValue = init;
|
env.baseValue = init;
|
||||||
|
|
||||||
// Launch the calculation
|
// Launch the calculation
|
||||||
c.calc(env);
|
calc.calc(env);
|
||||||
// avoid some troubles with negative stats (some stats should never be negative)
|
// avoid some troubles with negative stats (some stats should never be negative)
|
||||||
if (env.value <= 0)
|
if (env.value <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
|
|||||||
public void startSiege()
|
public void startSiege()
|
||||||
{
|
{
|
||||||
setRegistrationPeriod(false);
|
setRegistrationPeriod(false);
|
||||||
if (_clansInfo.size() == 0)
|
if (_clansInfo.isEmpty())
|
||||||
{
|
{
|
||||||
endSiege(false);
|
endSiege(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
|
|||||||
public void startSiege()
|
public void startSiege()
|
||||||
{
|
{
|
||||||
setRegistrationPeriod(false);
|
setRegistrationPeriod(false);
|
||||||
if (_clansInfo.size() == 0)
|
if (_clansInfo.isEmpty())
|
||||||
{
|
{
|
||||||
endSiege(false);
|
endSiege(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
-3
@@ -62,8 +62,6 @@ public class FriendList implements IClientOutgoingPacket
|
|||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.FRIEND_LIST.writeId(packet);
|
OutgoingPackets.FRIEND_LIST.writeId(packet);
|
||||||
if (_info.size() > 0)
|
|
||||||
{
|
|
||||||
packet.writeH(_info.size());
|
packet.writeH(_info.size());
|
||||||
for (FriendInfo friend : _info)
|
for (FriendInfo friend : _info)
|
||||||
{
|
{
|
||||||
@@ -73,7 +71,6 @@ public class FriendList implements IClientOutgoingPacket
|
|||||||
packet.writeD(friend._online ? 0x01 : 0x00);
|
packet.writeD(friend._online ? 0x01 : 0x00);
|
||||||
packet.writeH(0); // ??
|
packet.writeH(0); // ??
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -390,7 +390,7 @@ public class GameServer
|
|||||||
printSection("Quests");
|
printSection("Quests");
|
||||||
if (!Config.ALT_DEV_NO_QUESTS)
|
if (!Config.ALT_DEV_NO_QUESTS)
|
||||||
{
|
{
|
||||||
if (QuestManager.getInstance().getQuests().size() == 0)
|
if (QuestManager.getInstance().getQuests().isEmpty())
|
||||||
{
|
{
|
||||||
QuestManager.getInstance().reloadAllQuests();
|
QuestManager.getInstance().reloadAllQuests();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ public class FortSiegeGuardAI extends CreatureAI implements Runnable
|
|||||||
final Attackable npc = (Attackable) _actor;
|
final Attackable npc = (Attackable) _actor;
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class SiegeGuardAI extends CreatureAI implements Runnable
|
|||||||
final Attackable npc = (Attackable) _actor;
|
final Attackable npc = (Attackable) _actor;
|
||||||
|
|
||||||
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
// If its _knownPlayer isn't empty set the Intention to AI_INTENTION_ACTIVE
|
||||||
if (npc.getKnownList().getKnownPlayers().size() > 0)
|
if (!npc.getKnownList().getKnownPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
intention = AI_INTENTION_ACTIVE;
|
intention = AI_INTENTION_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -503,7 +503,7 @@ public class Disablers implements ISkillHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((Config.RESTORE_CANCELLED_BUFFS_SECONDS > 0) && (cancelledBuffs.size() > 0))
|
if ((Config.RESTORE_CANCELLED_BUFFS_SECONDS > 0) && !cancelledBuffs.isEmpty())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new CancelSkillRestoreTask((PlayerInstance) target, cancelledBuffs), Config.RESTORE_CANCELLED_BUFFS_SECONDS * 1000);
|
ThreadPool.schedule(new CancelSkillRestoreTask((PlayerInstance) target, cancelledBuffs), Config.RESTORE_CANCELLED_BUFFS_SECONDS * 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -525,7 +525,7 @@ public class PetitionManager
|
|||||||
{
|
{
|
||||||
final StringBuilder htmlContent = new StringBuilder("<html><body><center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
|
final StringBuilder htmlContent = new StringBuilder("<html><body><center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
|
||||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");
|
final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");
|
||||||
if (_pendingPetitions.size() == 0)
|
if (_pendingPetitions.isEmpty())
|
||||||
{
|
{
|
||||||
htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
|
htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class MobGroup
|
|||||||
{
|
{
|
||||||
removeDead();
|
removeDead();
|
||||||
|
|
||||||
if (getMobs().size() == 0)
|
if (getMobs().isEmpty())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ public class MobGroup
|
|||||||
{
|
{
|
||||||
removeDead();
|
removeDead();
|
||||||
|
|
||||||
if (getMobs().size() == 0)
|
if (getMobs().isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6696,7 +6696,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_chanceSkills.size() == 0)
|
if (_chanceSkills.isEmpty())
|
||||||
{
|
{
|
||||||
_chanceSkills = null;
|
_chanceSkills = null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -132,7 +132,7 @@ public class ClassMasterInstance extends FolkInstance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel) != null) && (Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel).size() > 0))
|
if ((Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel) != null) && !Config.CLASS_MASTER_SETTINGS.getRequireItems(jobLevel).isEmpty())
|
||||||
{
|
{
|
||||||
sb.append("<br><br>Item(s) required for class change:");
|
sb.append("<br><br>Item(s) required for class change:");
|
||||||
sb.append("<table width=220>");
|
sb.append("<table width=220>");
|
||||||
|
|||||||
+3
-3
@@ -9961,7 +9961,7 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Triggered skills cannot be used directly
|
// Triggered skills cannot be used directly
|
||||||
if ((_triggeredSkills.size() > 0) && (_triggeredSkills.get(skill.getId()) != null))
|
if (!_triggeredSkills.isEmpty() && (_triggeredSkills.get(skill.getId()) != null))
|
||||||
{
|
{
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
@@ -10742,7 +10742,7 @@ public class PlayerInstance extends Playable
|
|||||||
public void unsummonAllCubics()
|
public void unsummonAllCubics()
|
||||||
{
|
{
|
||||||
// Unsummon Cubics
|
// Unsummon Cubics
|
||||||
if (_cubics.size() > 0)
|
if (!_cubics.isEmpty())
|
||||||
{
|
{
|
||||||
for (CubicInstance cubic : _cubics.values())
|
for (CubicInstance cubic : _cubics.values())
|
||||||
{
|
{
|
||||||
@@ -10863,7 +10863,7 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
ItemInstance item;
|
ItemInstance item;
|
||||||
IItemHandler handler;
|
IItemHandler handler;
|
||||||
if ((_activeSoulShots == null) || (_activeSoulShots.size() == 0))
|
if ((_activeSoulShots == null) || (_activeSoulShots.isEmpty()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -171,7 +171,7 @@ public class WarehouseInstance extends FolkInstance
|
|||||||
private void showDepositWindowFreight(PlayerInstance player)
|
private void showDepositWindowFreight(PlayerInstance player)
|
||||||
{
|
{
|
||||||
// No other chars in the account of this player
|
// No other chars in the account of this player
|
||||||
if (player.getAccountChars().size() == 0)
|
if (player.getAccountChars().isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.THAT_CHARACTER_DOES_NOT_EXIST);
|
player.sendPacket(SystemMessageId.THAT_CHARACTER_DOES_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -65,10 +65,10 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int id = stat.ordinal();
|
final int id = stat.ordinal();
|
||||||
final Calculator c = _creature.getCalculators()[id];
|
final Calculator calc = _creature.getCalculators()[id];
|
||||||
|
|
||||||
// If no Func object found, no modifier is applied
|
// If no Func object found, no modifier is applied
|
||||||
if ((c == null) || (c.size() == 0))
|
if ((calc == null) || (calc.size() == 0))
|
||||||
{
|
{
|
||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class CreatureStat
|
|||||||
env.baseValue = init;
|
env.baseValue = init;
|
||||||
|
|
||||||
// Launch the calculation
|
// Launch the calculation
|
||||||
c.calc(env);
|
calc.calc(env);
|
||||||
// avoid some troubles with negative stats (some stats should never be negative)
|
// avoid some troubles with negative stats (some stats should never be negative)
|
||||||
if (env.value <= 0)
|
if (env.value <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
|
|||||||
public void startSiege()
|
public void startSiege()
|
||||||
{
|
{
|
||||||
setRegistrationPeriod(false);
|
setRegistrationPeriod(false);
|
||||||
if (_clansInfo.size() == 0)
|
if (_clansInfo.isEmpty())
|
||||||
{
|
{
|
||||||
endSiege(false);
|
endSiege(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
|
|||||||
public void startSiege()
|
public void startSiege()
|
||||||
{
|
{
|
||||||
setRegistrationPeriod(false);
|
setRegistrationPeriod(false);
|
||||||
if (_clansInfo.size() == 0)
|
if (_clansInfo.isEmpty())
|
||||||
{
|
{
|
||||||
endSiege(false);
|
endSiege(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+5
-5
@@ -63,12 +63,12 @@ public class FriendList implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.FRIEND_LIST.writeId(packet);
|
OutgoingPackets.FRIEND_LIST.writeId(packet);
|
||||||
packet.writeD(_info.size());
|
packet.writeD(_info.size());
|
||||||
for (FriendInfo info : _info)
|
for (FriendInfo friend : _info)
|
||||||
{
|
{
|
||||||
packet.writeD(info._objId);
|
packet.writeD(friend._objId);
|
||||||
packet.writeS(info._name);
|
packet.writeS(friend._name);
|
||||||
packet.writeD(info._online ? 0x01 : 0x00);
|
packet.writeD(friend._online ? 0x01 : 0x00);
|
||||||
packet.writeD(info._online ? info._objId : 0x00);
|
packet.writeD(friend._online ? friend._objId : 0x00);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -562,7 +562,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
@Override
|
@Override
|
||||||
public void onSiegeEnds()
|
public void onSiegeEnds()
|
||||||
{
|
{
|
||||||
if (_data.size() > 0)
|
if (!_data.isEmpty())
|
||||||
{
|
{
|
||||||
for (int clanId : _data.keySet())
|
for (int clanId : _data.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -476,7 +476,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
||||||
mostDamageParty = damagingParties.size() > 0 ? damagingParties.get(0) : null;
|
mostDamageParty = !damagingParties.isEmpty() ? damagingParties.get(0) : null;
|
||||||
|
|
||||||
// Manage Base, Quests and Sweep drops of the Attackable
|
// Manage Base, Quests and Sweep drops of the Attackable
|
||||||
if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage))
|
if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage))
|
||||||
|
|||||||
+3
-3
@@ -86,10 +86,10 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int id = stat.ordinal();
|
final int id = stat.ordinal();
|
||||||
final Calculator c = _creature.getCalculators()[id];
|
final Calculator calc = _creature.getCalculators()[id];
|
||||||
|
|
||||||
// If no Func object found, no modifier is applied
|
// If no Func object found, no modifier is applied
|
||||||
if ((c == null) || (c.size() == 0))
|
if ((calc == null) || (calc.size() == 0))
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Launch the calculation
|
// Launch the calculation
|
||||||
value = c.calc(_creature, target, skill, value);
|
value = calc.calc(_creature, target, skill, value);
|
||||||
|
|
||||||
// avoid some troubles with negative stats (some stats should never be negative)
|
// avoid some troubles with negative stats (some stats should never be negative)
|
||||||
if (value <= 0)
|
if (value <= 0)
|
||||||
|
|||||||
+1
-1
@@ -121,7 +121,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
|||||||
ps.setInt(1, _hall.getId());
|
ps.setInt(1, _hall.getId());
|
||||||
ps.execute();
|
ps.execute();
|
||||||
|
|
||||||
if (_attackers.size() > 0)
|
if (!_attackers.isEmpty())
|
||||||
{
|
{
|
||||||
try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS))
|
try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket
|
|||||||
packet.writeS(_player.getName());
|
packet.writeS(_player.getName());
|
||||||
|
|
||||||
final List<Quest> questList = _player.getAllActiveQuests();
|
final List<Quest> questList = _player.getAllActiveQuests();
|
||||||
if (questList.size() == 0)
|
if (questList.isEmpty())
|
||||||
{
|
{
|
||||||
packet.writeC(0);
|
packet.writeC(0);
|
||||||
packet.writeH(0);
|
packet.writeH(0);
|
||||||
|
|||||||
+1
-1
@@ -562,7 +562,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
@Override
|
@Override
|
||||||
public void onSiegeEnds()
|
public void onSiegeEnds()
|
||||||
{
|
{
|
||||||
if (_data.size() > 0)
|
if (!_data.isEmpty())
|
||||||
{
|
{
|
||||||
for (int clanId : _data.keySet())
|
for (int clanId : _data.keySet())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -476,7 +476,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
||||||
mostDamageParty = damagingParties.size() > 0 ? damagingParties.get(0) : null;
|
mostDamageParty = !damagingParties.isEmpty() ? damagingParties.get(0) : null;
|
||||||
|
|
||||||
// Manage Base, Quests and Sweep drops of the Attackable
|
// Manage Base, Quests and Sweep drops of the Attackable
|
||||||
if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage))
|
if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage))
|
||||||
|
|||||||
+3
-3
@@ -86,10 +86,10 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int id = stat.ordinal();
|
final int id = stat.ordinal();
|
||||||
final Calculator c = _creature.getCalculators()[id];
|
final Calculator calc = _creature.getCalculators()[id];
|
||||||
|
|
||||||
// If no Func object found, no modifier is applied
|
// If no Func object found, no modifier is applied
|
||||||
if ((c == null) || (c.size() == 0))
|
if ((calc == null) || (calc.size() == 0))
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ public class CreatureStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Launch the calculation
|
// Launch the calculation
|
||||||
value = c.calc(_creature, target, skill, value);
|
value = calc.calc(_creature, target, skill, value);
|
||||||
|
|
||||||
// avoid some troubles with negative stats (some stats should never be negative)
|
// avoid some troubles with negative stats (some stats should never be negative)
|
||||||
if (value <= 0)
|
if (value <= 0)
|
||||||
|
|||||||
+1
-1
@@ -121,7 +121,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
|||||||
ps.setInt(1, _hall.getId());
|
ps.setInt(1, _hall.getId());
|
||||||
ps.execute();
|
ps.execute();
|
||||||
|
|
||||||
if (_attackers.size() > 0)
|
if (!_attackers.isEmpty())
|
||||||
{
|
{
|
||||||
try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS))
|
try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket
|
|||||||
packet.writeS(_player.getName());
|
packet.writeS(_player.getName());
|
||||||
|
|
||||||
final List<Quest> questList = _player.getAllActiveQuests();
|
final List<Quest> questList = _player.getAllActiveQuests();
|
||||||
if (questList.size() == 0)
|
if (questList.isEmpty())
|
||||||
{
|
{
|
||||||
packet.writeC(0);
|
packet.writeC(0);
|
||||||
packet.writeH(0);
|
packet.writeH(0);
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI
|
|||||||
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
||||||
{
|
{
|
||||||
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
||||||
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().size() == 0) && !leader.isDead())
|
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
|
||||||
{
|
{
|
||||||
makeMortal(leader);
|
makeMortal(leader);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
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);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ public class AcquireSkillList implements IClientOutgoingPacket
|
|||||||
packet.writeQ(skill.getLevelUpSp());
|
packet.writeQ(skill.getLevelUpSp());
|
||||||
packet.writeC(skill.getGetLevel());
|
packet.writeC(skill.getGetLevel());
|
||||||
packet.writeC(0x00); // Skill dual class level.
|
packet.writeC(0x00); // Skill dual class level.
|
||||||
if (skill.getRequiredItems().size() > 0)
|
if (!skill.getRequiredItems().isEmpty())
|
||||||
{
|
{
|
||||||
for (ItemHolder item : skill.getRequiredItems())
|
for (ItemHolder item : skill.getRequiredItems())
|
||||||
{
|
{
|
||||||
|
|||||||
L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java
Vendored
+1
-1
@@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI
|
|||||||
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
||||||
{
|
{
|
||||||
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
||||||
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().size() == 0) && !leader.isDead())
|
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
|
||||||
{
|
{
|
||||||
makeMortal(leader);
|
makeMortal(leader);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
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);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ public class AcquireSkillList implements IClientOutgoingPacket
|
|||||||
packet.writeQ(skill.getLevelUpSp());
|
packet.writeQ(skill.getLevelUpSp());
|
||||||
packet.writeC(skill.getGetLevel());
|
packet.writeC(skill.getGetLevel());
|
||||||
packet.writeC(0x00); // Skill dual class level.
|
packet.writeC(0x00); // Skill dual class level.
|
||||||
if (skill.getRequiredItems().size() > 0)
|
if (!skill.getRequiredItems().isEmpty())
|
||||||
{
|
{
|
||||||
for (ItemHolder item : skill.getRequiredItems())
|
for (ItemHolder item : skill.getRequiredItems())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI
|
|||||||
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
||||||
{
|
{
|
||||||
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
||||||
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().size() == 0) && !leader.isDead())
|
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
|
||||||
{
|
{
|
||||||
makeMortal(leader);
|
makeMortal(leader);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -447,7 +447,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
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);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket
|
|||||||
packet.writeC(skill.getGetLevel());
|
packet.writeC(skill.getGetLevel());
|
||||||
packet.writeC(0x00); // Skill dual class level.
|
packet.writeC(0x00); // Skill dual class level.
|
||||||
packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01);
|
packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01);
|
||||||
if (skill.getRequiredItems().size() > 0)
|
if (!skill.getRequiredItems().isEmpty())
|
||||||
{
|
{
|
||||||
for (ItemHolder item : skill.getRequiredItems())
|
for (ItemHolder item : skill.getRequiredItems())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI
|
|||||||
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
||||||
{
|
{
|
||||||
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
||||||
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().size() == 0) && !leader.isDead())
|
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
|
||||||
{
|
{
|
||||||
makeMortal(leader);
|
makeMortal(leader);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -449,7 +449,7 @@ public class Attackable extends Npc
|
|||||||
|
|
||||||
final PartyContainer mostDamageParty;
|
final PartyContainer mostDamageParty;
|
||||||
damagingParties.sort(Comparator.comparingLong(c -> c.damage));
|
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
|
// Calculate raidboss points
|
||||||
if (_isRaid && !_isRaidMinion)
|
if (_isRaid && !_isRaidMinion)
|
||||||
|
|||||||
+2
-2
@@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
|
||||||
if (skills.size() > 0)
|
if (!skills.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION));
|
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);
|
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));
|
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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();
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
// Check inventory capacity
|
// 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(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket
|
|||||||
packet.writeC(skill.getGetLevel());
|
packet.writeC(skill.getGetLevel());
|
||||||
packet.writeC(0x00); // Skill dual class level.
|
packet.writeC(0x00); // Skill dual class level.
|
||||||
packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01);
|
packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01);
|
||||||
if (skill.getRequiredItems().size() > 0)
|
if (!skill.getRequiredItems().isEmpty())
|
||||||
{
|
{
|
||||||
for (ItemHolder item : skill.getRequiredItems())
|
for (ItemHolder item : skill.getRequiredItems())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI
|
|||||||
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId()))
|
||||||
{
|
{
|
||||||
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
final MonsterInstance leader = ((MonsterInstance) npc).getLeader();
|
||||||
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().size() == 0) && !leader.isDead())
|
if ((leader != null) && (leader.getMinionList().getSpawnedMinions().isEmpty()) && !leader.isDead())
|
||||||
{
|
{
|
||||||
makeMortal(leader);
|
makeMortal(leader);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user