Code review Part 3.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
@@ -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]);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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 =
|
||||
{
|
||||
|
@@ -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 =
|
||||
{
|
||||
|
@@ -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"
|
||||
|
@@ -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))
|
||||
|
@@ -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 =
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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 =
|
||||
{
|
||||
|
@@ -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());
|
||||
|
@@ -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))
|
||||
{
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user