Removed unnecessary casts.

This commit is contained in:
MobiusDev
2018-06-24 16:39:51 +00:00
parent 4137824649
commit c9b04d53f4
47 changed files with 97 additions and 97 deletions

View File

@@ -1069,7 +1069,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((int) player.getPAtk(null)));
adminReply.replace("%matk%", String.valueOf((int) player.getMAtk(null, null)));
adminReply.replace("%pdef%", String.valueOf((int) player.getPDef(null)));

View File

@@ -1297,10 +1297,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.<br>

View File

@@ -1410,7 +1410,7 @@ public final class FourSepulchersManager
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

View File

@@ -172,7 +172,7 @@ public class CharStat
*/
public int getCriticalHit(L2Character target, Skill skill)
{
double val = (int) calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill);
double val = calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill);
if (!_activeChar.canOverrideCond(PcCondOverride.MAX_STATS_VALUE))
{
val = Math.min(val, Config.MAX_PCRIT_RATE);

View File

@@ -186,7 +186,7 @@ public final class L2ItemInstance extends L2Object
_type2 = 0;
_dropTime = 0;
_mana = _item.getDuration();
_time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + ((long) _item.getTime() * 60 * 1000);
_time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
_enchantLevel = 0;
scheduleLifeTimeTask();
}
@@ -210,7 +210,7 @@ public final class L2ItemInstance extends L2Object
setCount(1);
_loc = ItemLocation.VOID;
_mana = _item.getDuration();
_time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + ((long) _item.getTime() * 60 * 1000);
_time = _item.getTime() == -1 ? -1 : System.currentTimeMillis() + (_item.getTime() * 60 * 1000);
scheduleLifeTimeTask();
}

View File

@@ -1058,7 +1058,7 @@ public final class Formulas
}
else
{
rate = (int) attacker.getStat().calcStat(Stats.CRITICAL_RATE_POS, attacker.getStat().getCriticalHit(target, null));
rate = attacker.getStat().calcStat(Stats.CRITICAL_RATE_POS, attacker.getStat().getCriticalHit(target, null));
}
return (target.getStat().calcStat(Stats.DEFENCE_CRITICAL_RATE, rate, null, null) + target.getStat().calcStat(Stats.DEFENCE_CRITICAL_RATE_ADD, 0, null, null)) > Rnd.get(1000);
}

View File

@@ -66,6 +66,6 @@ public class FuncAtkEvasion extends AbstractFunction
value += (level - 69) + 2;
}
}
return (int) value;
return value;
}
}

View File

@@ -137,8 +137,8 @@ public class SSQStatus implements IClientOutgoingPacket
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);
}
/* DUSK */
@@ -238,20 +238,20 @@ public class SSQStatus implements IClientOutgoingPacket
else
{
packet.writeC(0);
packet.writeC(Math.round(((float) dawnProportion / (float) totalDawnMembers) * 100));
packet.writeC(Math.round(((float) dawnProportion / totalDawnMembers) * 100));
}
}
else
{
if (totalDawnMembers == 0)
{
packet.writeC(Math.round(((float) duskProportion / (float) totalDuskMembers) * 100));
packet.writeC(Math.round(((float) duskProportion / totalDuskMembers) * 100));
packet.writeC(0);
}
else
{
packet.writeC(Math.round(((float) duskProportion / (float) totalDuskMembers) * 100));
packet.writeC(Math.round(((float) dawnProportion / (float) totalDawnMembers) * 100));
packet.writeC(Math.round(((float) duskProportion / totalDuskMembers) * 100));
packet.writeC(Math.round(((float) dawnProportion / totalDawnMembers) * 100));
}
}
}