Changes to fishing

This commit is contained in:
NuclearW 2012-01-30 14:20:51 -05:00
parent bc9b089a53
commit ddf7920c4d
2 changed files with 26 additions and 315 deletions

View File

@ -4,10 +4,11 @@ Changelog:
Version 1.2.09-dev Version 1.2.09-dev
- Fixed issue with Repair Mastery (Issue #47) - Fixed issue with Repair Mastery (Issue #47)
- Made Arcane Forging fully configurable (Pull Request #52) - Made Arcane Forging fully configurable (Pull Request #52)
- Made Fishing configurable (Pull Request #60)
- Changed timer to be a bit more efficient (Issue #19) - Changed timer to be a bit more efficient (Issue #19)
- Changed to fire EntityDamageEvents for all damage done by mcMMO - Changed to fire EntityDamageEvents for all damage done by mcMMO
- New custom event for developers McMMOPlayerLevelUpEvent - New custom event for developers McMMOPlayerLevelUpEvent
- New custmo event for developers McMMOItemSpawnEvent - New custom event for developers McMMOItemSpawnEvent
Version 1.2.08 Version 1.2.08
- Changed Bukkit events to new event system - Changed Bukkit events to new event system

View File

@ -71,6 +71,7 @@ public class Fishing {
{ {
int randomNum = (int)(Math.random() * 15); int randomNum = (int)(Math.random() * 15);
CraftItem theCatch = (CraftItem)event.getCaught(); CraftItem theCatch = (CraftItem)event.getCaught();
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
if(Math.random() * 100 < LoadProperties.fishingDropChanceTier1) if(Math.random() * 100 < LoadProperties.fishingDropChanceTier1)
{ {
@ -79,101 +80,72 @@ public class Fishing {
case 1: case 1:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 2: case 2:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 3: case 3:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 4: case 4:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 5: case 5:
if(LoadProperties.woodenTools && LoadProperties.fishingDrops) if(LoadProperties.woodenTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.WOOD_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.WOOD_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 6: case 6:
if(LoadProperties.woodenTools && LoadProperties.fishingDrops) if(LoadProperties.woodenTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.WOOD_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.WOOD_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 7: case 7:
if(LoadProperties.woodenTools && LoadProperties.fishingDrops) if(LoadProperties.woodenTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.WOOD_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.WOOD_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 8: case 8:
if(LoadProperties.woodenTools && LoadProperties.fishingDrops) if(LoadProperties.woodenTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.WOOD_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.WOOD_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 9: case 9:
if(LoadProperties.woodenTools && LoadProperties.fishingDrops) if(LoadProperties.woodenTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.WOOD_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.WOOD_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 10: case 10:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 11: case 11:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 12: case 12:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 13: case 13:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 14: case 14:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
} }
} else
{
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
} }
if(theCatch.getItemStack().getType() != Material.RAW_FISH) {
//Change durability to random value //Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value
}
} }
private static void getFishingResultsTier2(Player player, PlayerFishEvent event) private static void getFishingResultsTier2(Player player, PlayerFishEvent event)
{ {
int randomNum = (int)(Math.random() * 20); int randomNum = (int)(Math.random() * 20);
CraftItem theCatch = (CraftItem)event.getCaught(); CraftItem theCatch = (CraftItem)event.getCaught();
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
if(Math.random() * 100 < LoadProperties.fishingDropChanceTier2) if(Math.random() * 100 < LoadProperties.fishingDropChanceTier2)
{ {
@ -182,131 +154,92 @@ public class Fishing {
case 1: case 1:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 2: case 2:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 3: case 3:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 4: case 4:
if(LoadProperties.leatherArmor && LoadProperties.fishingDrops) if(LoadProperties.leatherArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 5: case 5:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 6: case 6:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 7: case 7:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 8: case 8:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 9: case 9:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 10: case 10:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 11: case 11:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 12: case 12:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 13: case 13:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 14: case 14:
if(LoadProperties.stoneTools && LoadProperties.fishingDrops) if(LoadProperties.stoneTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 15: case 15:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 16: case 16:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 17: case 17:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 18: case 18:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 19: case 19:
if(LoadProperties.enderPearl && LoadProperties.fishingDrops) if(LoadProperties.enderPearl && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1)); theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
} }
} else
{
theCatch.setItemStack(new ItemStack(Material.RAW_FISH, 1));
} }
if(theCatch.getItemStack().getType() != Material.RAW_FISH) {
//Change durability to random value //Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value
} }
}
private static void getFishingResultsTier3(Player player, PlayerFishEvent event) private static void getFishingResultsTier3(Player player, PlayerFishEvent event)
{ {
int randomNum = (int)(Math.random() * 24); int randomNum = (int)(Math.random() * 24);
CraftItem theCatch = (CraftItem)event.getCaught(); CraftItem theCatch = (CraftItem)event.getCaught();
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
if(Math.random() * 100 < LoadProperties.fishingDropChanceTier3) if(Math.random() * 100 < LoadProperties.fishingDropChanceTier3)
{ {
@ -315,155 +248,108 @@ public class Fishing {
case 1: case 1:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 2: case 2:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 3: case 3:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 4: case 4:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 5: case 5:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 6: case 6:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 7: case 7:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 8: case 8:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 9: case 9:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 10: case 10:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 11: case 11:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 12: case 12:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 13: case 13:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 14: case 14:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 15: case 15:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 16: case 16:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 17: case 17:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 18: case 18:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 19: case 19:
if(LoadProperties.enderPearl && LoadProperties.fishingDrops) if(LoadProperties.enderPearl && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1)); theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 20: case 20:
if(LoadProperties.blazeRod && LoadProperties.fishingDrops) if(LoadProperties.blazeRod && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1)); theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 21: case 21:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 22: case 22:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 23: case 23:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_5, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_5, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
} }
} }
else if(theCatch.getItemStack().getType() != Material.RAW_FISH) {
{
theCatch.setItemStack(new ItemStack(Material.RAW_FISH, 1));
}
//Change durability to random value //Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value
} }
}
private static void getFishingResultsTier4(Player player, PlayerFishEvent event) private static void getFishingResultsTier4(Player player, PlayerFishEvent event)
{ {
int randomNum = (int)(Math.random() * 41); int randomNum = (int)(Math.random() * 41);
CraftItem theCatch = (CraftItem)event.getCaught(); CraftItem theCatch = (CraftItem)event.getCaught();
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
if(Math.random() * 100 < LoadProperties.fishingDropChanceTier4) if(Math.random() * 100 < LoadProperties.fishingDropChanceTier4)
{ {
@ -472,256 +358,176 @@ public class Fishing {
case 1: case 1:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 2: case 2:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 3: case 3:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 4: case 4:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 5: case 5:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 6: case 6:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 7: case 7:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 8: case 8:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 9: case 9:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 10: case 10:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 11: case 11:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 12: case 12:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 13: case 13:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 14: case 14:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 15: case 15:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 16: case 16:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 17: case 17:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 18: case 18:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 19: case 19:
if(LoadProperties.enderPearl && LoadProperties.fishingDrops) if(LoadProperties.enderPearl && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1)); theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 20: case 20:
if(LoadProperties.blazeRod && LoadProperties.fishingDrops) if(LoadProperties.blazeRod && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1)); theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 21: case 21:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 22: case 22:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 23: case 23:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_5, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_5, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 24: case 24:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 25: case 25:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 26: case 26:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 27: case 27:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 28: case 28:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 29: case 29:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 30: case 30:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 31: case 31:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 32: case 32:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 33: case 33:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_6, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_6, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 34: case 34:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_7, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_7, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 35: case 35:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_8, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_8, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 36: case 36:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_9, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_9, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 37: case 37:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_10, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_10, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 38: case 38:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_11, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_11, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 39: case 39:
if(LoadProperties.glowstoneDust && LoadProperties.fishingDrops) if(LoadProperties.glowstoneDust && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GLOWSTONE_DUST, 16)); theCatch.setItemStack(new ItemStack(Material.GLOWSTONE_DUST, 16));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 40: case 40:
if(LoadProperties.fishingDiamonds && LoadProperties.fishingDrops) if(LoadProperties.fishingDiamonds && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND, (int)(Math.random() * 10))); theCatch.setItemStack(new ItemStack(Material.DIAMOND, (int)(Math.random() * 10)));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
} }
} else
{
theCatch.setItemStack(new ItemStack(Material.RAW_FISH, 1));
} }
if(theCatch.getItemStack().getType() != Material.RAW_FISH) {
//Change durability to random value //Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value
} }
}
private static void getFishingResultsTier5(Player player, PlayerFishEvent event) private static void getFishingResultsTier5(Player player, PlayerFishEvent event)
{ {
int randomNum = (int)(Math.random() * 50); int randomNum = (int)(Math.random() * 50);
CraftItem theCatch = (CraftItem)event.getCaught(); CraftItem theCatch = (CraftItem)event.getCaught();
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
if(Math.random() * 100 < LoadProperties.fishingDropChanceTier5) if(Math.random() * 100 < LoadProperties.fishingDropChanceTier5)
{ {
@ -730,134 +536,90 @@ public class Fishing {
case 1: case 1:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 2: case 2:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 3: case 3:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 4: case 4:
if(LoadProperties.goldArmor && LoadProperties.fishingDrops) if(LoadProperties.goldArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 5: case 5:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 6: case 6:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 7: case 7:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 8: case 8:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 9: case 9:
if(LoadProperties.ironTools && LoadProperties.fishingDrops) if(LoadProperties.ironTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 10: case 10:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 11: case 11:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 12: case 12:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 13: case 13:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 14: case 14:
if(LoadProperties.goldTools && LoadProperties.fishingDrops) if(LoadProperties.goldTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.GOLD_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 15: case 15:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 16: case 16:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 17: case 17:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 18: case 18:
if(LoadProperties.ironArmor && LoadProperties.fishingDrops) if(LoadProperties.ironArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.IRON_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 19: case 19:
if(LoadProperties.enderPearl && LoadProperties.fishingDrops) if(LoadProperties.enderPearl && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1)); theCatch.setItemStack(new ItemStack(Material.ENDER_PEARL, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 20: case 20:
if(LoadProperties.blazeRod && LoadProperties.fishingDrops) if(LoadProperties.blazeRod && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1)); theCatch.setItemStack(new ItemStack(Material.BLAZE_ROD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 21: case 21:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_3, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 22: case 22:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_4, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 23: case 23:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
@ -867,166 +629,114 @@ public class Fishing {
case 24: case 24:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 25: case 25:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 26: case 26:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 27: case 27:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 28: case 28:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 29: case 29:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 30: case 30:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 31: case 31:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 32: case 32:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 33: case 33:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_6, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_6, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 34: case 34:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_7, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_7, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 35: case 35:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_8, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_8, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 36: case 36:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_9, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_9, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 37: case 37:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_10, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_10, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 38: case 38:
if(LoadProperties.records && LoadProperties.fishingDrops) if(LoadProperties.records && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.RECORD_11, 1)); theCatch.setItemStack(new ItemStack(Material.RECORD_11, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 39: case 39:
if(LoadProperties.glowstoneDust && LoadProperties.fishingDrops) if(LoadProperties.glowstoneDust && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.GLOWSTONE_DUST, 16)); theCatch.setItemStack(new ItemStack(Material.GLOWSTONE_DUST, 16));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 40: case 40:
if(LoadProperties.fishingDiamonds && LoadProperties.fishingDrops) if(LoadProperties.fishingDiamonds && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND, (int)(Math.random() * 20))); theCatch.setItemStack(new ItemStack(Material.DIAMOND, (int)(Math.random() * 20)));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 41: case 41:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_BOOTS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 42: case 42:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HELMET, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 43: case 43:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 44: case 44:
if(LoadProperties.diamondArmor && LoadProperties.fishingDrops) if(LoadProperties.diamondArmor && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 45: case 45:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_AXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 46: case 46:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_PICKAXE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 47: case 47:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SWORD, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 48: case 48:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_HOE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
case 49: case 49:
if(LoadProperties.diamondTools && LoadProperties.fishingDrops) if(LoadProperties.diamondTools && LoadProperties.fishingDrops)
theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1)); theCatch.setItemStack(new ItemStack(Material.DIAMOND_SPADE, 1));
else
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
break; break;
} }
} else {
theCatch.setItemStack(new ItemStack(Material.RAW_FISH, 1));
} }
if(theCatch.getItemStack().getType() != Material.RAW_FISH) {
//Change durability to random value //Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change the damage value
} }
}
public static void processResults(PlayerFishEvent event) public static void processResults(PlayerFishEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();