diff --git a/Changelog.txt b/Changelog.txt index b70d03990..e3958d94c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -14,7 +14,8 @@ Version 1.3.06-dev = Fixed bug where {0} would be displayed in front of your power level in mcstats = Fixed mmoupdate not being useable from console = Fixed bug with repairing wooden tools - = Fixed bug with Nether Wart not awarding XP + = Fixed bug with Nether Wart not awarding XP + = Fixed bug with fishing treasures when treasures list is empty ! Changed mcremove to no longer kick players when they are removed from database ! Changed mcremove to work on offline users for FlatFile ! Changed PlayerProfile constructor to always take a boolean diff --git a/src/main/java/com/gmail/nossr50/skills/Fishing.java b/src/main/java/com/gmail/nossr50/skills/Fishing.java index 96a6203e7..a74c5e82f 100644 --- a/src/main/java/com/gmail/nossr50/skills/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/Fishing.java @@ -98,11 +98,13 @@ public class Fishing { } if (LoadProperties.fishingDrops) { - FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); + if (rewards.size() > 0) { + FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); - if (random.nextDouble() * 100 <= treasure.getDropChance()) { - Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp()); - theCatch.setItemStack(treasure.getDrop()); + if (random.nextDouble() * 100 <= treasure.getDropChance()) { + Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp()); + theCatch.setItemStack(treasure.getDrop()); + } } } else { @@ -115,7 +117,6 @@ public class Fishing { theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); //Change durability to random value } - m.mcDropItem(player.getLocation(), new ItemStack(Material.RAW_FISH)); //Always drop a fish PP.addXP(SkillType.FISHING, LoadProperties.mfishing); Skills.XpCheckSkill(SkillType.FISHING, player); }