mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 08:55:26 +01:00
Fix Fishing using values from the wrong config
This commit is contained in:
parent
ac31a3dc0e
commit
bdee0278a5
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.config.treasure.TreasureConfig;
|
||||
import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.treasure.Rarity;
|
||||
@ -55,19 +55,19 @@ public class FishingCommand extends SkillCommand {
|
||||
lootTier = fishingManager.getLootTier();
|
||||
|
||||
// Item drop rates
|
||||
commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
|
||||
uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
|
||||
rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
|
||||
epicTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.EPIC) / 100.0);
|
||||
legendaryTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.LEGENDARY) / 100.0);
|
||||
mythicTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.MYTHIC) / 100.0);
|
||||
commonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
|
||||
uncommonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
|
||||
rareTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
|
||||
epicTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.EPIC) / 100.0);
|
||||
legendaryTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.LEGENDARY) / 100.0);
|
||||
mythicTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.MYTHIC) / 100.0);
|
||||
|
||||
// Magic hunter drop rates
|
||||
double totalEnchantChance = 0;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
if (rarity != Rarity.MYTHIC) {
|
||||
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
totalEnchantChance += FishingTreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ package com.gmail.nossr50.config.treasure;
|
||||
import com.gmail.nossr50.config.ConfigLoader;
|
||||
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
|
||||
import com.gmail.nossr50.datatypes.treasure.Rarity;
|
||||
import com.gmail.nossr50.util.text.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -234,12 +233,4 @@ public class TreasureConfig extends ConfigLoader {
|
||||
hylianMap.put(dropper, new ArrayList<>());
|
||||
hylianMap.get(dropper).add(treasure);
|
||||
}
|
||||
|
||||
public double getItemDropRate(int tier, Rarity rarity) {
|
||||
return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString());
|
||||
}
|
||||
|
||||
public double getEnchantmentDropRate(int tier, Rarity rarity) {
|
||||
return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString());
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
|
||||
import com.gmail.nossr50.config.treasure.TreasureConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
@ -609,7 +608,7 @@ public class FishingManager extends SkillManager {
|
||||
FishingTreasure treasure = null;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
double dropRate = TreasureConfig.getInstance().getItemDropRate(getLootTier(), rarity);
|
||||
double dropRate = FishingTreasureConfig.getInstance().getItemDropRate(getLootTier(), rarity);
|
||||
|
||||
if (diceRoll <= dropRate) {
|
||||
|
||||
@ -660,7 +659,7 @@ public class FishingManager extends SkillManager {
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
|
||||
double dropRate = TreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
|
||||
double dropRate = FishingTreasureConfig.getInstance().getEnchantmentDropRate(getLootTier(), rarity);
|
||||
|
||||
if (diceRoll <= dropRate) {
|
||||
// Make sure enchanted books always get some kind of enchantment. --hoorigan
|
||||
|
Loading…
x
Reference in New Issue
Block a user