Skip to content

Commit

Permalink
Fix up aH compatibility with older commands and case-sensitivity on s…
Browse files Browse the repository at this point in the history
…cript: entity: item: duration: and location: arguments.
  • Loading branch information
aufdemrand committed Jul 27, 2013
1 parent b181f8c commit 9512764
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/net/aufdemrand/denizen/objects/aH.java
Expand Up @@ -425,7 +425,7 @@ public static EntityType getEntityTypeFrom(String arg) {

@Deprecated
public static dEntity getEntityFrom(String arg) {
arg = arg.replace("entity:", "");
arg = arg.toLowerCase().replace("entity:", "");
return dEntity.valueOf(arg);
}

Expand All @@ -447,7 +447,7 @@ public static int getIntegerFrom(String arg) {

@Deprecated
public static dItem getItemFrom(String arg) {
arg = arg.replace("item:", "");
arg = arg.toLowerCase().replace("item:", "");
dItem stack = dItem.valueOf(arg);
return stack;
}
Expand All @@ -459,13 +459,13 @@ public static dList getListFrom(String arg) {

@Deprecated
public static dLocation getLocationFrom(String arg) {
arg = arg.replace("location:", "");
arg = arg.toLowerCase().replace("location:", "");
return dLocation.valueOf(arg);
}

@Deprecated
public static dScript getScriptFrom(String arg) {
arg = arg.replace("script:", "");
arg = arg.toLowerCase().replace("script:", "");
return dScript.valueOf(arg);
}

Expand All @@ -486,7 +486,7 @@ public static String getStringFrom(String arg) {

@Deprecated
public static Duration getDurationFrom(String arg) {
arg = arg.replace("duration:", "").replace("delay:", "");
arg = arg.toLowerCase().replace("duration:", "").replace("delay:", "");
return Duration.valueOf(arg);
}

Expand All @@ -496,12 +496,12 @@ public static boolean matchesDouble(String arg) {

@Deprecated
public static boolean matchesDuration(String arg) {
arg = arg.replace("duration:", "").replace("delay:", "");
arg = arg.toLowerCase().replace("duration:", "").replace("delay:", "");
return Duration.matches(arg);
}

public static boolean matchesEntityType(String arg) {
arg = arg.replace("entity:", "");
arg = arg.toLowerCase().replace("entity:", "");

// Check against valid EntityTypes using Bukkit's EntityType enum
for (EntityType validEntity : EntityType.values())
Expand Down
Expand Up @@ -37,7 +37,7 @@ public static dInventory valueOf(String string) {
/**
* Determine whether a string is a valid inventory.
*
* @param string the string
* @param arg the arg string
* @return true if matched, otherwise false
*
*/
Expand Down

0 comments on commit 9512764

Please sign in to comment.