mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Move fishing treasues to new file fishing_treasures.yml, replace Records rarity with Mythic, and allow for Enchanted_Book in the treasures list with new optional whitelist/blacklist parameters
read the changelog for information about this
This commit is contained in:
@ -0,0 +1,57 @@
|
||||
//package com.gmail.nossr50.commands.admin;
|
||||
//
|
||||
//import com.gmail.nossr50.config.treasure.FishingTreasureConfig;
|
||||
//import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
//import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
||||
//import com.gmail.nossr50.datatypes.treasure.Rarity;
|
||||
//import com.gmail.nossr50.mcMMO;
|
||||
//import com.gmail.nossr50.skills.fishing.FishingManager;
|
||||
//import com.gmail.nossr50.util.player.UserManager;
|
||||
//import org.bukkit.Location;
|
||||
//import org.bukkit.command.Command;
|
||||
//import org.bukkit.command.CommandExecutor;
|
||||
//import org.bukkit.command.CommandSender;
|
||||
//import org.bukkit.entity.Player;
|
||||
//import org.jetbrains.annotations.NotNull;
|
||||
//
|
||||
//public class DropTreasureCommand implements CommandExecutor {
|
||||
// @Override
|
||||
// public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
// if(sender instanceof Player) {
|
||||
// if(!sender.isOp()) {
|
||||
// sender.sendMessage("This command is for Operators only");
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// Player player = (Player) sender;
|
||||
// Location location = player.getLocation();
|
||||
// McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
|
||||
//
|
||||
// if(mmoPlayer == null) {
|
||||
// //TODO: Localize
|
||||
// player.sendMessage("Your player data is not loaded yet");
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// if(args.length == 0) {
|
||||
// mcMMO.p.getLogger().info(player.toString() +" is dropping all mcMMO treasures via admin command at location "+location.toString());
|
||||
// for(Rarity rarity : FishingTreasureConfig.getInstance().fishingRewards.keySet()) {
|
||||
// for(FishingTreasure fishingTreasure : FishingTreasureConfig.getInstance().fishingRewards.get(rarity)) {
|
||||
// FishingManager fishingManager = mmoPlayer.getFishingManager();
|
||||
// }
|
||||
// }
|
||||
// //TODO: impl
|
||||
// } else {
|
||||
// String targetTreasure = args[1];
|
||||
//
|
||||
// //Drop all treasures matching the name
|
||||
// //TODO: impl
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// } else {
|
||||
// sender.sendMessage("No console support for this command");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -29,7 +29,7 @@ public class FishingCommand extends SkillCommand {
|
||||
private String rareTreasure;
|
||||
private String epicTreasure;
|
||||
private String legendaryTreasure;
|
||||
private String recordTreasure;
|
||||
private String mythicTreasure;
|
||||
|
||||
private String magicChance;
|
||||
|
||||
@ -60,13 +60,13 @@ public class FishingCommand extends SkillCommand {
|
||||
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);
|
||||
recordTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RECORD) / 100.0);
|
||||
mythicTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.MYTHIC) / 100.0);
|
||||
|
||||
// Magic hunter drop rates
|
||||
double totalEnchantChance = 0;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
if (rarity != Rarity.RECORD) {
|
||||
if (rarity != Rarity.MYTHIC) {
|
||||
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
}
|
||||
}
|
||||
@ -145,7 +145,7 @@ public class FishingCommand extends SkillCommand {
|
||||
String.valueOf(rareTreasure),
|
||||
String.valueOf(epicTreasure),
|
||||
String.valueOf(legendaryTreasure),
|
||||
String.valueOf(recordTreasure)));
|
||||
String.valueOf(mythicTreasure)));
|
||||
}
|
||||
|
||||
return messages;
|
||||
|
Reference in New Issue
Block a user