Removed some unnecessary casting.

This commit is contained in:
gmcferrin 2013-01-07 17:08:53 -05:00
parent b8d346d890
commit d69cf09d4e
7 changed files with 14 additions and 14 deletions

View File

@ -183,8 +183,8 @@ public class EntityListener implements Listener {
entity.setFireTicks(0);
BleedTimer.remove(entity);
Archery.arrowRetrievalCheck(entity);
mcMMO.placeStore.removeSpawnedMob(((Entity) entity));
mcMMO.placeStore.removeSpawnedPet(((Entity) entity));
mcMMO.placeStore.removeSpawnedMob(entity);
mcMMO.placeStore.removeSpawnedPet(entity);
}
/**
@ -197,7 +197,7 @@ public class EntityListener implements Listener {
SpawnReason reason = event.getSpawnReason();
if ((reason.equals(SpawnReason.SPAWNER) || reason.equals(SpawnReason.SPAWNER_EGG)) && !Config.getInstance().getExperienceGainsMobspawnersEnabled()) {
mcMMO.placeStore.addSpawnedMob(((Entity) event.getEntity()));
mcMMO.placeStore.addSpawnedMob(event.getEntity());
}
}
@ -398,7 +398,7 @@ public class EntityListener implements Listener {
if(player.hasMetadata("NPC")) return; // Check if this player is a Citizens NPC
if (Permissions.taming(player) && !mcMMO.placeStore.isSpawnedPet((Entity) event.getEntity())) {
if (Permissions.taming(player) && !mcMMO.placeStore.isSpawnedPet(event.getEntity())) {
PlayerProfile profile = Users.getProfile(player);
EntityType type = event.getEntityType();
int xp = 0;

View File

@ -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
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -398,8 +398,8 @@ public class Combat {
baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
}
}
else if (!mcMMO.placeStore.isSpawnedMob(((Entity) target))) {
if (target instanceof Animals && !mcMMO.placeStore.isSpawnedPet((Entity) target)) {
else if (!mcMMO.placeStore.isSpawnedMob(target)) {
if (target instanceof Animals && !mcMMO.placeStore.isSpawnedPet(target)) {
baseXP = configInstance.getAnimalsXP();
}
else {

View File

@ -175,10 +175,10 @@ public class HashChunkManager implements ChunkManager {
for(LivingEntity entity : world.getLivingEntities()) {
if(mobs.contains(entity.getUniqueId()))
addSpawnedMob((Entity) entity);
addSpawnedMob(entity);
if(pets.contains(entity.getUniqueId()))
addSpawnedPet((Entity) entity);
addSpawnedPet(entity);
}
in.clearSpawnedMobs();