本文整理汇总了Java中net.minecraft.client.LoadingScreenRenderer类的典型用法代码示例。如果您正苦于以下问题:Java LoadingScreenRenderer类的具体用法?Java LoadingScreenRenderer怎么用?Java LoadingScreenRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadingScreenRenderer类属于net.minecraft.client包,在下文中一共展示了LoadingScreenRenderer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyDirectory
import net.minecraft.client.LoadingScreenRenderer; //导入依赖的package包/类
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;
}
示例2: checkDisplayMode
import net.minecraft.client.LoadingScreenRenderer; //导入依赖的package包/类
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();
}
}