private boolean copyDirectory(File from, File to, LoadingScreenRenderer ipg) { if (!from.isDirectory()) return false; if (!to.exists()) to.mkdirs(); if (!to.isDirectory()) return false; if (ipg != null) ipg.displaySavingString("Moving chunks"); try { File list[] = from.listFiles(); for (int i = 0; i < list.length; i++) { if (list[i].isDirectory()) { copyDirectory(list[i], new File(to, list[i].getName()), null); } else if (list[i].isFile()) { copyFile(list[i], new File(to, list[i].getName())); } if (ipg != null) { ipg.setLoadingProgress((i * 100) / list.length); } } } catch (Exception e) {return false;} return true; }
public static void checkDisplayMode() { try { if (minecraft.isFullScreen()) { if (fullscreenModeChecked) { return; } fullscreenModeChecked = true; desktopModeChecked = false; DisplayMode e = Display.getDisplayMode(); Dimension dim = getFullscreenDimension(); if (dim == null) { return; } if (e.getWidth() == dim.width && e.getHeight() == dim.height) { return; } DisplayMode newMode = getDisplayMode(dim); if (newMode == null) { return; } Display.setDisplayMode(newMode); minecraft.displayWidth = Display.getDisplayMode().getWidth(); minecraft.displayHeight = Display.getDisplayMode().getHeight(); if (minecraft.displayWidth <= 0) { minecraft.displayWidth = 1; } if (minecraft.displayHeight <= 0) { minecraft.displayHeight = 1; } if (minecraft.currentScreen != null) { ScaledResolution sr = new ScaledResolution(minecraft.gameSettings, minecraft.displayWidth, minecraft.displayHeight); int sw = sr.getScaledWidth(); int sh = sr.getScaledHeight(); minecraft.currentScreen.setWorldAndResolution(minecraft, sw, sh); } minecraft.loadingScreen = new LoadingScreenRenderer(minecraft); updateFramebufferSize(); Display.setFullscreen(true); minecraft.gameSettings.updateVSync(); GL11.glEnable(GL11.GL_TEXTURE_2D); } else { if (desktopModeChecked) { return; } desktopModeChecked = true; fullscreenModeChecked = false; minecraft.gameSettings.updateVSync(); Display.update(); GL11.glEnable(GL11.GL_TEXTURE_2D); } } catch (Exception var6) { var6.printStackTrace(); } }