Using .equals() is better

This commit is contained in:
GJ 2012-07-05 09:25:48 -04:00
parent d6d1e0ffed
commit 62b90ad552
2 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ public class MctopCommand implements CommandExecutor {
private void flatfileDisplay(int page, String skill, CommandSender sender) {
String[] info = Leaderboard.retrieveInfo(skill, page);
if (skill == "ALL") {
if (skill.equals("ALL")) {
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
}
else {
@ -136,7 +136,7 @@ public class MctopCommand implements CommandExecutor {
String tablePrefix = Config.getInstance().getMySQLTablePrefix();
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC ");
if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") {
if (query.equals("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) {
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
}
else {

View File

@ -73,7 +73,7 @@ public class CustomBlocksConfig extends ConfigLoader {
continue;
}
if (skillType == "Ability_Blocks") {
if (skillType.equals("Ability_Blocks")) {
blockItem = new ItemStack(id, 1, (short) 0, data);
blockList.add(blockItem);
continue;
@ -94,10 +94,10 @@ public class CustomBlocksConfig extends ConfigLoader {
block = new CustomBlock(minimumDropAmount, maxiumDropAmount, itemDrop, tier, xp, data, id);
blockItem = new ItemStack(id, 1, (short) 0, data);
if (skillType == "Mining" && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) {
if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) {
customOres.add(blockItem);
}
else if (skillType == "Woodcutting") {
else if (skillType.equals("Woodcutting")) {
if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) {
customLogs.add(blockItem);
}