mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Fixed bug with fishing treasures throwing an error when treasures list
is empty.
This commit is contained in:
parent
35f62d4e45
commit
f6a6316b7a
@ -15,6 +15,7 @@ Version 1.3.06-dev
|
||||
= Fixed mmoupdate not being useable from console
|
||||
= Fixed bug with repairing wooden tools
|
||||
= 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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user