()
| 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 | { |
no test coverage detected