mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Removed some unnecessary casting.
This commit is contained in:
@ -132,7 +132,7 @@ public class Axes {
|
||||
|
||||
/* Every 50 Skill Levels you gain 1 durability damage (default values) */
|
||||
int impactIncreaseLevel = advancedConfig.getArmorImpactIncreaseLevel();
|
||||
float impactMaxDamage = (float) advancedConfig.getArmorImpactMaxDurabilityDamage() / 100F;
|
||||
float impactMaxDamage = advancedConfig.getArmorImpactMaxDurabilityDamage() / 100F;
|
||||
short maxDurability;
|
||||
durabilityDamage += (int) ((double) Users.getProfile(attacker).getSkillLevel(SkillType.AXES) / (double) impactIncreaseLevel);
|
||||
|
||||
@ -153,7 +153,7 @@ public class Axes {
|
||||
}
|
||||
int newDurabilityDamage = durabilityDamage - lowerdamage;
|
||||
maxDurability = (short) (armor.getType().getMaxDurability() * impactMaxDamage);
|
||||
if (newDurabilityDamage > maxDurability) newDurabilityDamage = (short) maxDurability;
|
||||
if (newDurabilityDamage > maxDurability) newDurabilityDamage = maxDurability;
|
||||
armor.setDurability((short) (armor.getDurability() + newDurabilityDamage)); //Damage armor piece
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class WoodCutting {
|
||||
if (health >= 2) {
|
||||
Combat.dealDamage(player, random.nextInt(health - 1));
|
||||
}
|
||||
inHand.setDurability((short) (inHand.getType().getMaxDurability()));
|
||||
inHand.setDurability(inHand.getType().getMaxDurability());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -96,7 +96,7 @@ public class WoodCutting {
|
||||
if (health >= 2) {
|
||||
Combat.dealDamage(player, random.nextInt(health - 1));
|
||||
}
|
||||
inHand.setDurability((short) (inHand.getType().getMaxDurability()));
|
||||
inHand.setDurability(inHand.getType().getMaxDurability());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ public class Repair {
|
||||
else bonus = (((float) skillLevel) / ((float) REPAIR_MASTERY_MAX_BONUS_LEVEL)) * (((float) REPAIR_MASTERY_CHANCE_MAX) / 100F);
|
||||
|
||||
if (Permissions.repairMastery(player)) {
|
||||
bonus = (((float) repairAmount) * bonus);
|
||||
bonus = repairAmount * bonus;
|
||||
repairAmount += (int) bonus;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class CallOfTheWildEventHandler {
|
||||
return;
|
||||
|
||||
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
|
||||
mcMMO.placeStore.addSpawnedPet((Entity) entity);
|
||||
mcMMO.placeStore.addSpawnedPet(entity);
|
||||
|
||||
((Tameable) entity).setOwner(player);
|
||||
|
||||
|
Reference in New Issue
Block a user