Renamed types, fixed error where you couldn't set the type of disguised.

This commit is contained in:
libraryaddict 2013-11-24 09:08:37 +13:00
parent bb15a52022
commit 97452d516d

View File

@ -307,37 +307,38 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
} else if (param.getSimpleName().equals("Color")) {
try {
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
} catch (Exception ex) {
throw parseToException("horse color", valueString, methodName);
throw parseToException("a horse color", valueString, methodName);
}
// Parse to horse style
} else if (param.getSimpleName().equals("Style")) {
try {
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
} catch (Exception ex) {
throw parseToException("horse style", valueString, methodName);
throw parseToException("a horse style", valueString, methodName);
}
// Parse to villager profession
} else if (param.getSimpleName().equals("Profession")) {
try {
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
} catch (Exception ex) {
throw parseToException("villager profession", valueString, methodName);
throw parseToException("a villager profession", valueString, methodName);
}
// Parse to ocelot type
} else if (param.getSimpleName().equals("Art")) {
try {
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
} catch (Exception ex) {
throw parseToException("painting art", valueString, methodName);
ex.printStackTrace();
throw parseToException("a painting art", valueString, methodName);
}
// Parse to ocelot type
} else if (param.getSimpleName().equals("Type")) {
try {
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
} catch (Exception ex) {
throw parseToException("ocelot type", valueString, methodName);
throw parseToException("a ocelot type", valueString, methodName);
}
// Parse to potion effect
@ -351,7 +352,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
throw new Exception();
value = potionType;
} catch (Exception ex) {
throw parseToException("potioneffect type", valueString, methodName);
throw parseToException("a potioneffect type", valueString, methodName);
}
}
}