From 9730cdb880ba45ebd96c1cffab6c242310a18743 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Thu, 21 Mar 2013 20:46:23 +0100 Subject: [PATCH] Normalize line endings --- .../nossr50/api/InvalidPlayerException.java | 18 ++-- .../commands/McrankCommandDisplayTask.java | 100 +++++++++--------- .../commands/MctopCommandDisplayTask.java | 96 ++++++++--------- .../nossr50/skills/repair/ArcaneForging.java | 84 +++++++-------- 4 files changed, 149 insertions(+), 149 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/api/InvalidPlayerException.java b/src/main/java/com/gmail/nossr50/api/InvalidPlayerException.java index 6d9b31f82..a1ff9e847 100644 --- a/src/main/java/com/gmail/nossr50/api/InvalidPlayerException.java +++ b/src/main/java/com/gmail/nossr50/api/InvalidPlayerException.java @@ -1,9 +1,9 @@ -package com.gmail.nossr50.api; - -public class InvalidPlayerException extends RuntimeException { - private static final long serialVersionUID = 907213002618581385L; - - public InvalidPlayerException() { - super("That player does not exist in the database."); - } -} +package com.gmail.nossr50.api; + +public class InvalidPlayerException extends RuntimeException { + private static final long serialVersionUID = 907213002618581385L; + + public InvalidPlayerException() { + super("That player does not exist in the database."); + } +} diff --git a/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java b/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java index 5b18d86d4..d322ae28b 100644 --- a/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/commands/McrankCommandDisplayTask.java @@ -1,50 +1,50 @@ -package com.gmail.nossr50.runnables.commands; - -import java.util.Map; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; - -import com.gmail.nossr50.datatypes.skills.SkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.skills.SkillUtils; - -public class McrankCommandDisplayTask extends BukkitRunnable { - private final Map skills; - private final CommandSender sender; - private final String playerName; - - public McrankCommandDisplayTask(Map skills, CommandSender sender, String playerName) { - this.skills = skills; - this.sender = sender; - this.playerName = playerName; - } - - @Override - public void run() { - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading")); - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName)); - - for (SkillType skillType : SkillType.values()) { - if ((sender instanceof Player && !Permissions.skillEnabled(sender, skillType)) || skillType.isChildSkill()) { - continue; - } - - if (skills.get(skillType.name()) == null) { - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked"))); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), skills.get(skillType.name()))); - } - } - - if (skills.get("ALL") == null) { - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", LocaleLoader.getString("Commands.mcrank.Unranked"))); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", skills.get("ALL"))); - } - } -} +package com.gmail.nossr50.runnables.commands; + +import java.util.Map; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.datatypes.skills.SkillType; +import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.skills.SkillUtils; + +public class McrankCommandDisplayTask extends BukkitRunnable { + private final Map skills; + private final CommandSender sender; + private final String playerName; + + public McrankCommandDisplayTask(Map skills, CommandSender sender, String playerName) { + this.skills = skills; + this.sender = sender; + this.playerName = playerName; + } + + @Override + public void run() { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading")); + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName)); + + for (SkillType skillType : SkillType.values()) { + if ((sender instanceof Player && !Permissions.skillEnabled(sender, skillType)) || skillType.isChildSkill()) { + continue; + } + + if (skills.get(skillType.name()) == null) { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked"))); + } + else { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), skills.get(skillType.name()))); + } + } + + if (skills.get("ALL") == null) { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", LocaleLoader.getString("Commands.mcrank.Unranked"))); + } + else { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", skills.get("ALL"))); + } + } +} diff --git a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java index 6fd9e1ef2..472bb8e8b 100644 --- a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandDisplayTask.java @@ -1,48 +1,48 @@ -package com.gmail.nossr50.runnables.commands; - -import java.util.ArrayList; -import java.util.HashMap; - -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.scheduler.BukkitRunnable; - -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.StringUtils; - -public class MctopCommandDisplayTask extends BukkitRunnable { - private HashMap> userslist; - private CommandSender sender; - private String query; - private int page; - - public MctopCommandDisplayTask(HashMap> userslist, int page, String query, CommandSender sender) { - this.userslist = userslist; - this.page = page; - this.query = query; - this.sender = sender; - } - - @Override - public void run() { - if (query.equalsIgnoreCase("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) { - sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", StringUtils.getCapitalized(query))); - } - - int place = (page * 10) - 9; - for (int i = 1; i <= 10; i++) { - if (userslist.get(i) == null) { - break; - } - - // Format: 1. Playername - skill value - sender.sendMessage(place + ". " + ChatColor.GREEN + userslist.get(i).get(1) + " - " + ChatColor.WHITE + userslist.get(i).get(0)); - place++; - } - - sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); - } -} +package com.gmail.nossr50.runnables.commands; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; +import org.bukkit.scheduler.BukkitRunnable; + +import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.util.StringUtils; + +public class MctopCommandDisplayTask extends BukkitRunnable { + private HashMap> userslist; + private CommandSender sender; + private String query; + private int page; + + public MctopCommandDisplayTask(HashMap> userslist, int page, String query, CommandSender sender) { + this.userslist = userslist; + this.page = page; + this.query = query; + this.sender = sender; + } + + @Override + public void run() { + if (query.equalsIgnoreCase("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) { + sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); + } + else { + sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", StringUtils.getCapitalized(query))); + } + + int place = (page * 10) - 9; + for (int i = 1; i <= 10; i++) { + if (userslist.get(i) == null) { + break; + } + + // Format: 1. Playername - skill value + sender.sendMessage(place + ". " + ChatColor.GREEN + userslist.get(i).get(1) + " - " + ChatColor.WHITE + userslist.get(i).get(0)); + place++; + } + + sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); + } +} diff --git a/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java b/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java index b16a20bd4..262f981c6 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java @@ -1,42 +1,42 @@ -package com.gmail.nossr50.skills.repair; - -import com.gmail.nossr50.config.AdvancedConfig; - -public class ArcaneForging { - // The order of the values is extremely important, a few methods depend on it to work properly - protected enum Tier { - FOUR(4) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels4(); } - @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank4(); } - @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank4(); }}, - THREE(3) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels3(); } - @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank3(); } - @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank3(); }}, - TWO(2) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels2(); } - @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank2(); } - @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank2(); }}, - ONE(1) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels1(); } - @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank1(); } - @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank1(); }}; - - int numerical; - - private Tier(int numerical) { - this.numerical = numerical; - } - - public int toNumerical() { - return numerical; - } - - abstract protected int getLevel(); - abstract protected int getKeepEnchantChance(); - abstract protected int getDowngradeEnchantChance(); - } - - public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); - public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled(); -} +package com.gmail.nossr50.skills.repair; + +import com.gmail.nossr50.config.AdvancedConfig; + +public class ArcaneForging { + // The order of the values is extremely important, a few methods depend on it to work properly + protected enum Tier { + FOUR(4) { + @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels4(); } + @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank4(); } + @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank4(); }}, + THREE(3) { + @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels3(); } + @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank3(); } + @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank3(); }}, + TWO(2) { + @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels2(); } + @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank2(); } + @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank2(); }}, + ONE(1) { + @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels1(); } + @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank1(); } + @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank1(); }}; + + int numerical; + + private Tier(int numerical) { + this.numerical = numerical; + } + + public int toNumerical() { + return numerical; + } + + abstract protected int getLevel(); + abstract protected int getKeepEnchantChance(); + abstract protected int getDowngradeEnchantChance(); + } + + public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); + public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled(); +}