MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / setWindowIcon

Method setWindowIcon

src/main/java/net/minecraft/client/Minecraft.java:650–694  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

648 }
649
650 public void setWindowIcon()
651 {
652 Util.EnumOS util$enumos = Util.getOSType();
653
654 if (util$enumos != Util.EnumOS.OSX)
655 {
656 InputStream smallIcon = null;
657 InputStream bigIcon = null;
658
659 try
660 {
661 smallIcon = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("slack/textures/logo/16.png"));
662 bigIcon = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("slack/textures/logo/32.png"));
663 if (smallIcon != null && bigIcon != null)
664 {
665 Display.setIcon(new ByteBuffer[] {this.readImageToBuffer(smallIcon), this.readImageToBuffer(bigIcon)});
666 }
667 }
668 catch (IOException ioexception)
669 {
670 logger.error("Couldn\'t set icon", ioexception);
671 }
672 finally
673 {
674 IOUtils.closeQuietly(smallIcon);
675 IOUtils.closeQuietly(bigIcon);
676 }
677 } else {
678 try
679 {
680 InputStream icon = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("slack/textures/logo/mac.png"));
681 if (icon != null) {
682 try {
683 Class<?> Application = Class.forName("com.apple.eawt.Application");
684 Application.getMethod("setDockIconImage", Image.class).invoke(Application.getMethod("getApplication").invoke(null), ImageIO.read(icon));
685 } catch (Exception e) { System.err.println("[ IconUtils ] Error setting dock icon: " + e.getMessage()); }
686 IOUtils.closeQuietly(icon);
687 } else { System.err.println("[ IconUtils ] Icon file could not be found"); }
688 }
689 catch (IOException ioexception)
690 {
691 logger.error("Couldn\'t set icon", ioexception);
692 }
693 }
694 }
695
696 private static boolean isJvm64bit()
697 {

Callers 1

startGameMethod · 0.95

Calls 8

getOSTypeMethod · 0.95
readImageToBufferMethod · 0.95
printlnMethod · 0.80
getInputStreamMethod · 0.65
errorMethod · 0.45
getMethodMethod · 0.45
readMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected