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;
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.");
}
}

View File

@ -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<String, Integer> skills;
private final CommandSender sender;
private final String playerName;
public McrankCommandDisplayTask(Map<String, Integer> 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<String, Integer> skills;
private final CommandSender sender;
private final String playerName;
public McrankCommandDisplayTask(Map<String, Integer> 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")));
}
}
}

View File

@ -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<Integer, ArrayList<String>> userslist;
private CommandSender sender;
private String query;
private int page;
public MctopCommandDisplayTask(HashMap<Integer, ArrayList<String>> 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<Integer, ArrayList<String>> userslist;
private CommandSender sender;
private String query;
private int page;
public MctopCommandDisplayTask(HashMap<Integer, ArrayList<String>> 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"));
}
}

View File

@ -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();
}