mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-13 09:45:27 +02:00
Treasure code removed pending rewrite
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
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;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.fishing.Fishing;
|
||||
import com.gmail.nossr50.skills.fishing.FishingManager;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -54,34 +49,34 @@ public class FishingCommand extends SkillCommand {
|
||||
lootTier = fishingManager.getLootTier();
|
||||
|
||||
// Item drop rates
|
||||
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);
|
||||
recordTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RECORD) / 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);
|
||||
// recordTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RECORD) / 100.0);
|
||||
//
|
||||
// // Magic hunter drop rates
|
||||
// double totalEnchantChance = 0;
|
||||
//
|
||||
// for (Rarity rarity : Rarity.values()) {
|
||||
// if (rarity != Rarity.RECORD) {
|
||||
// totalEnchantChance += FishingTreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Magic hunter drop rates
|
||||
double totalEnchantChance = 0;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
if (rarity != Rarity.RECORD) {
|
||||
totalEnchantChance += FishingTreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
}
|
||||
}
|
||||
|
||||
if (totalEnchantChance >= 1)
|
||||
magicChance = percent.format(totalEnchantChance / 100.0);
|
||||
else
|
||||
magicChance = percent.format(0);
|
||||
// if (totalEnchantChance >= 1)
|
||||
// magicChance = percent.format(totalEnchantChance / 100.0);
|
||||
// else
|
||||
// magicChance = percent.format(0);
|
||||
}
|
||||
|
||||
// FISHING_SHAKE
|
||||
if (canShake) {
|
||||
String[] shakeStrings = pluginRef.getRandomChanceTools().calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());
|
||||
shakeChance = shakeStrings[0];
|
||||
shakeChanceLucky = shakeStrings[1];
|
||||
}
|
||||
// if (canShake) {
|
||||
// String[] shakeStrings = pluginRef.getRandomChanceTools().calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());
|
||||
// shakeChance = shakeStrings[0];
|
||||
// shakeChanceLucky = shakeStrings[1];
|
||||
// }
|
||||
|
||||
// FISHERMAN'S DIET
|
||||
if (canFishermansDiet) {
|
||||
@@ -98,13 +93,13 @@ public class FishingCommand extends SkillCommand {
|
||||
location = player.getLocation();
|
||||
}
|
||||
|
||||
if (Fishing.getInstance().getMasterAnglerBiomes().contains(location.getBlock().getBiome())) {
|
||||
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
|
||||
}
|
||||
// if (Fishing.getInstance().getMasterAnglerBiomes().contains(location.getBlock().getBiome())) {
|
||||
// rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
|
||||
// }
|
||||
|
||||
if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
|
||||
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
|
||||
}
|
||||
// if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
|
||||
// rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
|
||||
// }
|
||||
|
||||
double luckyModifier = pluginRef.getPermissionTools().lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D;
|
||||
|
||||
@@ -135,9 +130,9 @@ public class FishingCommand extends SkillCommand {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank)));
|
||||
}
|
||||
|
||||
if (canIceFish) {
|
||||
messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription()));
|
||||
}
|
||||
// if (canIceFish) {
|
||||
// messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription()));
|
||||
// }
|
||||
|
||||
if (canMagicHunt) {
|
||||
messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance));
|
||||
|
Reference in New Issue
Block a user