Normalize line endings

This commit is contained in:
TfT_02 2013-03-21 20:46:23 +01:00
parent 399bf8e3b9
commit 9730cdb880
4 changed files with 149 additions and 149 deletions

View File

@ -1,9 +1,9 @@
package com.gmail.nossr50.api; package com.gmail.nossr50.api;
public class InvalidPlayerException extends RuntimeException { public class InvalidPlayerException extends RuntimeException {
private static final long serialVersionUID = 907213002618581385L; private static final long serialVersionUID = 907213002618581385L;
public InvalidPlayerException() { public InvalidPlayerException() {
super("That player does not exist in the database."); super("That player does not exist in the database.");
} }
} }

View File

@ -1,50 +1,50 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import java.util.Map; import java.util.Map;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.skills.SkillUtils;
public class McrankCommandDisplayTask extends BukkitRunnable { public class McrankCommandDisplayTask extends BukkitRunnable {
private final Map<String, Integer> skills; private final Map<String, Integer> skills;
private final CommandSender sender; private final CommandSender sender;
private final String playerName; private final String playerName;
public McrankCommandDisplayTask(Map<String, Integer> skills, CommandSender sender, String playerName) { public McrankCommandDisplayTask(Map<String, Integer> skills, CommandSender sender, String playerName) {
this.skills = skills; this.skills = skills;
this.sender = sender; this.sender = sender;
this.playerName = playerName; this.playerName = playerName;
} }
@Override @Override
public void run() { public void run() {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading")); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName)); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName));
for (SkillType skillType : SkillType.values()) { for (SkillType skillType : SkillType.values()) {
if ((sender instanceof Player && !Permissions.skillEnabled(sender, skillType)) || skillType.isChildSkill()) { if ((sender instanceof Player && !Permissions.skillEnabled(sender, skillType)) || skillType.isChildSkill()) {
continue; continue;
} }
if (skills.get(skillType.name()) == null) { if (skills.get(skillType.name()) == null) {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked"))); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked")));
} }
else { else {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), skills.get(skillType.name()))); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), skills.get(skillType.name())));
} }
} }
if (skills.get("ALL") == null) { if (skills.get("ALL") == null) {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", LocaleLoader.getString("Commands.mcrank.Unranked"))); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", LocaleLoader.getString("Commands.mcrank.Unranked")));
} }
else { else {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", skills.get("ALL"))); sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", skills.get("ALL")));
} }
} }
} }

View File

@ -1,48 +1,48 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
public class MctopCommandDisplayTask extends BukkitRunnable { public class MctopCommandDisplayTask extends BukkitRunnable {
private HashMap<Integer, ArrayList<String>> userslist; private HashMap<Integer, ArrayList<String>> userslist;
private CommandSender sender; private CommandSender sender;
private String query; private String query;
private int page; private int page;
public MctopCommandDisplayTask(HashMap<Integer, ArrayList<String>> userslist, int page, String query, CommandSender sender) { public MctopCommandDisplayTask(HashMap<Integer, ArrayList<String>> userslist, int page, String query, CommandSender sender) {
this.userslist = userslist; this.userslist = userslist;
this.page = page; this.page = page;
this.query = query; this.query = query;
this.sender = sender; this.sender = sender;
} }
@Override @Override
public void run() { public void run() {
if (query.equalsIgnoreCase("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) { if (query.equalsIgnoreCase("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) {
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
} }
else { else {
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", StringUtils.getCapitalized(query))); sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", StringUtils.getCapitalized(query)));
} }
int place = (page * 10) - 9; int place = (page * 10) - 9;
for (int i = 1; i <= 10; i++) { for (int i = 1; i <= 10; i++) {
if (userslist.get(i) == null) { if (userslist.get(i) == null) {
break; break;
} }
// Format: 1. Playername - skill value // Format: 1. Playername - skill value
sender.sendMessage(place + ". " + ChatColor.GREEN + userslist.get(i).get(1) + " - " + ChatColor.WHITE + userslist.get(i).get(0)); sender.sendMessage(place + ". " + ChatColor.GREEN + userslist.get(i).get(1) + " - " + ChatColor.WHITE + userslist.get(i).get(0));
place++; place++;
} }
sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip"));
} }
} }

View File

@ -1,42 +1,42 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
public class ArcaneForging { public class ArcaneForging {
// The order of the values is extremely important, a few methods depend on it to work properly // The order of the values is extremely important, a few methods depend on it to work properly
protected enum Tier { protected enum Tier {
FOUR(4) { FOUR(4) {
@Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels4(); } @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels4(); }
@Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank4(); } @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank4(); }
@Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank4(); }}, @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank4(); }},
THREE(3) { THREE(3) {
@Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels3(); } @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels3(); }
@Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank3(); } @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank3(); }
@Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank3(); }}, @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank3(); }},
TWO(2) { TWO(2) {
@Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels2(); } @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels2(); }
@Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank2(); } @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank2(); }
@Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank2(); }}, @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank2(); }},
ONE(1) { ONE(1) {
@Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels1(); } @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels1(); }
@Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank1(); } @Override public int getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank1(); }
@Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank1(); }}; @Override public int getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank1(); }};
int numerical; int numerical;
private Tier(int numerical) { private Tier(int numerical) {
this.numerical = numerical; this.numerical = numerical;
} }
public int toNumerical() { public int toNumerical() {
return numerical; return numerical;
} }
abstract protected int getLevel(); abstract protected int getLevel();
abstract protected int getKeepEnchantChance(); abstract protected int getKeepEnchantChance();
abstract protected int getDowngradeEnchantChance(); abstract protected int getDowngradeEnchantChance();
} }
public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled();
public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled(); public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled();
} }