From cdd97453411b48a0425c8a918585b932ada1828e Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Thu, 3 Jan 2013 17:40:22 +0100 Subject: [PATCH] Fixing formatting --- .../nossr50/skills/gathering/Fishing.java | 50 ++++++------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java index 7f49ee586..8e4b8c1f8 100755 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java @@ -106,10 +106,8 @@ public class Fishing { break; } - if (Config.getInstance().getFishingDropsEnabled() && rewards.size() > 0 - && Permissions.getInstance().fishingTreasures(player)) { - FishingTreasure treasure = rewards.get(random.nextInt(rewards - .size())); + if (Config.getInstance().getFishingDropsEnabled() && rewards.size() > 0 && Permissions.getInstance().fishingTreasures(player)) { + FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); int randomChance = 100; @@ -118,26 +116,20 @@ public class Fishing { } if (random.nextDouble() * randomChance <= treasure.getDropChance()) { - Users.getPlayer(player).addXP(SkillType.FISHING, - treasure.getXp()); + Users.getPlayer(player).addXP(SkillType.FISHING,treasure.getXp()); theCatch.setItemStack(treasure.getDrop()); } } else { theCatch.setItemStack(new ItemStack(Material.RAW_FISH)); } - short maxDurability = theCatch.getItemStack().getType() - .getMaxDurability(); + short maxDurability = theCatch.getItemStack().getType().getMaxDurability(); if (maxDurability > 0) { - theCatch.getItemStack().setDurability( - (short) (random.nextInt(maxDurability))); // Change - // durability to - // random value + theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); // Change durability to random value } - Skills.xpProcessing(player, profile, SkillType.FISHING, Config - .getInstance().getFishingBaseXP()); + Skills.xpProcessing(player, profile, SkillType.FISHING, Config.getInstance().getFishingBaseXP()); } /** @@ -157,8 +149,7 @@ public class Fishing { Item theCatch = (Item) event.getCaught(); if (theCatch.getItemStack().getType() != Material.RAW_FISH) { - final int ENCHANTMENT_CHANCE = advancedConfig - .getFishingEnchantmentChance(); + final int ENCHANTMENT_CHANCE = advancedConfig.getFishingEnchantmentChance(); boolean enchanted = false; ItemStack fishingResults = theCatch.getItemStack(); @@ -171,15 +162,12 @@ public class Fishing { randomChance = (int) (randomChance * 0.75); } - if (random.nextInt(randomChance) <= ENCHANTMENT_CHANCE - && Permissions.getInstance().fishingMagic(player)) { + if (random.nextInt(randomChance) <= ENCHANTMENT_CHANCE && Permissions.getInstance().fishingMagic(player)) { for (Enchantment newEnchant : Enchantment.values()) { if (newEnchant.canEnchantItem(fishingResults)) { - Map resultEnchantments = fishingResults - .getEnchantments(); + Map resultEnchantments = fishingResults.getEnchantments(); - for (Enchantment oldEnchant : resultEnchantments - .keySet()) { + for (Enchantment oldEnchant : resultEnchantments.keySet()) { if (oldEnchant.conflictsWith(newEnchant)) continue; } @@ -188,23 +176,18 @@ public class Fishing { * Actual chance to have an enchantment is related * to your fishing skill */ - if (random.nextInt(15) < Fishing - .getFishingLootTier(profile)) { + if (random.nextInt(15) < Fishing.getFishingLootTier(profile)) { enchanted = true; - int randomEnchantLevel = random - .nextInt(newEnchant.getMaxLevel()) + 1; + int randomEnchantLevel = random.nextInt(newEnchant.getMaxLevel()) + 1; - if (randomEnchantLevel < newEnchant - .getStartLevel()) { - randomEnchantLevel = newEnchant - .getStartLevel(); + if (randomEnchantLevel < newEnchant.getStartLevel()) { + randomEnchantLevel = newEnchant.getStartLevel(); } if (randomEnchantLevel >= 1000) continue; - fishingResults.addEnchantment(newEnchant, - randomEnchantLevel); + fishingResults.addEnchantment(newEnchant,randomEnchantLevel); } } } @@ -237,8 +220,7 @@ public class Fishing { int dropChance = getShakeChance(lootTier); if (event.getPlayer().hasPermission("mcmmo.perks.lucky.fishing")) { - dropChance = (int) (dropChance * 1.25); // With lucky perk on max - // level tier, its 100% + dropChance = (int) (dropChance * 1.25); // With lucky perk on max level tier, its 100% } final int DROP_CHANCE = random.nextInt(100);