From ed4dd5711eb4e0a6fcabc803144a5142bf305abe Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 23 Jun 2013 20:14:19 +0200 Subject: [PATCH] Make gate ids case insensitive. --- src/de/craftinc/gates/Gate.java | 4 ++-- src/de/craftinc/gates/GatesManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de/craftinc/gates/Gate.java b/src/de/craftinc/gates/Gate.java index e96c40b..6f2d069 100644 --- a/src/de/craftinc/gates/Gate.java +++ b/src/de/craftinc/gates/Gate.java @@ -43,9 +43,9 @@ public class Gate implements ConfigurationSerializable * You should never create two gates with the same 'id'. Also see 'setId(String id)'. * @param id This parameter must not be 'null'. An exception will be thrown otherwise! */ - public Gate(String id) + public Gate(final String id) { - setId(id); + setId(id.toLowerCase()); } diff --git a/src/de/craftinc/gates/GatesManager.java b/src/de/craftinc/gates/GatesManager.java index e3fb97a..a7adac7 100644 --- a/src/de/craftinc/gates/GatesManager.java +++ b/src/de/craftinc/gates/GatesManager.java @@ -56,7 +56,7 @@ public class GatesManager public Gate getGateWithId(final String id) { - return gatesById.get(id); + return gatesById.get(id.toLowerCase()); } @@ -484,7 +484,7 @@ public class GatesManager public boolean gateExists(final String id) { - return gatesById.containsKey(id); + return gatesById.containsKey(id.toLowerCase()); }