Code review Part 3.

This commit is contained in:
MobiusDevelopment
2019-12-20 00:35:40 +00:00
parent 6954f58f5e
commit cd1f62cc68
2014 changed files with 9456 additions and 12142 deletions

View File

@@ -110,7 +110,7 @@ public class Nottingale extends AbstractNpcAI
case "32627-09.html":
case "32627-10.html":
{
player.sendPacket(RADARS.get(Integer.valueOf(event.substring(6, 8))));
player.sendPacket(RADARS.get(Integer.parseInt(event.substring(6, 8))));
htmltext = event;
break;
}

View File

@@ -161,7 +161,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
final String[] params = event.split(" ");
if (Util.isDigit(params[1]))
{
final int objectId = Integer.valueOf(params[1]);
final int objectId = Integer.parseInt(params[1]);
MentorManager.getInstance().getMentees(objectId).stream().filter(Objects::nonNull).filter(Mentee::isOnline).forEach(mentee ->
{
final PlayerInstance menteePlayer = mentee.getPlayerInstance();

View File

@@ -241,7 +241,7 @@ public class Race extends Event
}
else
{
final int _number = Integer.valueOf(bypass.substring(5));
final int _number = Integer.parseInt(bypass.substring(5));
final Skill _sk = SkillData.getInstance().getSkill(_number, 1);
if (_sk != null)
{
@@ -258,7 +258,7 @@ public class Race extends Event
}
else if (bypass.startsWith("tele"))
{
if ((Integer.valueOf(bypass.substring(4)) > 0) && (_randspawn != null))
if ((Integer.parseInt(bypass.substring(4)) > 0) && (_randspawn != null))
{
player.teleToLocation(_randspawn[0], _randspawn[1], _randspawn[2]);
}

View File

@@ -256,17 +256,17 @@ public class AdminAdmin implements IAdminCommandHandler
{
case "RateXp":
{
Config.RATE_XP = Float.valueOf(pValue);
Config.RATE_XP = Float.parseFloat(pValue);
break;
}
case "RateSp":
{
Config.RATE_SP = Float.valueOf(pValue);
Config.RATE_SP = Float.parseFloat(pValue);
break;
}
case "RateDropSpoil":
{
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.parseFloat(pValue);
break;
}
}

View File

@@ -454,7 +454,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
page = Integer.valueOf(token);
page = Integer.parseInt(token);
}
}

View File

@@ -56,7 +56,7 @@ public class AdminClanHall implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " ");
final String actualCommand = st.nextToken();
if (actualCommand.toLowerCase().equals("admin_clanhall"))
if (actualCommand.equalsIgnoreCase("admin_clanhall"))
{
processBypass(activeChar, new BypassParser(command));
}

View File

@@ -67,7 +67,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEditChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEnchant implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminHeal implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final String[] ADMIN_COMMANDS =
{
"admin_heal"

View File

@@ -70,7 +70,7 @@ public class AdminPcCondOverride implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.valueOf(token));
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.parseInt(token));
if (ex != null)
{
if (activeChar.canOverrideCond(ex))

View File

@@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class AdminRepairChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@@ -50,7 +50,7 @@ public class AdminShutdown implements IAdminCommandHandler
final String val = command.substring(22);
if (Util.isDigit(val))
{
serverShutdown(activeChar, Integer.valueOf(val), false);
serverShutdown(activeChar, Integer.parseInt(val), false);
}
else
{

View File

@@ -60,7 +60,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminSkill implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@@ -127,7 +127,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@@ -147,7 +147,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@@ -172,7 +172,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (In Progress)" : "<fstring>" + quest.getNpcStringId() + "02</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "02"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "02"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@@ -192,7 +192,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (Done) " : "<fstring>" + quest.getNpcStringId() + "03</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "03"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "03"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());

View File

@@ -80,7 +80,7 @@ public class PetFood implements IItemHandler
if (player.isMounted())
{
final List<Integer> foodIds = PetDataTable.getInstance().getPetData(player.getMountNpcId()).getFood();
if (foodIds.contains(Integer.valueOf(item.getId())))
if (foodIds.contains(item.getId()))
{
if (player.destroyItem("Consume", item.getObjectId(), 1, null, false))
{

View File

@@ -135,7 +135,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-04.html";
break;
@@ -147,7 +147,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-03.html";
break;

View File

@@ -131,7 +131,7 @@ public class Q10287_StoryOfThoseLeft extends Quest
{
if (qs.isMemoState(2))
{
rewardItems(player, Integer.valueOf(event), 1);
rewardItems(player, Integer.parseInt(event), 1);
htmltext = "32020-09.html";
qs.exitQuest(false, true);
}