本文整理匯總了Java中net.minecraft.client.Minecraft.isRunningOnMac方法的典型用法代碼示例。如果您正苦於以下問題:Java Minecraft.isRunningOnMac方法的具體用法?Java Minecraft.isRunningOnMac怎麽用?Java Minecraft.isRunningOnMac使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.Minecraft
的用法示例。
在下文中一共展示了Minecraft.isRunningOnMac方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isCtrlKeyDown
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
/**
* Returns true if either windows ctrl key is down or if either mac meta key is down
*/
public static boolean isCtrlKeyDown()
{
return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157);
}
示例2: checkDisplaySettings
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public static void checkDisplaySettings()
{
int i = getAntialiasingLevel();
if (i > 0)
{
DisplayMode displaymode = Display.getDisplayMode();
dbg("FSAA Samples: " + i);
try
{
Display.destroy();
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24).withSamples(i));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception2)
{
warn("Error setting FSAA: " + i + "x");
lwjglexception2.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create((new PixelFormat()).withDepthBits(24));
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception1)
{
lwjglexception1.printStackTrace();
try
{
Display.setDisplayMode(displaymode);
Display.create();
Display.setResizable(false);
Display.setResizable(true);
}
catch (LWJGLException lwjglexception)
{
lwjglexception.printStackTrace();
}
}
}
if (!Minecraft.isRunningOnMac && getDefaultResourcePack() != null)
{
InputStream inputstream = null;
InputStream inputstream1 = null;
try
{
inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png"));
inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png"));
if (inputstream != null && inputstream1 != null)
{
Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)});
}
}
catch (IOException ioexception)
{
warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage());
}
finally
{
IOUtils.closeQuietly(inputstream);
IOUtils.closeQuietly(inputstream1);
}
}
}
}