diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 2e0516a2a..f56d12c54 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -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; diff --git a/src/main/java/com/gmail/nossr50/skills/combat/Axes.java b/src/main/java/com/gmail/nossr50/skills/combat/Axes.java index 3d5396a94..d267043eb 100644 --- a/src/main/java/com/gmail/nossr50/skills/combat/Axes.java +++ b/src/main/java/com/gmail/nossr50/skills/combat/Axes.java @@ -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 } } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java index 9c0850b4d..e50796000 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java @@ -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; } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index cd9ea8c59..ec352ccf9 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -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; } diff --git a/src/main/java/com/gmail/nossr50/skills/taming/CallOfTheWildEventHandler.java b/src/main/java/com/gmail/nossr50/skills/taming/CallOfTheWildEventHandler.java index a99f25b18..53b611e5b 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/CallOfTheWildEventHandler.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/CallOfTheWildEventHandler.java @@ -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); diff --git a/src/main/java/com/gmail/nossr50/util/Combat.java b/src/main/java/com/gmail/nossr50/util/Combat.java index eb02001c4..842eba0ac 100644 --- a/src/main/java/com/gmail/nossr50/util/Combat.java +++ b/src/main/java/com/gmail/nossr50/util/Combat.java @@ -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 { diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java index bd4da0f32..3cf9018fa 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java @@ -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();