mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Randomize the treasure drop amounts instead of always dropping everything
For example, the guaranteed 5 diamonds will now be a 1-5 diamond drop.
This commit is contained in:
parent
9349416326
commit
748dba41dc
@ -485,6 +485,10 @@ public class FishingManager extends SkillManager {
|
|||||||
treasureDrop.setDurability((short) (Misc.getRandom().nextInt(maxDurability)));
|
treasureDrop.setDurability((short) (Misc.getRandom().nextInt(maxDurability)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (treasureDrop.getAmount() > 1) {
|
||||||
|
treasureDrop.setAmount(Misc.getRandom().nextInt(treasureDrop.getAmount()) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
treasure.setDrop(treasureDrop);
|
treasure.setDrop(treasureDrop);
|
||||||
|
|
||||||
return treasure;
|
return treasure;
|
||||||
|
Loading…
Reference in New Issue
Block a user