mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Using .equals() is better
This commit is contained in:
		@@ -107,7 +107,7 @@ public class MctopCommand implements CommandExecutor {
 | 
				
			|||||||
    private void flatfileDisplay(int page, String skill, CommandSender sender) {
 | 
					    private void flatfileDisplay(int page, String skill, CommandSender sender) {
 | 
				
			||||||
        String[] info = Leaderboard.retrieveInfo(skill, page);
 | 
					        String[] info = Leaderboard.retrieveInfo(skill, page);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (skill == "ALL") {
 | 
					        if (skill.equals("ALL")) {
 | 
				
			||||||
            sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
 | 
					            sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
@@ -136,7 +136,7 @@ public class MctopCommand implements CommandExecutor {
 | 
				
			|||||||
        String tablePrefix = Config.getInstance().getMySQLTablePrefix();
 | 
					        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 ");
 | 
					        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"));
 | 
					            sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,7 @@ public class CustomBlocksConfig extends ConfigLoader {
 | 
				
			|||||||
                continue;
 | 
					                continue;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (skillType == "Ability_Blocks") {
 | 
					            if (skillType.equals("Ability_Blocks")) {
 | 
				
			||||||
                blockItem = new ItemStack(id, 1, (short) 0, data);
 | 
					                blockItem = new ItemStack(id, 1, (short) 0, data);
 | 
				
			||||||
                blockList.add(blockItem);
 | 
					                blockList.add(blockItem);
 | 
				
			||||||
                continue;
 | 
					                continue;
 | 
				
			||||||
@@ -94,10 +94,10 @@ public class CustomBlocksConfig extends ConfigLoader {
 | 
				
			|||||||
            block = new CustomBlock(minimumDropAmount, maxiumDropAmount, itemDrop, tier, xp, data, id);
 | 
					            block = new CustomBlock(minimumDropAmount, maxiumDropAmount, itemDrop, tier, xp, data, id);
 | 
				
			||||||
            blockItem = new ItemStack(id, 1, (short) 0, data);
 | 
					            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);
 | 
					                customOres.add(blockItem);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (skillType == "Woodcutting") {
 | 
					            else if (skillType.equals("Woodcutting")) {
 | 
				
			||||||
                if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) {
 | 
					                if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) {
 | 
				
			||||||
                    customLogs.add(blockItem);
 | 
					                    customLogs.add(blockItem);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user