From 64eda8f1bd86a13df54114fe953c05309315f652 Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sun, 15 Sep 2013 15:04:59 +0200 Subject: [PATCH] CommandBlocker ignore case --- .../minecraft/limitedcreative/cmdblocker/RegexpBlockEntry.java | 2 +- .../minecraft/limitedcreative/cmdblocker/StringBlockEntry.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/RegexpBlockEntry.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/RegexpBlockEntry.java index ac1db19..43ee2de 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/RegexpBlockEntry.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/RegexpBlockEntry.java @@ -5,7 +5,7 @@ import java.util.regex.Pattern; public class RegexpBlockEntry implements ICmdBlockEntry { private Pattern rx; public RegexpBlockEntry(String regex) { - rx = Pattern.compile(regex); + rx = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); } @Override diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/StringBlockEntry.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/StringBlockEntry.java index 8a3911d..aabd60b 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/StringBlockEntry.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/StringBlockEntry.java @@ -8,7 +8,7 @@ public class StringBlockEntry implements ICmdBlockEntry { @Override public boolean test(String cmd) { - return cmd.startsWith(this.str); + return cmd.toLowerCase().startsWith(this.str.toLowerCase()); } public String toString() {