Last active
April 9, 2016 21:42
-
-
Save vemacs/1d8df3d93e86b8fdfb431209313f44b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Method getCommandMap; | |
public static CommandMap getCommandMap(Server server) { | |
try { | |
if (getCommandMap == null) { | |
getCommandMap = server.getClass().getDeclaredMethod("getCommandMap"); | |
getCommandMap.setAccessible(true); | |
} | |
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