From bd22b29b21ee482ad173ce0b394a05358a0160aa Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sat, 25 Feb 2012 17:19:14 +0100 Subject: [PATCH] i failed again on java string comparison --- .../jaschastarke/minecraft/worldguard/CListener.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/de/jaschastarke/minecraft/worldguard/CListener.java b/src/de/jaschastarke/minecraft/worldguard/CListener.java index 08d5f35..c351355 100644 --- a/src/de/jaschastarke/minecraft/worldguard/CListener.java +++ b/src/de/jaschastarke/minecraft/worldguard/CListener.java @@ -81,12 +81,11 @@ public class CListener implements Listener { public void onPlayerComamnd(PlayerCommandPreprocessEvent event) { String[] cmd = event.getMessage().split(" "); if (cmd.length >= 2) { - if (cmd[0].replaceAll("/", "").toLowerCase() == "region") { - String opt = cmd[1].toLowerCase(); - if (opt == "addowner" || opt == "addmember" || - opt == "removeowner" || opt == "remowner" || - opt == "removemember" || opt == "remmember" || - opt == "removemem" || opt == "remmem") { + if (cmd[0].replaceAll("/", "").equalsIgnoreCase("region")) { + if (cmd[1].equalsIgnoreCase("addowner") || cmd[1].equalsIgnoreCase("addmember") || + cmd[1].equalsIgnoreCase("removeowner") || cmd[1].equalsIgnoreCase("remowner") || + cmd[1].equalsIgnoreCase("removemember") || cmd[1].equalsIgnoreCase("remmember") || + cmd[1].equalsIgnoreCase("removemem") || cmd[1].equalsIgnoreCase("remmem")) { CPlayer.clear(); } }