diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index 8f765dc0f..f79c94987 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -104,7 +104,7 @@ public class PartyCommand implements CommandExecutor { } // Party leader commands - if (!mcMMOPlayer.getParty().getLeader().equals(player.getName())) { + if (!mcMMOPlayer.getParty().getLeader().equalsIgnoreCase(player.getName())) { sender.sendMessage(LocaleLoader.getString("Party.NotOwner")); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index d079b5426..14304ba88 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -35,7 +35,7 @@ public class PartyInfoCommand implements CommandExecutor { StringBuilder memberList = new StringBuilder(); for (OfflinePlayer member : playerParty.getMembers()) { - if (playerParty.getLeader().equals(member.getName())) { + if (playerParty.getLeader().equalsIgnoreCase(member.getName())) { memberList.append(ChatColor.GOLD).append(member.getName()).append(" "); } else if (member.isOnline()) { diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index 0072863cd..0b3ade249 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -40,7 +40,7 @@ public class PartyRenameCommand implements CommandExecutor { return true; } - if (!member.getName().equals(leaderName)) { + if (!member.getName().equalsIgnoreCase(leaderName)) { member.sendMessage(LocaleLoader.getString("Party.InformedOnNameChange", leaderName, newPartyName)); } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index 8b36d2cf0..e8f4c14cd 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -92,7 +92,7 @@ public class PlayerProfile { } else { for (HudType type : HudType.values()) { - if (type.toString().equals(huds.get(1).get(0))) { + if (type.toString().equalsIgnoreCase(huds.get(1).get(0))) { hudType = type; } } @@ -186,7 +186,7 @@ public class PlayerProfile { // Find if the line contains the player we want. String[] character = line.split(":"); - if (!character[0].equals(playerName)) { + if (!character[0].equalsIgnoreCase(playerName)) { continue; } @@ -400,7 +400,7 @@ public class PlayerProfile { // While not at the end of the file while ((line = in.readLine()) != null) { // Read the line in and copy it to the output it's not the player we want to edit - if (!line.split(":")[0].equals(playerName)) { + if (!line.split(":")[0].equalsIgnoreCase(playerName)) { writer.append(line).append("\r\n"); } else { diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index b758e06ca..9770f71ed 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -75,7 +75,7 @@ public final class PartyManager { List nearMembers = new ArrayList(); if (party != null) { for (Player member : party.getOnlineMembers()) { - if (!player.getName().equals(member.getName()) && Misc.isNear(player.getLocation(), member.getLocation(), range)) { + if (!player.getName().equalsIgnoreCase(member.getName()) && Misc.isNear(player.getLocation(), member.getLocation(), range)) { nearMembers.add(member); } } @@ -150,7 +150,7 @@ public final class PartyManager { public static Party getPlayerParty(String playerName) { for (Party party : parties) { for (OfflinePlayer member : party.getMembers()) { - if (member.getName().equals(playerName)) { + if (member.getName().equalsIgnoreCase(playerName)) { return party; } } @@ -184,7 +184,7 @@ public final class PartyManager { } else { // If the leaving player was the party leader, appoint a new leader from the party members - if (party.getLeader().equals(player.getName())) { + if (party.getLeader().equalsIgnoreCase(player.getName())) { String newLeader = members.get(0).getName(); party.setLeader(newLeader); } @@ -374,10 +374,10 @@ public final class PartyManager { String leaderName = party.getLeader(); for (Player member : party.getOnlineMembers()) { - if (member.getName().equals(playerName)) { + if (member.getName().equalsIgnoreCase(playerName)) { member.sendMessage(LocaleLoader.getString("Party.Owner.Player")); } - else if (member.getName().equals(leaderName)) { + else if (member.getName().equalsIgnoreCase(leaderName)) { member.sendMessage(LocaleLoader.getString("Party.Owner.NotLeader")); } else { @@ -396,7 +396,7 @@ public final class PartyManager { * @return true if the player can invite */ public static boolean canInvite(Player player, Party party) { - if (party.isLocked() && !party.getLeader().equals(player.getName())) { + if (party.isLocked() && !party.getLeader().equalsIgnoreCase(player.getName())) { return false; } diff --git a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java index 4110b84f7..6dcd2f8b7 100644 --- a/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/commands/MctopCommandAsyncTask.java @@ -42,7 +42,7 @@ public class MctopCommandAsyncTask implements Runnable { mcMMO.p.getServer().getScheduler().scheduleSyncDelayedTask(mcMMO.p, new Runnable() { @Override public void run() { - if (query.equals("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")); } else { diff --git a/src/main/java/com/gmail/nossr50/runnables/database/SQLConversionTask.java b/src/main/java/com/gmail/nossr50/runnables/database/SQLConversionTask.java index 8297772f7..e2a840519 100644 --- a/src/main/java/com/gmail/nossr50/runnables/database/SQLConversionTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/database/SQLConversionTask.java @@ -55,7 +55,7 @@ public class SQLConversionTask implements Runnable { playerName = character[0]; // Check for things we don't want put in the DB - if (playerName == null || playerName.equals("null") || playerName.equals("#Storage place for user information")) { + if (playerName == null || playerName.equalsIgnoreCase("null") || playerName.equalsIgnoreCase("#Storage place for user information")) { continue; } diff --git a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java index ca7858ed9..ab512d769 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java @@ -45,7 +45,7 @@ public class ArcheryManager extends SkillManager { Location shooterLocation = player.getLocation(); Location targetLocation = target.getLocation(); - if (!shooterLocation.getWorld().equals(targetLocation.getWorld())) { + if (shooterLocation.getWorld() != targetLocation.getWorld()) { return; } diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index e19eebde6..cd018c33b 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -77,7 +77,7 @@ public final class Misc { * @return true if the distance between first and second is less than maxDistance, false otherwise */ public static boolean isNear(Location first, Location second, double maxDistance) { - if (!first.getWorld().equals(second.getWorld())) { + if (first.getWorld() != second.getWorld()) { return false; }