Removed unnecessary casts.
This commit is contained in:
@@ -67,7 +67,7 @@ public class TradeController
|
||||
{
|
||||
restoreCount(_timer);
|
||||
dataTimerSave(_timer);
|
||||
ThreadPool.schedule(new RestoreCount(_timer), (long) _timer * 60 * 60 * 1000);
|
||||
ThreadPool.schedule(new RestoreCount(_timer), _timer * 60 * 60 * 1000);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
@@ -613,7 +613,7 @@ public class TradeController
|
||||
|
||||
protected void dataTimerSave(int time)
|
||||
{
|
||||
final long timerSave = System.currentTimeMillis() + ((long) time * 60 * 60 * 1000);
|
||||
final long timerSave = System.currentTimeMillis() + (time * 60 * 60 * 1000);
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
PreparedStatement statement = con.prepareStatement("UPDATE merchant_buylists SET savetimer =? WHERE time =?");
|
||||
|
@@ -392,7 +392,7 @@ public class DoorTable
|
||||
continue; // Parallel
|
||||
}
|
||||
|
||||
final float p = (float) ((doorInst.getA() * x) + (doorInst.getB() * y) + (doorInst.getC() * z) + doorInst.getD()) / (float) dk;
|
||||
final float p = (float) ((doorInst.getA() * x) + (doorInst.getB() * y) + (doorInst.getC() * z) + doorInst.getD()) / dk;
|
||||
|
||||
final int fx = (int) (x - (l * p));
|
||||
final int fy = (int) (y - (m * p));
|
||||
|
@@ -58,7 +58,7 @@ public class TradeListTable
|
||||
{
|
||||
restoreCount(timer);
|
||||
dataTimerSave(timer);
|
||||
ThreadPool.schedule(new RestoreCount(timer), (long) timer * 60 * 60 * 1000);
|
||||
ThreadPool.schedule(new RestoreCount(timer), timer * 60 * 60 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public class TradeListTable
|
||||
|
||||
protected void dataTimerSave(int time)
|
||||
{
|
||||
final long timerSave = System.currentTimeMillis() + ((long) time * 3600000); // 60*60*1000
|
||||
final long timerSave = System.currentTimeMillis() + (time * 3600000); // 60*60*1000
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
|
@@ -107,7 +107,7 @@ public class MultilayerBlock implements IBlock
|
||||
|
||||
private int _extractLayerNswe(short layer)
|
||||
{
|
||||
return (byte) (layer & 0x000F);
|
||||
return (layer & 0x000F);
|
||||
}
|
||||
|
||||
private int _extractLayerHeight(short layer)
|
||||
|
@@ -1061,7 +1061,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
adminReply.replace("%pkkills%", String.valueOf(player.getPkKills()));
|
||||
adminReply.replace("%currentload%", String.valueOf(player.getCurrentLoad()));
|
||||
adminReply.replace("%maxload%", String.valueOf(player.getMaxLoad()));
|
||||
adminReply.replace("%percent%", String.valueOf(Util.roundTo(((float) player.getCurrentLoad() / (float) player.getMaxLoad()) * 100, 2)));
|
||||
adminReply.replace("%percent%", String.valueOf(Util.roundTo(((float) player.getCurrentLoad() / player.getMaxLoad()) * 100, 2)));
|
||||
adminReply.replace("%patk%", String.valueOf(player.getPAtk(null)));
|
||||
adminReply.replace("%matk%", String.valueOf(player.getMAtk(null, null)));
|
||||
adminReply.replace("%pdef%", String.valueOf(player.getPDef(null)));
|
||||
|
@@ -523,7 +523,7 @@ public class AdminEditNpc implements IAdminCommandHandler
|
||||
|
||||
for (Object p : box.getAccess())
|
||||
{
|
||||
msg += " " + (String) p;
|
||||
msg += " " + p;
|
||||
}
|
||||
|
||||
activeChar.sendMessage(msg);
|
||||
|
@@ -171,7 +171,7 @@ public class Blow implements ISkillHandler
|
||||
crit = true;
|
||||
}
|
||||
|
||||
double damage = (int) Formulas.calcBlowDamage(activeChar, target, skill, shld, crit, soul);
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, skill, shld, crit, soul);
|
||||
|
||||
// if (soul)
|
||||
// weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
|
||||
|
@@ -1605,7 +1605,7 @@ public class FourSepulchersManager extends GrandBossManager
|
||||
|
||||
protected byte minuteSelect(byte min)
|
||||
{
|
||||
if (((double) min % 5) != 0)// if doesn't divides on 5 fully
|
||||
if ((min % 5) != 0)// if doesn't divides on 5 fully
|
||||
{
|
||||
// mad table for selecting proper minutes...
|
||||
// may be there is a better way to do this
|
||||
|
@@ -918,7 +918,7 @@ public class L2Attackable extends L2NpcInstance
|
||||
// If the party didn't killed this L2Attackable alone
|
||||
if (partyDmg < getMaxHp())
|
||||
{
|
||||
partyMul = (float) partyDmg / (float) getMaxHp();
|
||||
partyMul = (float) partyDmg / getMaxHp();
|
||||
}
|
||||
|
||||
// Avoid "over damage"
|
||||
@@ -1290,7 +1290,7 @@ public class L2Attackable extends L2NpcInstance
|
||||
{ // core ring
|
||||
if (Config.CORE_RING_CHANCE > 0)
|
||||
{
|
||||
dropChance = ((float) 10000 * Config.CORE_RING_CHANCE);
|
||||
dropChance = (10000 * Config.CORE_RING_CHANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1302,7 +1302,7 @@ public class L2Attackable extends L2NpcInstance
|
||||
{ // orfen earring
|
||||
if (Config.ORFEN_EARRING_CHANCE > 0)
|
||||
{
|
||||
dropChance = ((float) 10000 * Config.ORFEN_EARRING_CHANCE);
|
||||
dropChance = (10000 * Config.ORFEN_EARRING_CHANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1314,7 +1314,7 @@ public class L2Attackable extends L2NpcInstance
|
||||
{ // zaken earring
|
||||
if (Config.ZAKEN_EARRING_CHANCE > 0)
|
||||
{
|
||||
dropChance = ((float) 10000 * Config.ZAKEN_EARRING_CHANCE);
|
||||
dropChance = (10000 * Config.ZAKEN_EARRING_CHANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1326,7 +1326,7 @@ public class L2Attackable extends L2NpcInstance
|
||||
{ // aq ring
|
||||
if (Config.QA_RING_CHANCE > 0)
|
||||
{
|
||||
dropChance = ((float) 10000 * Config.QA_RING_CHANCE);
|
||||
dropChance = (10000 * Config.QA_RING_CHANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3092,14 +3092,14 @@ public class L2Attackable extends L2NpcInstance
|
||||
diff = -5; // makes possible to use ALT_GAME_EXPONENT configuration
|
||||
}
|
||||
|
||||
xp = ((double) getExpReward() * damage) / getMaxHp();
|
||||
xp = (getExpReward() * damage) / getMaxHp();
|
||||
|
||||
if (Config.ALT_GAME_EXPONENT_XP != 0)
|
||||
{
|
||||
xp *= Math.pow(2., -diff / Config.ALT_GAME_EXPONENT_XP);
|
||||
}
|
||||
|
||||
sp = ((double) getSpReward() * damage) / getMaxHp();
|
||||
sp = (getSpReward() * damage) / getMaxHp();
|
||||
|
||||
if (Config.ALT_GAME_EXPONENT_SP != 0)
|
||||
{
|
||||
|
@@ -1525,10 +1525,10 @@ public class SevenSigns
|
||||
int newSealOwner = CABAL_NULL;
|
||||
final int dawnProportion = getSealProportion(currSeal, CABAL_DAWN);
|
||||
final int totalDawnMembers = getTotalMembers(CABAL_DAWN) == 0 ? 1 : getTotalMembers(CABAL_DAWN);
|
||||
final int dawnPercent = Math.round(((float) dawnProportion / (float) totalDawnMembers) * 100);
|
||||
final int dawnPercent = Math.round(((float) dawnProportion / totalDawnMembers) * 100);
|
||||
final int duskProportion = getSealProportion(currSeal, CABAL_DUSK);
|
||||
final int totalDuskMembers = getTotalMembers(CABAL_DUSK) == 0 ? 1 : getTotalMembers(CABAL_DUSK);
|
||||
final int duskPercent = Math.round(((float) duskProportion / (float) totalDuskMembers) * 100);
|
||||
final int duskPercent = Math.round(((float) duskProportion / totalDuskMembers) * 100);
|
||||
|
||||
/*
|
||||
* - If a Seal was already closed or owned by the opponent and the new winner wants to assume ownership of the Seal, 35% or more of the members of the Cabal must have chosen the Seal. If they chose less than 35%, they cannot own the Seal. - If the Seal was owned by the winner in the
|
||||
|
@@ -190,7 +190,7 @@ public class MultiSellChoose extends L2GameClientPacket
|
||||
// now check if the player has sufficient items in the inventory to cover the ingredients' expences
|
||||
for (MultiSellIngredient e : _ingredientsList)
|
||||
{
|
||||
if (((double) e.getItemCount() * _amount) > Integer.MAX_VALUE)
|
||||
if ((e.getItemCount() * _amount) > Integer.MAX_VALUE)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED);
|
||||
_ingredientsList.clear();
|
||||
|
@@ -281,7 +281,7 @@ public final class RequestBuyItem extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
subTotal += (long) count * price; // Before tax
|
||||
subTotal += count * price; // Before tax
|
||||
tax = (int) (subTotal * taxRate);
|
||||
|
||||
// Check subTotal + tax
|
||||
@@ -293,7 +293,7 @@ public final class RequestBuyItem extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
weight += (long) count * template.getWeight();
|
||||
weight += count * template.getWeight();
|
||||
if (!template.isStackable())
|
||||
{
|
||||
slots += count;
|
||||
|
@@ -137,8 +137,8 @@ public class SSQStatus extends L2GameServerPacket
|
||||
|
||||
if (totalOverallScore != 0)
|
||||
{
|
||||
dawnPercent = Math.round(((float) dawnTotalScore / (float) totalOverallScore) * 100);
|
||||
duskPercent = Math.round(((float) duskTotalScore / (float) totalOverallScore) * 100);
|
||||
dawnPercent = Math.round(((float) dawnTotalScore / totalOverallScore) * 100);
|
||||
duskPercent = Math.round(((float) duskTotalScore / totalOverallScore) * 100);
|
||||
}
|
||||
|
||||
if (Config.DEBUG)
|
||||
@@ -246,18 +246,18 @@ public class SSQStatus extends L2GameServerPacket
|
||||
else
|
||||
{
|
||||
writeC(0);
|
||||
writeC(Math.round(((float) dawnProportion / (float) totalDawnMembers) * 100));
|
||||
writeC(Math.round(((float) dawnProportion / totalDawnMembers) * 100));
|
||||
}
|
||||
}
|
||||
else if (totalDawnMembers == 0)
|
||||
{
|
||||
writeC(Math.round(((float) duskProportion / (float) totalDuskMembers) * 100));
|
||||
writeC(Math.round(((float) duskProportion / totalDuskMembers) * 100));
|
||||
writeC(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeC(Math.round(((float) duskProportion / (float) totalDuskMembers) * 100));
|
||||
writeC(Math.round(((float) dawnProportion / (float) totalDawnMembers) * 100));
|
||||
writeC(Math.round(((float) duskProportion / totalDuskMembers) * 100));
|
||||
writeC(Math.round(((float) dawnProportion / totalDawnMembers) * 100));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -1345,7 +1345,7 @@ public final class Formulas
|
||||
env.skill = skill;
|
||||
env.value = damage;
|
||||
func.calc(env);
|
||||
damage = (int) env.value;
|
||||
damage = env.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user