Use of isEmpty method when possible.
This commit is contained in:
		| @@ -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); | ||||
| 			} | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -436,7 +436,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket | ||||
| 				} | ||||
| 				 | ||||
| 				final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS); | ||||
| 				if (skills.size() > 0) | ||||
| 				if (!skills.isEmpty()) | ||||
| 				{ | ||||
| 					player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION)); | ||||
| 				} | ||||
| @@ -486,7 +486,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket | ||||
| 				} | ||||
| 				 | ||||
| 				final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS); | ||||
| 				if (skills.size() > 0) | ||||
| 				if (!skills.isEmpty()) | ||||
| 				{ | ||||
| 					player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.REVELATION_DUALCLASS)); | ||||
| 				} | ||||
|   | ||||
| @@ -129,7 +129,7 @@ public class RequestLuckyGamePlay implements IClientIncomingPacket | ||||
| 		final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum(); | ||||
| 		 | ||||
| 		// Check inventory capacity | ||||
| 		if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight))) | ||||
| 		if (!rewards.isEmpty() && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight))) | ||||
| 		{ | ||||
| 			player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY); | ||||
| 			player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT); | ||||
|   | ||||
| @@ -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()) | ||||
| 				{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment