Prevent various auto-boxing operations by using primitive getters.
This commit is contained in:
@@ -54,7 +54,7 @@ public class AttackTrait extends AbstractEffect
|
||||
{
|
||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||
{
|
||||
effected.getStat().mergeAttackTrait(trait.getKey(), trait.getValue());
|
||||
effected.getStat().mergeAttackTrait(trait.getKey(), trait.getValue().floatValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class AttackTrait extends AbstractEffect
|
||||
{
|
||||
for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
|
||||
{
|
||||
effected.getStat().removeAttackTrait(trait.getKey(), trait.getValue());
|
||||
effected.getStat().removeAttackTrait(trait.getKey(), trait.getValue().floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,9 +54,9 @@ public class DefenceTrait extends AbstractEffect
|
||||
{
|
||||
for (Entry<TraitType, Float> trait : _defenceTraits.entrySet())
|
||||
{
|
||||
if (trait.getValue() < 1.0f)
|
||||
if (trait.getValue().floatValue() < 1.0f)
|
||||
{
|
||||
effected.getStat().mergeDefenceTrait(trait.getKey(), trait.getValue());
|
||||
effected.getStat().mergeDefenceTrait(trait.getKey(), trait.getValue().floatValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -70,9 +70,9 @@ public class DefenceTrait extends AbstractEffect
|
||||
{
|
||||
for (Entry<TraitType, Float> trait : _defenceTraits.entrySet())
|
||||
{
|
||||
if (trait.getValue() < 1.0f)
|
||||
if (trait.getValue().floatValue() < 1.0f)
|
||||
{
|
||||
effected.getStat().removeDefenceTrait(trait.getKey(), trait.getValue());
|
||||
effected.getStat().removeDefenceTrait(trait.getKey(), trait.getValue().floatValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -80,7 +80,7 @@ public class DispelBySlot extends AbstractEffect
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
final Short transformToDispel = _dispelAbnormals.get(AbnormalType.TRANSFORM);
|
||||
if ((transformToDispel != null) && ((transformToDispel == effected.getTransformationId()) || (transformToDispel < 0)))
|
||||
if ((transformToDispel != null) && ((transformToDispel.intValue() == effected.getTransformationId()) || (transformToDispel.intValue() < 0)))
|
||||
{
|
||||
effected.stopTransformation(true);
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class DispelBySlot extends AbstractEffect
|
||||
}
|
||||
|
||||
final Short abnormalLevel = _dispelAbnormals.get(info.getSkill().getAbnormalType());
|
||||
return (abnormalLevel != null) && ((abnormalLevel < 0) || (abnormalLevel >= info.getSkill().getAbnormalLvl()));
|
||||
return (abnormalLevel != null) && ((abnormalLevel.shortValue() < 0) || (abnormalLevel.shortValue() >= info.getSkill().getAbnormalLvl()));
|
||||
}, true, true);
|
||||
}
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ public class KnockBack extends AbstractEffect
|
||||
ACTIVE_KNOCKBACKS.add(effected);
|
||||
|
||||
// Prevent knocking back raids and town NPCs.
|
||||
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
|
||||
if (effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ public class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double weaponMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double weaponBonus = _weaponBonus.containsKey(effector.getAttackType()) ? _weaponBonus.get(effector.getAttackType()).doubleValue() : 1d;
|
||||
final double power = _power + effector.getStat().getValue(Stat.SKILL_POWER_ADD, 0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? attack + power : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@@ -131,7 +131,7 @@ public class RestorationRandom extends AbstractEffect
|
||||
newItem.setEnchantLevel(Rnd.get(createdItem.getMinEnchant(), createdItem.getMaxEnchant()));
|
||||
}
|
||||
|
||||
if (extractedItems.get(newItem) != null)
|
||||
if (extractedItems.containsKey(newItem))
|
||||
{
|
||||
extractedItems.put(newItem, extractedItems.get(newItem) + itemCount);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class RestorationRandom extends AbstractEffect
|
||||
playerIU.addModifiedItem(itemInstance);
|
||||
}
|
||||
}
|
||||
sendMessage(player, entry.getKey(), entry.getValue());
|
||||
sendMessage(player, entry.getKey(), entry.getValue().longValue());
|
||||
}
|
||||
player.sendPacket(playerIU);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class RestorationRandom extends AbstractEffect
|
||||
return EffectType.EXTRACT_ITEM;
|
||||
}
|
||||
|
||||
private void sendMessage(PlayerInstance player, ItemInstance item, Long count)
|
||||
private void sendMessage(PlayerInstance player, ItemInstance item, long count)
|
||||
{
|
||||
final SystemMessage sm;
|
||||
if (count > 1)
|
||||
|
@@ -61,7 +61,7 @@ public class ServitorShare extends AbstractEffect
|
||||
{
|
||||
for (Entry<Stat, Float> stats : _sharedStats.entrySet())
|
||||
{
|
||||
effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue());
|
||||
effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue().floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ public class Transformation extends AbstractEffect
|
||||
{
|
||||
if (!_id.isEmpty())
|
||||
{
|
||||
effected.transform(_id.get(Rnd.get(_id.size())), true);
|
||||
effected.transform(_id.get(Rnd.get(_id.size())).intValue(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -201,7 +201,7 @@ public class ExtractableItems implements IItemHandler
|
||||
|
||||
for (Entry<ItemInstance, Long> entry : extractedItems.entrySet())
|
||||
{
|
||||
sendMessage(player, entry.getKey(), entry.getValue());
|
||||
sendMessage(player, entry.getKey(), entry.getValue().longValue());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -216,7 +216,7 @@ public class ExtractableItems implements IItemHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (extractedItems.get(newItem) != null)
|
||||
if (extractedItems.containsKey(newItem))
|
||||
{
|
||||
extractedItems.put(newItem, extractedItems.get(newItem) + 1);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
private void sendMessage(PlayerInstance player, ItemInstance item, Long count)
|
||||
private void sendMessage(PlayerInstance player, ItemInstance item, long count)
|
||||
{
|
||||
final SystemMessage sm;
|
||||
if (count > 1)
|
||||
|
Reference in New Issue
Block a user