mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Scale fishing drop chance by lure rather than subtracting 1
Fixes mcMMO-Dev/mcMMO#3383 Added config option for lure enchantment modifier Fixes lure enchantment having no effect on drops from offhand
This commit is contained in:
@ -478,7 +478,18 @@ public class FishingManager extends SkillManager {
|
||||
*/
|
||||
private FishingTreasure getFishingTreasure() {
|
||||
double diceRoll = Misc.getRandom().nextDouble() * 100;
|
||||
diceRoll -= getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||
int luck;
|
||||
|
||||
if (getPlayer().getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
||||
luck = getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||
}
|
||||
else {
|
||||
// We know something was caught, so if the rod wasn't in the main hand it must be in the offhand
|
||||
luck = getPlayer().getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||
}
|
||||
|
||||
// Rather than subtracting luck (and causing a minimum 3% chance for every drop), scale by luck.
|
||||
diceRoll *= (1.0 - luck * Config.getInstance().getFishingLureModifier() / 100);
|
||||
|
||||
FishingTreasure treasure = null;
|
||||
|
||||
|
Reference in New Issue
Block a user