private void forceResize ( int width , int height ) { // Are we in the dev environment or deployed? boolean devEnv = ( Boolean ) Launch . blackboard . get ( "fml.deobfuscatedEnvironment" ) ; // We need to know, because the method name will either be obfuscated or not. String resizeMethodName = devEnv ? "resize" : "func_71370_a" ; Class [ ] cArgs = new Class [ 2 ] ; cArgs [ 0 ] = int . class ; cArgs [ 1 ] = int . class ; Method resize ; try { resize = Minecraft . class . getDeclaredMethod ( resizeMethodName , cArgs ) ; resize . setAccessible ( true ) ; resize . invoke ( Minecraft . getMinecraft ( ) , width , height ) ; } catch ( NoSuchMethodException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } catch ( SecurityException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } catch ( IllegalArgumentException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } catch ( InvocationTargetException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } }
Force Minecraft to resize its GUI