Skip to content

Instantly share code, notes, and snippets.

Last active April 9, 2016 21:42
What would you like to do?
private static Method getCommandMap;
public static CommandMap getCommandMap(Server server) {
try {
if (getCommandMap == null) {
getCommandMap = server.getClass().getDeclaredMethod("getCommandMap");
return (CommandMap) getCommandMap.invoke(server);
} catch (Exception exception) {
throw new IllegalArgumentException(exception);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment