diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 0169abee36..1079fcef12 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -454,7 +454,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) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java index d52223304a..54254930a5 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java index d52223304a..54254930a5 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java index d52223304a..54254930a5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 02a5f9e090..3612c1ce7e 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 02a5f9e090..3612c1ce7e 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 02a5f9e090..3612c1ce7e 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 01005b400b..6f697dd5ea 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2214c9bd1e..fc58442fb2 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 0add827fc5..ddf9aa797b 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } @@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 16a3d7ea11..a58b178018 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index 354e5581f7..2cc486dc57 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index 25752d4d82..c4aa3b9517 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -66,7 +66,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { switch (_tabId) { @@ -83,7 +83,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(player.getString("clanName")); // clan name packet.writeD(id); // rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -137,7 +137,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(plr.getString("name")); packet.writeString(plr.getString("clanName")); packet.writeD(id2); - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id3 : _snapshotList.keySet()) { @@ -196,7 +196,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(player.getString("name")); packet.writeString(player.getString("clanName")); packet.writeD(i); // class rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { final Map snapshotRaceList = new ConcurrentHashMap<>(); int j = 1; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index f95d15ed43..5b3ab8b82c 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 3b04e9621b..f3fe967a48 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -60,7 +60,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeC(_scope); packet.writeD(_race); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { switch (_group) { @@ -80,7 +80,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -128,7 +128,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(plr.getInt("race")); packet.writeD(id2); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id3 : _snapshotList.keySet()) { @@ -177,7 +177,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(i); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { final Map snapshotRaceList = new ConcurrentHashMap<>(); int j = 1; @@ -289,7 +289,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // clan rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -316,7 +316,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket } case 3: // friend { - if (_player.getFriendList().size() > 0) + if (!_player.getFriendList().isEmpty()) { final Set friendList = ConcurrentHashMap.newKeySet(); int count = 1; @@ -347,7 +347,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // friend rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -384,7 +384,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_player.getBaseClass()); packet.writeD(_player.getRace().ordinal()); packet.writeD(1); // clan rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id : _snapshotList.keySet()) { diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2214c9bd1e..fc58442fb2 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 0add827fc5..ddf9aa797b 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } @@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 16a3d7ea11..a58b178018 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index eca4b28aab..a63178770a 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index b2c872dfa4..e79e1402c4 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId]; 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.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java index 877bbc2183..bc5ca191f4 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java @@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket packet.writeC(_tabId); packet.writeC(_type); packet.writeD(_race); - if ((_playerList.size() > 0) && (_type != 255) && (_race != 255)) + if (!_playerList.isEmpty() && (_type != 255) && (_race != 255)) { final RankingCategory category = RankingCategory.values()[_tabId]; 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("classId")); packet.writeQ(player.getInt("points")); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) { diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java index 9915d28887..635516d5aa 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java @@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { boolean found = false; for (Integer id : _playerList.keySet()) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index cda6d7ac17..d9d4657e6a 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 34eca5abec..ffc8512b4f 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -66,7 +66,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_ordinal); packet.writeD(_player.getClassId().getId()); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingCategory category = RankingCategory.values()[_group]; writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope)); @@ -159,7 +159,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2214c9bd1e..fc58442fb2 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -446,7 +446,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) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 0add827fc5..ddf9aa797b 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -388,7 +388,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } @@ -438,7 +438,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 16a3d7ea11..a58b178018 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index eca4b28aab..a63178770a 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index b2c872dfa4..e79e1402c4 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId]; 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.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java index 877bbc2183..bc5ca191f4 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java @@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket packet.writeC(_tabId); packet.writeC(_type); packet.writeD(_race); - if ((_playerList.size() > 0) && (_type != 255) && (_race != 255)) + if (!_playerList.isEmpty() && (_type != 255) && (_race != 255)) { final RankingCategory category = RankingCategory.values()[_tabId]; 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("classId")); packet.writeQ(player.getInt("points")); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) { diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java index 9915d28887..635516d5aa 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java @@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { boolean found = false; for (Integer id : _playerList.keySet()) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index cda6d7ac17..d9d4657e6a 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 34eca5abec..ffc8512b4f 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -66,7 +66,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_ordinal); packet.writeD(_player.getClassId().getId()); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingCategory category = RankingCategory.values()[_group]; writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope)); @@ -159,7 +159,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java index 85c63bdb50..9290d72372 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java @@ -378,7 +378,7 @@ public class GameServer printSection("Quests"); if (!Config.ALT_DEV_NO_QUESTS) { - if (QuestManager.getInstance().getQuests().size() == 0) + if (QuestManager.getInstance().getQuests().isEmpty()) { QuestManager.getInstance().reloadAllQuests(); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java index 5a68e51562..e121c40c33 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -330,7 +330,7 @@ public class AttackableAI extends CreatureAI final Attackable npc = getActiveChar(); // 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; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java index 7ef3eddcfe..7bfd77ba43 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java @@ -218,7 +218,7 @@ public class FortSiegeGuardAI extends CreatureAI implements Runnable final Attackable npc = (Attackable) _actor; // 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; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java index 4c3737a040..53223e367b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java @@ -168,7 +168,7 @@ public class SiegeGuardAI extends CreatureAI implements Runnable final Attackable npc = (Attackable) _actor; // 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; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java index fc91338a2e..1f7eef2911 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java @@ -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); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java index 7f4c0e7cc4..ca299627e2 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java @@ -525,7 +525,7 @@ public class PetitionManager { final StringBuilder htmlContent = new StringBuilder("
Current Petitions
"); final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z"); - if (_pendingPetitions.size() == 0) + if (_pendingPetitions.isEmpty()) { htmlContent.append(""); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/MobGroup.java index bb0960365b..c08a6fdd6f 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/MobGroup.java @@ -201,7 +201,7 @@ public class MobGroup { removeDead(); - if (getMobs().size() == 0) + if (getMobs().isEmpty()) { return null; } @@ -214,7 +214,7 @@ public class MobGroup { removeDead(); - if (getMobs().size() == 0) + if (getMobs().isEmpty()) { return; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java index a1dddd8e11..8752719f9b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -6649,7 +6649,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder } } - if (_chanceSkills.size() == 0) + if (_chanceSkills.isEmpty()) { _chanceSkills = null; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java index f996a62689..f543f25906 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java @@ -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("

Item(s) required for class change:"); sb.append("
There are no currently pending petitions.
"); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index ed3aabbf95..144023972d 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -9799,7 +9799,7 @@ public class PlayerInstance extends Playable } // 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); return; @@ -10570,7 +10570,7 @@ public class PlayerInstance extends Playable public void unsummonAllCubics() { // Unsummon Cubics - if (_cubics.size() > 0) + if (!_cubics.isEmpty()) { for (CubicInstance cubic : _cubics.values()) { @@ -10691,7 +10691,7 @@ public class PlayerInstance extends Playable { ItemInstance item; IItemHandler handler; - if ((_activeSoulShots == null) || (_activeSoulShots.size() == 0)) + if ((_activeSoulShots == null) || (_activeSoulShots.isEmpty())) { return; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java index 837500b160..6990818243 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java @@ -171,7 +171,7 @@ public class WarehouseInstance extends FolkInstance private void showDepositWindowFreight(PlayerInstance 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); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index a094699eb3..bc7e7395a1 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -65,10 +65,10 @@ public class CreatureStat } 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 ((c == null) || (c.size() == 0)) + if ((calc == null) || (calc.size() == 0)) { return init; } @@ -82,7 +82,7 @@ public class CreatureStat env.baseValue = init; // Launch the calculation - c.calc(env); + calc.calc(env); // avoid some troubles with negative stats (some stats should never be negative) if (env.value <= 0) { diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java index d45649d774..8603355011 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java @@ -76,7 +76,7 @@ public class BanditStrongholdSiege extends ClanHallSiege public void startSiege() { setRegistrationPeriod(false); - if (_clansInfo.size() == 0) + if (_clansInfo.isEmpty()) { endSiege(false); return; diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java index 50671993e2..bb7e2c5246 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java @@ -73,7 +73,7 @@ public class WildBeastFarmSiege extends ClanHallSiege public void startSiege() { setRegistrationPeriod(false); - if (_clansInfo.size() == 0) + if (_clansInfo.isEmpty()) { endSiege(false); return; diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java index 8c61bedcfd..51a559924b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java @@ -62,17 +62,14 @@ public class FriendList implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.FRIEND_LIST.writeId(packet); - if (_info.size() > 0) + packet.writeH(_info.size()); + for (FriendInfo friend : _info) { - packet.writeH(_info.size()); - for (FriendInfo friend : _info) - { - packet.writeH(0); // ?? - packet.writeD(friend._objId); - packet.writeS(friend._name); - packet.writeD(friend._online ? 0x01 : 0x00); - packet.writeH(0); // ?? - } + packet.writeH(0); // ?? + packet.writeD(friend._objId); + packet.writeS(friend._name); + packet.writeD(friend._online ? 0x01 : 0x00); + packet.writeH(0); // ?? } return true; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java index 2d77e036c9..3491b77692 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -390,7 +390,7 @@ public class GameServer printSection("Quests"); if (!Config.ALT_DEV_NO_QUESTS) { - if (QuestManager.getInstance().getQuests().size() == 0) + if (QuestManager.getInstance().getQuests().isEmpty()) { QuestManager.getInstance().reloadAllQuests(); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java index 5a68e51562..e121c40c33 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -330,7 +330,7 @@ public class AttackableAI extends CreatureAI final Attackable npc = getActiveChar(); // 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; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java index 7ef3eddcfe..7bfd77ba43 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/FortSiegeGuardAI.java @@ -218,7 +218,7 @@ public class FortSiegeGuardAI extends CreatureAI implements Runnable final Attackable npc = (Attackable) _actor; // 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; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java index 4c3737a040..53223e367b 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/SiegeGuardAI.java @@ -168,7 +168,7 @@ public class SiegeGuardAI extends CreatureAI implements Runnable final Attackable npc = (Attackable) _actor; // 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; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java index fc91338a2e..1f7eef2911 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Disablers.java @@ -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); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java index 7f4c0e7cc4..ca299627e2 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java @@ -525,7 +525,7 @@ public class PetitionManager { final StringBuilder htmlContent = new StringBuilder("
Current Petitions
"); final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z"); - if (_pendingPetitions.size() == 0) + if (_pendingPetitions.isEmpty()) { htmlContent.append(""); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/MobGroup.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/MobGroup.java index bb0960365b..c08a6fdd6f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/MobGroup.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/MobGroup.java @@ -201,7 +201,7 @@ public class MobGroup { removeDead(); - if (getMobs().size() == 0) + if (getMobs().isEmpty()) { return null; } @@ -214,7 +214,7 @@ public class MobGroup { removeDead(); - if (getMobs().size() == 0) + if (getMobs().isEmpty()) { return; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0d5e384d11..8ad26c6a68 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -6696,7 +6696,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder } } - if (_chanceSkills.size() == 0) + if (_chanceSkills.isEmpty()) { _chanceSkills = null; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java index f996a62689..f543f25906 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClassMasterInstance.java @@ -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("

Item(s) required for class change:"); sb.append("
There are no currently pending petitions.
"); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 2f5f63726c..f05ca815de 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -9961,7 +9961,7 @@ public class PlayerInstance extends Playable } // 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); return; @@ -10742,7 +10742,7 @@ public class PlayerInstance extends Playable public void unsummonAllCubics() { // Unsummon Cubics - if (_cubics.size() > 0) + if (!_cubics.isEmpty()) { for (CubicInstance cubic : _cubics.values()) { @@ -10863,7 +10863,7 @@ public class PlayerInstance extends Playable { ItemInstance item; IItemHandler handler; - if ((_activeSoulShots == null) || (_activeSoulShots.size() == 0)) + if ((_activeSoulShots == null) || (_activeSoulShots.isEmpty())) { return; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java index 837500b160..6990818243 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/WarehouseInstance.java @@ -171,7 +171,7 @@ public class WarehouseInstance extends FolkInstance private void showDepositWindowFreight(PlayerInstance 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); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index a094699eb3..bc7e7395a1 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -65,10 +65,10 @@ public class CreatureStat } 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 ((c == null) || (c.size() == 0)) + if ((calc == null) || (calc.size() == 0)) { return init; } @@ -82,7 +82,7 @@ public class CreatureStat env.baseValue = init; // Launch the calculation - c.calc(env); + calc.calc(env); // avoid some troubles with negative stats (some stats should never be negative) if (env.value <= 0) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java index d45649d774..8603355011 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/BanditStrongholdSiege.java @@ -76,7 +76,7 @@ public class BanditStrongholdSiege extends ClanHallSiege public void startSiege() { setRegistrationPeriod(false); - if (_clansInfo.size() == 0) + if (_clansInfo.isEmpty()) { endSiege(false); return; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java index 50671993e2..bb7e2c5246 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/siege/clanhalls/WildBeastFarmSiege.java @@ -73,7 +73,7 @@ public class WildBeastFarmSiege extends ClanHallSiege public void startSiege() { setRegistrationPeriod(false); - if (_clansInfo.size() == 0) + if (_clansInfo.isEmpty()) { endSiege(false); return; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java index f1479703ea..71644a2858 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FriendList.java @@ -63,12 +63,12 @@ public class FriendList implements IClientOutgoingPacket { OutgoingPackets.FRIEND_LIST.writeId(packet); packet.writeD(_info.size()); - for (FriendInfo info : _info) + for (FriendInfo friend : _info) { - packet.writeD(info._objId); - packet.writeS(info._name); - packet.writeD(info._online ? 0x01 : 0x00); - packet.writeD(info._online ? info._objId : 0x00); + packet.writeD(friend._objId); + packet.writeS(friend._name); + packet.writeD(friend._online ? 0x01 : 0x00); + packet.writeD(friend._online ? friend._objId : 0x00); } return true; } diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java index b5bf8d4aa0..c3745505f3 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java @@ -562,7 +562,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine @Override public void onSiegeEnds() { - if (_data.size() > 0) + if (!_data.isEmpty()) { for (int clanId : _data.keySet()) { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ff6261dea1..a08bdc467f 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -476,7 +476,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; // Manage Base, Quests and Sweep drops of the Attackable if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage)) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index 808f9c9814..3dd6906b79 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -86,10 +86,10 @@ public class CreatureStat } 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 ((c == null) || (c.size() == 0)) + if ((calc == null) || (calc.size() == 0)) { return value; } @@ -106,7 +106,7 @@ public class CreatureStat } // 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) if (value <= 0) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java index 225985b031..3794df998d 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java @@ -121,7 +121,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable ps.setInt(1, _hall.getId()); ps.execute(); - if (_attackers.size() > 0) + if (!_attackers.isEmpty()) { try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS)) { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java index 5eb4ff452e..5907113925 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java @@ -43,7 +43,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket packet.writeS(_player.getName()); final List questList = _player.getAllActiveQuests(); - if (questList.size() == 0) + if (questList.isEmpty()) { packet.writeC(0); packet.writeH(0); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java index b5bf8d4aa0..c3745505f3 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java @@ -562,7 +562,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine @Override public void onSiegeEnds() { - if (_data.size() > 0) + if (!_data.isEmpty()) { for (int clanId : _data.keySet()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ff6261dea1..a08bdc467f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -476,7 +476,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; // Manage Base, Quests and Sweep drops of the Attackable if ((mostDamageParty != null) && (mostDamageParty.damage > maxDamage)) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index 808f9c9814..3dd6906b79 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -86,10 +86,10 @@ public class CreatureStat } 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 ((c == null) || (c.size() == 0)) + if ((calc == null) || (calc.size() == 0)) { return value; } @@ -106,7 +106,7 @@ public class CreatureStat } // 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) if (value <= 0) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java index 225985b031..3794df998d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/siege/clanhalls/ClanHallSiegeEngine.java @@ -121,7 +121,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable ps.setInt(1, _hall.getId()); ps.execute(); - if (_attackers.size() > 0) + if (!_attackers.isEmpty()) { try (PreparedStatement insert = con.prepareStatement(SQL_SAVE_ATTACKERS)) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java index 5eb4ff452e..5907113925 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java @@ -43,7 +43,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket packet.writeS(_player.getName()); final List questList = _player.getAllActiveQuests(); - if (questList.size() == 0) + if (questList.isEmpty()) { packet.writeC(0); packet.writeH(0); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index 0af94344aa..a36a5c0f0d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java index dd182a0c09..2a20807932 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index d9e611cedd..aa58bff09b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 4400b00e5b..f468da30a8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index 0af94344aa..a36a5c0f0d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java index dd182a0c09..2a20807932 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index d9e611cedd..aa58bff09b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 4400b00e5b..f468da30a8 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index 0af94344aa..a36a5c0f0d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java index dd182a0c09..2a20807932 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -447,7 +447,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) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index abd10faa2f..187648db8c 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index 0af94344aa..a36a5c0f0d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ac15805d30..fce325aae2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -449,7 +449,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) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 81dff2e2bb..96118ab0b7 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index 0af94344aa..a36a5c0f0d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -179,7 +179,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ac15805d30..fce325aae2 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -449,7 +449,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) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 81dff2e2bb..96118ab0b7 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index eeda2befc4..43d5926f31 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -181,7 +181,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ac15805d30..fce325aae2 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -449,7 +449,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) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 199d279184..d72a13de82 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -396,7 +396,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while not being level 85 or awaken!", IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : REVELATION_VAR_NAMES) { if * (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " * + _level + " while having already learned 2 skills!", IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? REVELATION_VAR_NAMES[0] : REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); - * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else + * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else * { player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } */ return; @@ -410,7 +410,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : DUALCLASS_REVELATION_VAR_NAMES) { if (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { * player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while having already learned 2 skills!", * IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? DUALCLASS_REVELATION_VAR_NAMES[0] : DUALCLASS_REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); giveSkill(player, trainer, skill); - * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { + * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { * player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } break; */ return; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index 354e5581f7..2cc486dc57 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index 25752d4d82..c4aa3b9517 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -66,7 +66,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { switch (_tabId) { @@ -83,7 +83,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(player.getString("clanName")); // clan name packet.writeD(id); // rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -137,7 +137,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(plr.getString("name")); packet.writeString(plr.getString("clanName")); packet.writeD(id2); - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id3 : _snapshotList.keySet()) { @@ -196,7 +196,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeString(player.getString("name")); packet.writeString(player.getString("clanName")); packet.writeD(i); // class rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { final Map snapshotRaceList = new ConcurrentHashMap<>(); int j = 1; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index f95d15ed43..5b3ab8b82c 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 3b04e9621b..f3fe967a48 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -60,7 +60,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeC(_scope); packet.writeD(_race); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { switch (_group) { @@ -80,7 +80,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -128,7 +128,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(plr.getInt("race")); packet.writeD(id2); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id3 : _snapshotList.keySet()) { @@ -177,7 +177,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(i); // server rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { final Map snapshotRaceList = new ConcurrentHashMap<>(); int j = 1; @@ -289,7 +289,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // clan rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -316,7 +316,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket } case 3: // friend { - if (_player.getFriendList().size() > 0) + if (!_player.getFriendList().isEmpty()) { final Set friendList = ConcurrentHashMap.newKeySet(); int count = 1; @@ -347,7 +347,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(id); // friend rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id2 : _snapshotList.keySet()) { @@ -384,7 +384,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_player.getBaseClass()); packet.writeD(_player.getRace().ordinal()); packet.writeD(1); // clan rank - if (_snapshotList.size() > 0) + if (!_snapshotList.isEmpty()) { for (Integer id : _snapshotList.keySet()) { diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index d9e17218f3..de08d94459 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index d9e611cedd..aa58bff09b 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket } final List 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 skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); - if (skills.size() > 0) + if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 4400b00e5b..f468da30a8 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -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()) { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index eeda2befc4..43d5926f31 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -181,7 +181,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 2604da8df0..2ee043355a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -450,7 +450,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) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index cb0eea8bec..d7559b2d47 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -396,7 +396,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while not being level 85 or awaken!", IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : REVELATION_VAR_NAMES) { if * (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " * + _level + " while having already learned 2 skills!", IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? REVELATION_VAR_NAMES[0] : REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); - * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else + * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else * { player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } */ return; @@ -410,7 +410,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : DUALCLASS_REVELATION_VAR_NAMES) { if (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { * player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while having already learned 2 skills!", * IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? DUALCLASS_REVELATION_VAR_NAMES[0] : DUALCLASS_REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); giveSkill(player, trainer, skill); - * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { + * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { * player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } break; */ return; diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index c3cfb6e86c..9adbcb0fb7 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index eca4b28aab..a63178770a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index b2c872dfa4..e79e1402c4 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId]; 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.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java index 877bbc2183..bc5ca191f4 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java @@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket packet.writeC(_tabId); packet.writeC(_type); packet.writeD(_race); - if ((_playerList.size() > 0) && (_type != 255) && (_race != 255)) + if (!_playerList.isEmpty() && (_type != 255) && (_race != 255)) { final RankingCategory category = RankingCategory.values()[_tabId]; 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("classId")); packet.writeQ(player.getInt("points")); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java index 9915d28887..635516d5aa 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java @@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { boolean found = false; for (Integer id : _playerList.keySet()) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index cda6d7ac17..d9d4657e6a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 3c8b448b3b..065e7b3790 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -65,7 +65,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_ordinal); packet.writeD(_player.getClassId().getId()); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingCategory category = RankingCategory.values()[_group]; writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope)); @@ -152,7 +152,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java index eeda2befc4..43d5926f31 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/ai/areas/TowerOfInsolence/EnergyOfInsolence.java @@ -181,7 +181,7 @@ public class EnergyOfInsolence extends AbstractNpcAI if (CommonUtil.contains(ENERGY_OF_INSOLENCE_MINIONS, npc.getId())) { 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); } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Attackable.java index e37e8a8827..9e1730eed8 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -455,7 +455,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) diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index cb0eea8bec..d7559b2d47 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -396,7 +396,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while not being level 85 or awaken!", IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : REVELATION_VAR_NAMES) { if * (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " * + _level + " while having already learned 2 skills!", IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? REVELATION_VAR_NAMES[0] : REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); - * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else + * giveSkill(player, trainer, skill); } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); } else * { player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } */ return; @@ -410,7 +410,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket * IllegalActionPunishmentType.NONE); return; } int count = 0; for (String varName : DUALCLASS_REVELATION_VAR_NAMES) { if (player.getVariables().getInt(varName, 0) > 0) { count++; } } if (count >= 2) { * player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_ITEMS_TO_LEARN_THIS_SKILL); Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " is requesting skill Id: " + _id + " level " + _level + " while having already learned 2 skills!", * IllegalActionPunishmentType.NONE); return; } if (checkPlayerSkill(player, trainer, s)) { final String varName = count == 0 ? DUALCLASS_REVELATION_VAR_NAMES[0] : DUALCLASS_REVELATION_VAR_NAMES[1]; player.getVariables().set(varName, skill.getId()); giveSkill(player, trainer, skill); - * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (skills.size() > 0) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { + * } final List skills = SkillTreesData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); if (!skills.isEmpty()) { player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); } else { * player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } break; */ return; diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java index 1622f7deb5..fb0701f385 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/luckygame/RequestLuckyGamePlay.java @@ -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); diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java index 105a4354d0..6e168c5eab 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/AcquireSkillList.java @@ -67,7 +67,7 @@ public class AcquireSkillList implements IClientOutgoingPacket packet.writeC(skill.getGetLevel()); packet.writeC(0x00); // Skill dual class level. packet.writeC(_player.getKnownSkill(skill.getSkillId()) != null ? 0x00 : 0x01); - if (skill.getRequiredItems().size() > 0) + if (!skill.getRequiredItems().isEmpty()) { for (ItemHolder item : skill.getRequiredItems()) { diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java index eca4b28aab..a63178770a 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadHeroAndLegendInfo.java @@ -47,7 +47,7 @@ public class ExOlympiadHeroAndLegendInfo implements IClientOutgoingPacket { 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(); PreparedStatement statement = con.prepareStatement(GET_HEROES)) diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java index b2c872dfa4..e79e1402c4 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExOlympiadRankingInfo.java @@ -72,7 +72,7 @@ public class ExOlympiadRankingInfo implements IClientOutgoingPacket packet.writeD(_serverId); // 0 - all servers, server id - for caller server packet.writeD(933); // unk, 933 all time - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingOlympiadCategory category = RankingOlympiadCategory.values()[_tabId]; 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.writeD(scope == RankingOlympiadScope.SELF ? data.getKey() : curRank); // rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPetRankingList.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPetRankingList.java index 739b146112..bb9f2dd35d 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPetRankingList.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPetRankingList.java @@ -67,7 +67,7 @@ public class ExPetRankingList implements IClientOutgoingPacket packet.writeD(_race); packet.writeC(0); - if ((_playerList.size() > 0) && (_type != 255) && (_race != 255)) + if (!_playerList.isEmpty() && (_type != 255) && (_race != 255)) { final RankingCategory category = RankingCategory.values()[_season]; writeFilteredRankingData(packet, category, category.getScopeByGroup(_tabId)); @@ -157,7 +157,7 @@ public class ExPetRankingList implements IClientOutgoingPacket packet.writeH(3); packet.writeH(player.getInt("level")); packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) { diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPledgeRankingList.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPledgeRankingList.java index f0a6599b43..daf7110d99 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPledgeRankingList.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPledgeRankingList.java @@ -54,7 +54,7 @@ public class ExPledgeRankingList implements IClientOutgoingPacket { OutgoingPackets.EX_PLEDGE_RANKING_LIST.writeId(packet); packet.writeC(_category); - if (_rankingClanList.size() > 0) + if (!_rankingClanList.isEmpty()) { writeScopeData(packet, _category == 0, new ArrayList<>(_rankingClanList.entrySet()), new ArrayList<>(_snapshotClanList.entrySet())); } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java index 877bbc2183..bc5ca191f4 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingList.java @@ -65,7 +65,7 @@ public class ExPvpRankingList implements IClientOutgoingPacket packet.writeC(_tabId); packet.writeC(_type); packet.writeD(_race); - if ((_playerList.size() > 0) && (_type != 255) && (_race != 255)) + if (!_playerList.isEmpty() && (_type != 255) && (_race != 255)) { final RankingCategory category = RankingCategory.values()[_tabId]; 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("classId")); packet.writeQ(player.getInt("points")); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList())) { diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java index 9915d28887..635516d5aa 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExPvpRankingMyInfo.java @@ -46,7 +46,7 @@ public class ExPvpRankingMyInfo implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_PVP_RANKING_MY_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { boolean found = false; for (Integer id : _playerList.keySet()) diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java index cda6d7ac17..d9d4657e6a 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharInfo.java @@ -49,7 +49,7 @@ public class ExRankingCharInfo implements IClientOutgoingPacket { OutgoingPackets.EX_RANKING_CHAR_INFO.writeId(packet); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { for (Integer id : _playerList.keySet()) { diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java index 3c8b448b3b..065e7b3790 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/ranking/ExRankingCharRankers.java @@ -65,7 +65,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(_ordinal); packet.writeD(_player.getClassId().getId()); - if (_playerList.size() > 0) + if (!_playerList.isEmpty()) { final RankingCategory category = RankingCategory.values()[_group]; writeFilteredRankingData(packet, category, category.getScopeByGroup(_scope)); @@ -152,7 +152,7 @@ public class ExRankingCharRankers implements IClientOutgoingPacket packet.writeD(player.getInt("classId")); packet.writeD(player.getInt("race")); packet.writeD(scope == RankingScope.SELF ? data.getKey() : curRank); // server rank - if (snapshot.size() > 0) + if (!snapshot.isEmpty()) { int snapshotRank = 1; for (Entry ssData : snapshot.stream().sorted(Entry.comparingByKey()).collect(Collectors.toList()))