Removed unnecessary Long literals.

This commit is contained in:
MobiusDev
2018-06-21 09:59:45 +00:00
parent e7504cea28
commit fd6b72dab6
294 changed files with 643 additions and 643 deletions

View File

@ -44,7 +44,7 @@ public class WarehouseCacheManager
private WarehouseCacheManager()
{
_cacheTime = Config.WAREHOUSE_CACHE_TIME * 60000L; // 60*1000 = 60000
_cacheTime = Config.WAREHOUSE_CACHE_TIME * 60000; // 60*1000 = 60000
_cachedWh = new ConcurrentHashMap<>();
ThreadPool.scheduleAtFixedRate(new CacheScheduler(), 120000, 60000);
}

View File

@ -544,7 +544,7 @@ public class MailBBSManager extends BaseBBSManager
final long currentDate = Calendar.getInstance().getTimeInMillis();
// Get the current time - 1 day under timestamp format.
final Timestamp ts = new Timestamp(currentDate - 86400000L);
final Timestamp ts = new Timestamp(currentDate - 86400000);
// Check sender mails based on previous timestamp. If more than 10 mails have been found for today, then cancel the use.
if (getPlayerMails(activeChar.getObjectId()).stream().filter(l -> l.sentDate.after(ts) && (l.location == MailType.SENTBOX)).count() >= 10)

View File

@ -295,7 +295,7 @@ public class AdminBan implements IAdminCommandHandler
if (ban)
{
level = L2PcInstance.PunishLevel.CHAT.value();
value = (delay > 0 ? delay * 60000L : 60000);
value = (delay > 0 ? delay * 60000 : 60000);
}
else
{
@ -346,7 +346,7 @@ public class AdminBan implements IAdminCommandHandler
statement.setInt(2, -249645);
statement.setInt(3, -2984);
statement.setInt(4, L2PcInstance.PunishLevel.JAIL.value());
statement.setLong(5, (delay > 0 ? delay * 60000L : 0));
statement.setLong(5, (delay > 0 ? delay * 60000 : 0));
statement.setString(6, name);
statement.execute();

View File

@ -242,7 +242,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
else
{
// end time is equal to dropped one
final long endTime = System.currentTimeMillis() + (cursedWeapon.getDuration() * 60000L);
final long endTime = System.currentTimeMillis() + (cursedWeapon.getDuration() * 60000);
cursedWeapon.setEndTime(endTime);
final L2Object target = activeChar.getTarget();

View File

@ -64,7 +64,7 @@ public class HeroCustomItem implements IItemHandler
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
activeChar.setHero(true);
updateDatabase(activeChar, Config.HERO_CUSTOM_DAY * 24L * 60L * 60L * 1000L);
updateDatabase(activeChar, Config.HERO_CUSTOM_DAY * 24 * 60 * 60 * 1000);
activeChar.sendMessage("You Are Now a Hero,You Are Granted With Hero Status , Skills ,Aura.");
activeChar.broadcastUserInfo();
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);

View File

@ -152,7 +152,7 @@ public class RaidBossSpawnManager
final StatsSet info = new StatsSet();
info.set("currentHP", raidboss.getCurrentHp());
info.set("currentMP", raidboss.getCurrentMp());
info.set("respawnTime", 0L);
info.set("respawnTime", 0);
_storedInfo.put(bossId, info);
@ -217,7 +217,7 @@ public class RaidBossSpawnManager
info.set("currentHP", boss.getCurrentHp());
info.set("currentMP", boss.getCurrentMp());
info.set("respawnTime", 0L);
info.set("respawnTime", 0);
}
_storedInfo.put(boss.getNpcId(), info);
}
@ -242,7 +242,7 @@ public class RaidBossSpawnManager
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
if ((respawnTime == 0L) || (time > respawnTime))
if ((respawnTime == 0) || (time > respawnTime))
{
final L2RaidBossInstance raidboss = bossId == 25328 ? DayNightSpawnManager.getInstance().handleBoss(spawnDat) : (L2RaidBossInstance) spawnDat.doSpawn();
if (raidboss != null)
@ -264,7 +264,7 @@ public class RaidBossSpawnManager
final StatsSet info = new StatsSet();
info.set("currentHP", currentHP);
info.set("currentMP", currentMP);
info.set("respawnTime", 0L);
info.set("respawnTime", 0);
_storedInfo.put(bossId, info);
}
@ -509,7 +509,7 @@ public class RaidBossSpawnManager
final StatsSet info = new StatsSet();
info.set("currentHP", raidboss.getCurrentHp());
info.set("currentMP", raidboss.getCurrentMp());
info.set("respawnTime", 0L);
info.set("respawnTime", 0);
raidboss.setRaidStatus(StatusEnum.ALIVE);

View File

@ -31,8 +31,8 @@ public class CharSelectInfoPackage
private int _race = 0;
private int _classId = 0;
private int _baseClassId = 0;
private long _deleteTimer = 0L;
private long _lastAccess = 0L;
private long _deleteTimer = 0;
private long _lastAccess = 0;
private int _face = 0;
private int _hairStyle = 0;
private int _hairColor = 0;

View File

@ -341,7 +341,7 @@ public class CursedWeapon
}
else
{
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
}
}
@ -354,9 +354,9 @@ public class CursedWeapon
dropIt(attackable, player);
// Start the Life Task
_endTime = System.currentTimeMillis() + (_duration * 60000L);
_endTime = System.currentTimeMillis() + (_duration * 60000);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000L, _durationLost * 12000L);
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
return true;
}
@ -524,7 +524,7 @@ public class CursedWeapon
}
// Reduce time-to-live
_endTime -= _durationLost * 60000L;
_endTime -= _durationLost * 60000;
saveData();
}

View File

@ -463,7 +463,7 @@ public class L2Clan
if (player.isClanLeader())
{
SiegeManager.getInstance().removeSiegeSkills(player);
player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000L)); // 24*60*60*1000 = 86400000
player.setClanCreateExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
}
// remove Clan skills from Player
@ -481,7 +481,7 @@ public class L2Clan
}
else
{
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderName().equalsIgnoreCase(name) ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000L) : 0);
removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderName().equalsIgnoreCase(name) ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000) : 0);
}
}
@ -879,7 +879,7 @@ public class L2Clan
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
if ((getCharPenaltyExpiryTime() + (Config.ALT_CLAN_JOIN_DAYS * 86400000L)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
if ((getCharPenaltyExpiryTime() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
{
setCharPenaltyExpiryTime(0);
}
@ -2345,7 +2345,7 @@ public class L2Clan
setAllyId(0);
setAllyName(null);
// 24*60*60*1000 = 86400000
setAllyPenaltyExpiryTime(currentTime + (Config.ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED * 86400000L), PENALTY_TYPE_DISSOLVE_ALLY);
setAllyPenaltyExpiryTime(currentTime + (Config.ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED * 86400000), PENALTY_TYPE_DISSOLVE_ALLY);
updateClanInDB();
// The clan leader should take the XP penalty of a full death.

View File

@ -134,7 +134,7 @@ public final class L2AuctioneerInstance extends L2FolkInstance
bid = Integer.parseInt(st.nextToken());
}
Auction a = new Auction(player.getClan().getHasHideout(), player.getClan(), days * 86400000L, bid, ClanHallManager.getInstance().getClanHallByOwner(player.getClan()).getName());
Auction a = new Auction(player.getClan().getHasHideout(), player.getClan(), days * 86400000, bid, ClanHallManager.getInstance().getClanHallByOwner(player.getClan()).getName());
if (_pendingAuctions.get(a.getId()) != null)
{
_pendingAuctions.remove(a.getId());

View File

@ -14907,7 +14907,7 @@ public final class L2PcInstance extends L2Playable
{
if (_taskRentPet == null)
{
_taskRentPet = ThreadPool.scheduleAtFixedRate(new RentPetTask(), seconds * 1000L, seconds * 1000L);
_taskRentPet = ThreadPool.scheduleAtFixedRate(new RentPetTask(), seconds * 1000, seconds * 1000);
}
}
@ -17506,7 +17506,7 @@ public final class L2PcInstance extends L2Playable
public long getRemaining()
{
return Math.max(stamp - System.currentTimeMillis(), 0L);
return Math.max(stamp - System.currentTimeMillis(), 0);
}
protected boolean hasNotPassed()
@ -18750,7 +18750,7 @@ public final class L2PcInstance extends L2Playable
*/
public void setPunishLevel(PunishLevel state, int delayInMinutes)
{
final long delayInMilliseconds = delayInMinutes * 60000L;
final long delayInMilliseconds = delayInMinutes * 60000;
setPunishLevel(state, delayInMilliseconds);
}

View File

@ -659,7 +659,7 @@ public final class L2VillageMasterInstance extends L2FolkInstance
return;
}
clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000L)); // 24*60*60*1000 = 86400000
clan.setDissolvingExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_DISSOLVE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
ClanTable.getInstance().scheduleRemoveClan(clan.getClanId());

View File

@ -37,7 +37,7 @@ public class DimensionalRift
protected byte _type;
protected L2Party _party;
protected List<Byte> _completedRooms = new ArrayList<>();
private static final long seconds_5 = 5000L;
private static final long seconds_5 = 5000;
protected byte jumps_current = 0;
private Timer teleporterTimer;

View File

@ -860,7 +860,7 @@ public class Olympiad
{
// if (_olympiadEnd > Calendar.getInstance().getTimeInMillis())
return (_olympiadEnd - Calendar.getInstance().getTimeInMillis());
// return 10L;
// return 10;
}
public void manualSelectHeroes()
@ -879,7 +879,7 @@ public class Olympiad
{
return (_validationEnd - Calendar.getInstance().getTimeInMillis());
}
return 10L;
return 10;
}
public boolean isOlympiadEnd()
@ -923,7 +923,7 @@ public class Olympiad
{
if ((_compStart.getTimeInMillis() < Calendar.getInstance().getTimeInMillis()) && (_compEnd > Calendar.getInstance().getTimeInMillis()))
{
return 10L;
return 10;
}
if (_compStart.getTimeInMillis() > Calendar.getInstance().getTimeInMillis())
@ -981,7 +981,7 @@ public class Olympiad
{
// if (_compEnd > Calendar.getInstance().getTimeInMillis())
return (_compEnd - Calendar.getInstance().getTimeInMillis());
// return 10L;
// return 10;
}
private long getMillisToWeekChange()
@ -990,7 +990,7 @@ public class Olympiad
{
return (_nextWeeklyChange - Calendar.getInstance().getTimeInMillis());
}
return 10L;
return 10;
}
private void scheduleWeeklyChange()

View File

@ -317,7 +317,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
else
{
statement = con.prepareStatement("UPDATE characters SET deletetime=? WHERE obj_Id=?");
statement.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000L)); // 24*60*60*1000 = 86400000
statement.setLong(1, System.currentTimeMillis() + (Config.DELETE_DAYS * 86400000)); // 24*60*60*1000 = 86400000
statement.setInt(2, objid);
statement.execute();
statement.close();

View File

@ -89,13 +89,13 @@ public final class AllyDismiss extends L2GameClientPacket
final long currentTime = System.currentTimeMillis();
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000L), L2Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED * 86400000), L2Clan.PENALTY_TYPE_DISMISS_CLAN); // 24*60*60*1000 = 86400000
leaderClan.updateClanInDB();
clan.setAllyId(0);
clan.setAllyName(null);
clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED * 86400000L), L2Clan.PENALTY_TYPE_CLAN_DISMISSED); // 24*60*60*1000 = 86400000
clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED * 86400000), L2Clan.PENALTY_TYPE_CLAN_DISMISSED); // 24*60*60*1000 = 86400000
clan.setAllyCrest(0);
clan.updateClanInDB();

View File

@ -68,7 +68,7 @@ public final class AllyLeave extends L2GameClientPacket
clan.setAllyId(0);
clan.setAllyName(null);
clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_LEAVED * 86400000L), L2Clan.PENALTY_TYPE_CLAN_LEAVED); // 24*60*60*1000 = 86400000
clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_LEAVED * 86400000), L2Clan.PENALTY_TYPE_CLAN_LEAVED); // 24*60*60*1000 = 86400000
clan.setAllyCrest(0);
clan.updateClanInDB();

View File

@ -82,8 +82,8 @@ public final class RequestOustPledgeMember extends L2GameClientPacket
}
// this also updates the database
clan.removeClanMember(_target, System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000L)); // Like L2OFF also player takes the penality
clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000L)); // 24*60*60*1000 = 86400000
clan.removeClanMember(_target, System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // Like L2OFF also player takes the penality
clan.setCharPenaltyExpiryTime(System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
clan.updateClanInDB();
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_EXPELLED);

View File

@ -60,7 +60,7 @@ public final class RequestWithdrawalPledge extends L2GameClientPacket
final L2Clan clan = activeChar.getClan();
clan.removeClanMember(activeChar.getName(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000L)); // 24*60*60*1000 = 86400000
clan.removeClanMember(activeChar.getName(), System.currentTimeMillis() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)); // 24*60*60*1000 = 86400000
SystemMessage sm = new SystemMessage(SystemMessageId.S1_HAS_WITHDRAWN_FROM_THE_CLAN);
sm.addString(activeChar.getName());

View File

@ -79,7 +79,7 @@ public class CharSelectInfo extends L2GameServerPacket
writeC(0x13);
writeD(size);
long lastAccess = 0L;
long lastAccess = 0;
if (_activeId == -1)
{

View File

@ -297,7 +297,7 @@ public final class TaskManager
}
else if (type == TYPE_GLOBAL_TASK)
{
final long interval = Long.valueOf(task.getParams()[0]) * 86400000L;
final long interval = Long.valueOf(task.getParams()[0]) * 86400000;
final String[] hour = task.getParams()[1].split(":");
if (hour.length != 3)

View File

@ -979,7 +979,7 @@ public class GameStatusThread extends Thread
statement.setInt(2, -249645);
statement.setInt(3, -2984);
statement.setInt(4, L2PcInstance.PunishLevel.JAIL.value());
statement.setLong(5, delay * 60000L);
statement.setLong(5, delay * 60000);
statement.setString(6, name);
statement.execute();