mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-08 09:42:56 +01:00
Renamed types, fixed error where you couldn't set the type of disguised.
This commit is contained in:
parent
bb15a52022
commit
97452d516d
@ -307,37 +307,38 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
} else if (param.getSimpleName().equals("Color")) {
|
} else if (param.getSimpleName().equals("Color")) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("horse color", valueString, methodName);
|
throw parseToException("a horse color", valueString, methodName);
|
||||||
}
|
}
|
||||||
// Parse to horse style
|
// Parse to horse style
|
||||||
} else if (param.getSimpleName().equals("Style")) {
|
} else if (param.getSimpleName().equals("Style")) {
|
||||||
try {
|
try {
|
||||||
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("horse style", valueString, methodName);
|
throw parseToException("a horse style", valueString, methodName);
|
||||||
}
|
}
|
||||||
// Parse to villager profession
|
// Parse to villager profession
|
||||||
} else if (param.getSimpleName().equals("Profession")) {
|
} else if (param.getSimpleName().equals("Profession")) {
|
||||||
try {
|
try {
|
||||||
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("villager profession", valueString, methodName);
|
throw parseToException("a villager profession", valueString, methodName);
|
||||||
}
|
}
|
||||||
// Parse to ocelot type
|
// Parse to ocelot type
|
||||||
} else if (param.getSimpleName().equals("Art")) {
|
} else if (param.getSimpleName().equals("Art")) {
|
||||||
try {
|
try {
|
||||||
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("painting art", valueString, methodName);
|
ex.printStackTrace();
|
||||||
|
throw parseToException("a painting art", valueString, methodName);
|
||||||
}
|
}
|
||||||
// Parse to ocelot type
|
// Parse to ocelot type
|
||||||
} else if (param.getSimpleName().equals("Type")) {
|
} else if (param.getSimpleName().equals("Type")) {
|
||||||
try {
|
try {
|
||||||
value = param.getClass().getMethod("valueOf", String.class).invoke(valueString.toUpperCase());
|
value = param.getMethod("valueOf", String.class).invoke(null, valueString.toUpperCase());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("ocelot type", valueString, methodName);
|
throw parseToException("a ocelot type", valueString, methodName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse to potion effect
|
// Parse to potion effect
|
||||||
@ -351,7 +352,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
value = potionType;
|
value = potionType;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw parseToException("potioneffect type", valueString, methodName);
|
throw parseToException("a potioneffect type", valueString, methodName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user