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); entity.setFireTicks(0);
BleedTimer.remove(entity); BleedTimer.remove(entity);
Archery.arrowRetrievalCheck(entity); Archery.arrowRetrievalCheck(entity);
mcMMO.placeStore.removeSpawnedMob(((Entity) entity)); mcMMO.placeStore.removeSpawnedMob(entity);
mcMMO.placeStore.removeSpawnedPet(((Entity) entity)); mcMMO.placeStore.removeSpawnedPet(entity);
} }
/** /**
@ -197,7 +197,7 @@ public class EntityListener implements Listener {
SpawnReason reason = event.getSpawnReason(); SpawnReason reason = event.getSpawnReason();
if ((reason.equals(SpawnReason.SPAWNER) || reason.equals(SpawnReason.SPAWNER_EGG)) && !Config.getInstance().getExperienceGainsMobspawnersEnabled()) { 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(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); PlayerProfile profile = Users.getProfile(player);
EntityType type = event.getEntityType(); EntityType type = event.getEntityType();
int xp = 0; int xp = 0;

View File

@ -132,7 +132,7 @@ public class Axes {
/* Every 50 Skill Levels you gain 1 durability damage (default values) */ /* Every 50 Skill Levels you gain 1 durability damage (default values) */
int impactIncreaseLevel = advancedConfig.getArmorImpactIncreaseLevel(); int impactIncreaseLevel = advancedConfig.getArmorImpactIncreaseLevel();
float impactMaxDamage = (float) advancedConfig.getArmorImpactMaxDurabilityDamage() / 100F; float impactMaxDamage = advancedConfig.getArmorImpactMaxDurabilityDamage() / 100F;
short maxDurability; short maxDurability;
durabilityDamage += (int) ((double) Users.getProfile(attacker).getSkillLevel(SkillType.AXES) / (double) impactIncreaseLevel); durabilityDamage += (int) ((double) Users.getProfile(attacker).getSkillLevel(SkillType.AXES) / (double) impactIncreaseLevel);
@ -153,7 +153,7 @@ public class Axes {
} }
int newDurabilityDamage = durabilityDamage - lowerdamage; int newDurabilityDamage = durabilityDamage - lowerdamage;
maxDurability = (short) (armor.getType().getMaxDurability() * impactMaxDamage); 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 armor.setDurability((short) (armor.getDurability() + newDurabilityDamage)); //Damage armor piece
} }
} }

View File

@ -84,7 +84,7 @@ public class WoodCutting {
if (health >= 2) { if (health >= 2) {
Combat.dealDamage(player, random.nextInt(health - 1)); Combat.dealDamage(player, random.nextInt(health - 1));
} }
inHand.setDurability((short) (inHand.getType().getMaxDurability())); inHand.setDurability(inHand.getType().getMaxDurability());
return; return;
} }
} }
@ -96,7 +96,7 @@ public class WoodCutting {
if (health >= 2) { if (health >= 2) {
Combat.dealDamage(player, random.nextInt(health - 1)); Combat.dealDamage(player, random.nextInt(health - 1));
} }
inHand.setDurability((short) (inHand.getType().getMaxDurability())); inHand.setDurability(inHand.getType().getMaxDurability());
return; 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); else bonus = (((float) skillLevel) / ((float) REPAIR_MASTERY_MAX_BONUS_LEVEL)) * (((float) REPAIR_MASTERY_CHANCE_MAX) / 100F);
if (Permissions.repairMastery(player)) { if (Permissions.repairMastery(player)) {
bonus = (((float) repairAmount) * bonus); bonus = repairAmount * bonus;
repairAmount += (int) bonus; repairAmount += (int) bonus;
} }

View File

@ -67,7 +67,7 @@ public class CallOfTheWildEventHandler {
return; return;
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type); LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
mcMMO.placeStore.addSpawnedPet((Entity) entity); mcMMO.placeStore.addSpawnedPet(entity);
((Tameable) entity).setOwner(player); ((Tameable) entity).setOwner(player);

View File

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

View File

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