gt:                     Misc.dropItem(location, new ItemStack(Material.STRING));
context: package com.gmail.nossr50.skills.gathering;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.bukkit.DyeColor;
  import org.bukkit.Location;
  import org.bukkit.Material;
  import org.bukkit.enchantments.Enchantment;
  import org.bukkit.entity.EntityType;
  import org.bukkit.entity.Item;
  import org.bukkit.entity.LivingEntity;
  import org.bukkit.entity.Player;
  import org.bukkit.entity.Sheep;
  import org.bukkit.entity.Skeleton;
  import org.bukkit.entity.Skeleton.SkeletonType;
  import org.bukkit.event.player.PlayerFishEvent;
  import org.bukkit.inventory.ItemStack;
  import org.bukkit.material.MaterialData;
  import org.bukkit.material.Wool;
  import org.bukkit.potion.Potion;
  import org.bukkit.potion.PotionType;
  
  import com.gmail.nossr50.config.AdvancedConfig;
  import com.gmail.nossr50.config.Config;
  import com.gmail.nossr50.config.TreasuresConfig;
  import com.gmail.nossr50.datatypes.PlayerProfile;
  import com.gmail.nossr50.datatypes.SkillType;
  import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
  import com.gmail.nossr50.locale.LocaleLoader;
  import com.gmail.nossr50.util.Combat;
  import com.gmail.nossr50.util.ItemChecks;
  import com.gmail.nossr50.util.Misc;
  import com.gmail.nossr50.util.Permissions;
  import com.gmail.nossr50.util.Skills;
  import com.gmail.nossr50.util.Users;
  
  public class Fishing {
      static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
  
      /**
       * Get the player's current fishing loot tier.
       * 
       * @param profile
       *            The profile of the player
       * @return the player's current fishing rank
       */
      public static int getFishingLootTier(PlayerProfile profile) {
          int level = profile.getSkillLevel(SkillType.FISHING);
          int fishingTier;
  
          if (level >= advancedConfig.getFishingTierLevelsTier5()) {
              fishingTier = 5;
          } else if (level >= advancedConfig.getFishingTierLevelsTier4()) {
              fishingTier = 4;
          } else if (level >= advancedConfig.getFishingTierLevelsTier3()) {
              fishingTier = 3;
          } else if (level >= advancedConfig.getFishingTierLevelsTier2()) {
              fishingTier = 2;
          } else {
              fishingTier = 1;
          }
  
          return fishingTier;
      }
  
      /**
       * Get item results from Fishing.
       * 
       * @param player
       *            The player that was fishing
       * @param event
       *            The event to modify
       */
      private static void getFishingResults(Player player, PlayerFishEvent event) {
          if (player == null)
              return;
  
          PlayerProfile profile = Users.getProfile(player);
          Item theCatch = (Item) event.getCaught();
  
          if (Config.getInstance().getFishingDropsEnabled() && Permissions.fishingTreasures(player)) {
              int skillLevel = profile.getSkillLevel(SkillType.FISHING);
              List<FishingTreasure> rewards = new ArrayList<FishingTreasure>();
  
              for (FishingTreasure treasure : TreasuresConfig.getInstance().fishingRewards) {
                  if (treasure.getDropLevel() <= skillLevel && treasure.getMaxLevel() >= skillLevel) {
                      rewards.add(treasure);
                  }
              }
  
              if (rewards.size() <= 0) {
                  return;
              }
  
              FishingTreasure foundTreasure = rewards.get(Misc.getRandom().nextInt(rewards.size()));
  
              int randomChance = 100;
              if (Permissions.luckyFishing(player)) {
                  randomChance = (int) (randomChance * 0.75);
              }
  
              if (Misc.getRandom().nextDouble() * randomChance <= foundTreasure.getDropChance()) {
                  Users.getPlayer(player).addXP(SkillType.FISHING, foundTreasure.getXp());
                  theCatch.setItemStack(foundTreasure.getDrop());
              }
          }
          else {
              theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
          }
  
          short maxDurability = theCatch.getItemStack().getType().getMaxDurability();
  
          if (maxDurability > 0) {
              theCatch.getItemStack().setDurability((short) (Misc.getRandom().nextInt(maxDurability))); // Change durability to random value
          }
  
          Skills.xpProcessing(player, profile, SkillType.FISHING, Config.getInstance().getFishingBaseXP());
      }
  
      /**
       * Process results from Fishing.
       * 
       * @param event
       *            The event to modify
       */
      public static void processResults(PlayerFishEvent event) {
          Player player = event.getPlayer();
          if (player == null)
              return;
  
          PlayerProfile profile = Users.getProfile(player);
  
          getFishingResults(player, event);
          Item theCatch = (Item) event.getCaught();
  
          if (theCatch.getItemStack().getType() != Material.RAW_FISH) {
              int lootTier = Fishing.getFishingLootTier(profile);
              int magicHunterMultiplier = advancedConfig.getFishingMagicMultiplier();
              int specificChance = 1;
              boolean enchanted = false;
              ItemStack fishingResults = theCatch.getItemStack();
  
              player.sendMessage(LocaleLoader.getString("Fishing.ItemFound"));
  
              if (ItemChecks.isEnchantable(fishingResults)) {
                  int randomChance = 100;
  
                  if (Permissions.luckyFishing(player)) {
                      randomChance = (int) (randomChance * 0.75);
                  }
  
                  if (player.getWorld().hasStorm()) {
                      randomChance = (int) (randomChance * 0.909);
                  }
  
                  /* CHANCE OF ITEM BEING ENCHANTED
                   * 5% - Tier 1
                   * 10% - Tier 2
                   * 15% - Tier 3
                   * 20% - Tier 4
                   * 25% - Tier 5
                   */
                  if (Misc.getRandom().nextInt(randomChance) <= (lootTier * magicHunterMultiplier) && Permissions.fishingMagic(player)) {
                      for (Enchantment newEnchant : Enchantment.values()) {
                          if (newEnchant.canEnchantItem(fishingResults)) {
                              specificChance++;
  
                              for (Enchantment oldEnchant : fishingResults.getEnchantments().keySet()) {
                                  if (oldEnchant.conflictsWith(newEnchant))
                                      specificChance--;
                                      continue;
                              }
  
                              /* CHANCE OF GETTING EACH ENCHANTMENT
                               * 50% - 1st Enchantment
                               * 33% - 2nd Enchantment
                               * 25% - 3rd Enchantment
                               * 20% - 4th Enchantment
                               * 16.66% - 5th Enchantment
                               * 14.29% - 6th Enchantment
                               * 12.5% - 7th Enchantment
                               * 11.11% - 8th Enchantment
                               */
                              if (Misc.getRandom().nextInt(specificChance) < 1) {
                                  enchanted = true;
                                  int randomEnchantLevel = Misc.getRandom().nextInt(newEnchant.getMaxLevel()) + 1;
  
                                  if (randomEnchantLevel < newEnchant.getStartLevel()) {
                                      randomEnchantLevel = newEnchant.getStartLevel();
                                  }
  
  
                                  fishingResults.addEnchantment(newEnchant, randomEnchantLevel);
                              }
                          }
                      }
                  }
              }
  
              if (enchanted) {
                  player.sendMessage(LocaleLoader.getString("Fishing.MagicFound"));
              }
          }
      }
  
      /**
       * Shake a mob, have them drop an item.
       * 
       * @param event
       *            The event to modify
       */
      public static void shakeMob(PlayerFishEvent event) {
          int randomChance = 100;
  
          if (Permissions.luckyFishing(event.getPlayer())) {
              randomChance = (int) (randomChance * 1.25);
          }
  
          final Player player = event.getPlayer();
          final PlayerProfile profile = Users.getProfile(player);
          int lootTier = getFishingLootTier(profile);
  
          int dropChance = getShakeChance(lootTier);
  
          if (Permissions.luckyFishing(player)) {
              // With lucky perk on max level tier, its 100%
              dropChance = (int) (dropChance * 1.25);
          }
  
          final int DROP_CHANCE = Misc.getRandom().nextInt(100);
          final int DROP_NUMBER = Misc.getRandom().nextInt(randomChance) + 1;
  
          LivingEntity le = (LivingEntity) event.getCaught();
          EntityType type = le.getType();
          Location location = le.getLocation();
  
          if (DROP_CHANCE < dropChance) {
  
              switch (type) {
              case BLAZE:
                  Misc.dropItem(location, new ItemStack(Material.BLAZE_ROD));
                  break;
  
              case CAVE_SPIDER:
                  if (DROP_NUMBER > 50) {
                      Misc.dropItem(location, new ItemStack(Material.SPIDER_EYE));
                  } else {
  