From 77b1904de955ec4a6ba3a7f5053b5eb861e73bc5 Mon Sep 17 00:00:00 2001 From: Big-Iron-Cheems <52252627+Big-Iron-Cheems@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:42:27 +0200 Subject: [PATCH 1/3] Add configurable custom window icon This also changes the game icon in the taskbar. Better 16x and 32x PNGs would be nice. --- .../meteorclient/systems/config/Config.java | 34 +++++++ .../meteorclient/utils/misc/IconChanger.java | 94 ++++++++++++++++++ .../icons/windowicon/christmas_16.png | Bin 0 -> 617 bytes .../icons/windowicon/christmas_32.png | Bin 0 -> 1513 bytes .../icons/windowicon/halloween_16.png | Bin 0 -> 609 bytes .../icons/windowicon/halloween_32.png | Bin 0 -> 1581 bytes .../textures/icons/windowicon/meteor_16.png | Bin 0 -> 506 bytes .../textures/icons/windowicon/meteor_32.png | Bin 0 -> 1016 bytes 8 files changed, 128 insertions(+) create mode 100644 src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_16.png create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_32.png create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_16.png create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_32.png create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/meteor_16.png create mode 100644 src/main/resources/assets/meteor-client/textures/icons/windowicon/meteor_32.png diff --git a/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java b/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java index fbb9898355..86c9c0dc72 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java @@ -12,11 +12,13 @@ import meteordevelopment.meteorclient.systems.System; import meteordevelopment.meteorclient.systems.Systems; import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.meteorclient.utils.misc.IconChanger; import meteordevelopment.meteorclient.utils.render.color.SettingColor; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtString; +import net.minecraft.util.Identifier; import java.util.ArrayList; import java.util.List; @@ -71,6 +73,14 @@ public class Config extends System { .build() ); + public final Setting customWindowIcon = sgVisual.add(new EnumSetting.Builder() + .name("custom-window-icon") + .description("The icon to use for the window.") + .defaultValue(WindowIcons.Default) + .onChanged(IconChanger::setIcon) + .build() + ); + public final Setting customWindowTitle = sgVisual.add(new BoolSetting.Builder() .name("custom-window-title") .description("Show custom text in the window title.") @@ -199,4 +209,28 @@ private List listFromTag(NbtCompound tag, String key) { for (NbtElement item : tag.getListOrEmpty(key)) list.add(item.asString().orElse("")); return list; } + + public enum WindowIcons { + Meteor( + MeteorClient.identifier("textures/icons/windowicon/meteor_16.png"), + MeteorClient.identifier("textures/icons/windowicon/meteor_32.png") + ), + Christmas( + MeteorClient.identifier("textures/icons/windowicon/christmas_16.png"), + MeteorClient.identifier("textures/icons/windowicon/christmas_32.png") + ), + Halloween( + MeteorClient.identifier("textures/icons/windowicon/halloween_16.png"), + MeteorClient.identifier("textures/icons/windowicon/halloween_32.png") + ), + Default(null, null); + + public final Identifier icon16; + public final Identifier icon32; + + WindowIcons(Identifier icon16, Identifier icon32) { + this.icon16 = icon16; + this.icon32 = icon32; + } + } } diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java new file mode 100644 index 0000000000..0cb363691a --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java @@ -0,0 +1,94 @@ +/* + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * Copyright (c) Meteor Development. + */ + +package meteordevelopment.meteorclient.utils.misc; + +import meteordevelopment.meteorclient.MeteorClient; +import meteordevelopment.meteorclient.systems.config.Config.WindowIcons; +import net.minecraft.SharedConstants; +import net.minecraft.client.texture.NativeImage; +import net.minecraft.client.util.Icons; +import net.minecraft.resource.Resource; +import net.minecraft.util.Identifier; +import org.lwjgl.glfw.GLFW; +import org.lwjgl.glfw.GLFWImage; +import org.lwjgl.system.MemoryStack; + +import java.io.IOException; +import java.nio.ByteBuffer; + +import static meteordevelopment.meteorclient.MeteorClient.mc; + +public class IconChanger { + private IconChanger() { + } + + public static void setIcon(WindowIcons icon) { + if (icon == WindowIcons.Default) { + resetToDefault(); + } else { + setCustomIcon(icon); + } + } + + private static void resetToDefault() { + try { + mc.getWindow().setIcon( + mc.getDefaultResourcePack(), + SharedConstants.getGameVersion().stable() ? Icons.RELEASE : Icons.SNAPSHOT + ); + } catch (IOException e) { + MeteorClient.LOG.warn("Failed to reset icon: {}", e.getMessage()); + } + } + + private static void setCustomIcon(WindowIcons windowIcons) { + if (windowIcons.icon16 == null || windowIcons.icon32 == null) { + MeteorClient.LOG.warn("Icon paths cannot be null for custom icons"); + return; + } + + try (MemoryStack stack = MemoryStack.stackPush()) { + GLFWImage.Buffer icons = GLFWImage.malloc(2, stack); + + loadIconSize(windowIcons.icon16, icons, 0, stack); + loadIconSize(windowIcons.icon32, icons, 1, stack); + + GLFW.glfwSetWindowIcon(mc.getWindow().getHandle(), icons); + } catch (Exception e) { + MeteorClient.LOG.warn("Failed to set icon: {}", e.getMessage()); + } + } + + private static void loadIconSize(Identifier iconPath, GLFWImage.Buffer icons, int index, MemoryStack stack) throws IOException { + Resource resource = mc.getResourceManager() + .getResource(iconPath) + .orElseThrow(() -> new IOException("Icon not found: " + iconPath)); + + NativeImage image = NativeImage.read(resource.getInputStream()); + ByteBuffer pixelBuffer = imageToByteBuffer(image); + + GLFWImage glfwImage = GLFWImage.malloc(stack); + glfwImage.set(image.getWidth(), image.getHeight(), pixelBuffer); + icons.put(index, glfwImage); + + image.close(); + } + + private static ByteBuffer imageToByteBuffer(NativeImage image) { + ByteBuffer buffer = ByteBuffer.allocateDirect(image.getWidth() * image.getHeight() * 4); + for (int y = 0; y < image.getHeight(); y++) { + for (int x = 0; x < image.getWidth(); x++) { + int pixel = image.getColorArgb(x, y); + buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red + buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green + buffer.put((byte) (pixel & 0xFF)); // Blue + buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha + } + } + buffer.flip(); + return buffer; + } +} diff --git a/src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_16.png b/src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_16.png new file mode 100644 index 0000000000000000000000000000000000000000..9974da263ad92e2196f0783358f3689bf1618225 GIT binary patch literal 617 zcmV-v0+#)WP)a&A+mZq}xT5dER3Q0fpFC00U6P(f6Z(V?ReM2#3>o}`0N zT`D?s@Ddf0lt~9m5fZ6vSJ=LQ1P&gBO56T67=H|e`#?v-W z?)h;wGQW{f5Cy;wH4jDAIIE6x-iwCsP!#=CK0nHFhFMvy*zK0Q$LxBuWj+%MG^xms2eKAWMT-euf$TLVKmuZPoUgT@#H6LL-6-}_CD z!nh7Ac>4891VH47_tshz5dc|D1;cOoG|7$lvwi-F);Nd1NaZ8LiWa|12vJbNz@n-A z!o_d$bP`1btFYf4XlbzQ@|O#2I;&-_1t#`H@z3}Lb5hq#^AELz00000NkvXXu0mjf D`$i&m literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_32.png b/src/main/resources/assets/meteor-client/textures/icons/windowicon/christmas_32.png new file mode 100644 index 0000000000000000000000000000000000000000..5644a6824571456334e36b7ee6cc1c9fe89cbdfa GIT binary patch literal 1513 zcmVR82S#7mU4RoRw#i7ZYN z7tJ==l8qR<$tEg9=7qht=Ikk1WfowJ&oLPUWWZLC88^Q(l$vqEDayvR&^TWd{DeGQh#G>7PiS@cU zckWMWfAx4DPD8i=`VSpO?|lz9sno#D-q6T$-*p83NhxT|KvwyXQTs@I>2>pKfBt9^ z;}DAec+J5In+KmzP#rzFp0;~-FK|(?e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HqO(* zE%^i2JuqV*#$ouHF`Orb{BfoH<2XlBd53)E_TV%e=jp@#mr~P87p>D^IYew8fpioQ z5u!#2|Dqs=eU*Ep*Xg|L@%Dv7I1S+fXr2CArN)C#axzvhBD%Ds9166?7 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_16.png b/src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_16.png new file mode 100644 index 0000000000000000000000000000000000000000..2b4f33df02bd492cb8a61715fb5f73e38549e417 GIT binary patch literal 609 zcmV-n0-pVeP)e;Hh5O6RT$8Ve zTt4bi>Z8`?qvRT$KJ6pDSL*fJs#0}wIL6np0~TG%is&*KN^$lkNUdNg<;}qYwLK-2 zKYgFf2Zl<@GdXHB2k1;^gmzr0VzoN-*wn90fh`PM7E?mD`gCP1A)=DfcZYMl-fK5o zjiS8O{?F>eu#*>`Eam+XueeiU$E8S_JaHzZd>@#y78tfQyGhZ#Bj{5!C{MrA`@&)i zgE9WR!6kamhSR-75dRz)Wfqv*DFPJ+uGJmTQw-bQ&ReS#bWmrs=DJVz#MkMEp&4_u zv7C2#?5GwN;3N_nk>DALrB$LkbTQBHkI{t4zKmO=6@}_ZijWXQ06b0L$S3%*PElZkSx`t;82+Ovqz*Aof9C0^Q&bq^UmzPoY}V#MSKP!C vf<5XwZYyc=qdQ-*(qprvxBFu*iGATOk=4-pGd2c#00000NkvXXu0mjfvF#ku literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_32.png b/src/main/resources/assets/meteor-client/textures/icons/windowicon/halloween_32.png new file mode 100644 index 0000000000000000000000000000000000000000..59b4e7da210c389e9643bb844397c7609e399b8d GIT binary patch literal 1581 zcmV+|2GaS7P)y(6d(OG%zPG)%FSHg`hHF`|Kt{Ui*x0OLl|nY50Ygw6ic9u~iiuOB zQk6z`UUvJ!%kAyUZSU>9=jD0482%up7&kEb z2cHk_xZ{6~;ksRGi;6cd(ZBmxt#_>T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y$Alyb(5#amv z{zcW%>`$T*ac}&bi?T|VJl-um^KMT5#j|gx9sCQzf5GO(LHQnLec9!1l^oK3_~>h6 fN!)SA|Eqrh>^Wur#|$z300000NkvXXu0mjfw{P5OlFoWADad>wVwteV*Q6hY?7g{d};4+&DO`&h$Om1<$SI!^WAu zX8~*jLrs6{wW;pVf!U!w=gTrxRU^4nxhxuXj1q-dwa??PK1NPQ-l1m?lfB zMaP`vs743$)6-p{#LWSHC>Kwg3PC literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/meteor-client/textures/icons/windowicon/meteor_32.png b/src/main/resources/assets/meteor-client/textures/icons/windowicon/meteor_32.png new file mode 100644 index 0000000000000000000000000000000000000000..0413bc1bb108c9622fa5d67949bade075ea2aeb9 GIT binary patch literal 1016 zcmVg6FdIZno2CM7S*|p^Xknulq2;1hQY&45utjF& z)QMwDiJHllRtsAZ>$Pcs4>U*vb;P6MRlK~9bM8IAlWw)KJGl_D*&p}wK}1BvjYe<{ zRm*-{l%M?UB25pT|7ExtS8Z9in`}-iFI<^epnTT3e-JZ-AjAu|)#b#=bG~zmHuplu zT`TTSeDv&*j>)PnKBYJsrT~7_gG!cZ*LED|uE$ymC zvbsGUOOWb}Q# z;*Hd(2fhtZ=Jwyc{@Is<0hoEVVN@OX^p&P{o+od8HLftFv_j@B?-GWK#}zEYN<1sv zJ4=es%X1Z9thu!360U(DjLcbuxgs%tkRDx-sc0jI+eYf%bco44-XP8D@_1j|dSYqY z!R(f;cENFouzUsp1|e96jpkXy2DfWdMpo=YKYZC;HHL8r!VrnI(J3XjbBv)t2rawi{rEP7PH1T-L&GB#t+jc>xnqsE&S>O&JX^C+d4DS}_hm7~PkfaB`r! zx;q;JrF;rRKXT0JBB@ol|6KRc-SVc`Xcgy3JA4h*Oiy?zRn z0zs-AuJ5U6#W){^nU8r(V2zbFL&DDhj^iIgih^T(y-1K{%(dF! zqYMTW3Qb2?9R7n3+t+sja2L<7zdJ~kK7`N#bbCA)QYm6&JEnreH0(Q<^F6}Qp<}98 z++ZxOlSb78fKD+9O%I+9P~{XtFqi>F^Xt-iR@zAzehIFSc@eR46t1GW))%D8Yn@|f z_U~y~M-hU-49SSzz@$4LaT|zfyIC+L#u#m?O1-=O^8Z#=emZvq6JRjI*0}acN#@id mnb*H4JGtxvA|fLG@BRka!DWB=hrzi30000 Date: Mon, 25 Aug 2025 15:31:10 +0200 Subject: [PATCH 2/3] Use try-with-resources for NativeImage --- .../meteorclient/utils/misc/IconChanger.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java index 0cb363691a..2900dd36af 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java @@ -28,6 +28,8 @@ private IconChanger() { public static void setIcon(WindowIcons icon) { if (icon == WindowIcons.Default) { resetToDefault(); + } else if (icon.icon16 == null || icon.icon32 == null) { + MeteorClient.LOG.warn("Icon paths cannot be null for custom icons"); } else { setCustomIcon(icon); } @@ -45,11 +47,6 @@ private static void resetToDefault() { } private static void setCustomIcon(WindowIcons windowIcons) { - if (windowIcons.icon16 == null || windowIcons.icon32 == null) { - MeteorClient.LOG.warn("Icon paths cannot be null for custom icons"); - return; - } - try (MemoryStack stack = MemoryStack.stackPush()) { GLFWImage.Buffer icons = GLFWImage.malloc(2, stack); @@ -67,14 +64,13 @@ private static void loadIconSize(Identifier iconPath, GLFWImage.Buffer icons, in .getResource(iconPath) .orElseThrow(() -> new IOException("Icon not found: " + iconPath)); - NativeImage image = NativeImage.read(resource.getInputStream()); - ByteBuffer pixelBuffer = imageToByteBuffer(image); - - GLFWImage glfwImage = GLFWImage.malloc(stack); - glfwImage.set(image.getWidth(), image.getHeight(), pixelBuffer); - icons.put(index, glfwImage); + try (NativeImage image = NativeImage.read(resource.getInputStream())) { + ByteBuffer pixelBuffer = imageToByteBuffer(image); - image.close(); + GLFWImage glfwImage = GLFWImage.malloc(stack); + glfwImage.set(image.getWidth(), image.getHeight(), pixelBuffer); + icons.put(index, glfwImage); + } } private static ByteBuffer imageToByteBuffer(NativeImage image) { From ce9fdada064616dcadb56b1e0493d1206d9fd776 Mon Sep 17 00:00:00 2001 From: Big-Iron-Cheems <52252627+Big-Iron-Cheems@users.noreply.github.com> Date: Sat, 30 Aug 2025 16:44:55 +0200 Subject: [PATCH 3/3] Move WindowIcons to IconChanger --- .../meteorclient/systems/config/Config.java | 30 ++----------------- .../meteorclient/utils/misc/IconChanger.java | 25 +++++++++++++++- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java b/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java index 86c9c0dc72..ce0635a0e3 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/config/Config.java @@ -18,7 +18,6 @@ import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtString; -import net.minecraft.util.Identifier; import java.util.ArrayList; import java.util.List; @@ -73,10 +72,11 @@ public class Config extends System { .build() ); - public final Setting customWindowIcon = sgVisual.add(new EnumSetting.Builder() + @SuppressWarnings("unused") + public final Setting customWindowIcon = sgVisual.add(new EnumSetting.Builder() .name("custom-window-icon") .description("The icon to use for the window.") - .defaultValue(WindowIcons.Default) + .defaultValue(IconChanger.WindowIcons.Default) .onChanged(IconChanger::setIcon) .build() ); @@ -209,28 +209,4 @@ private List listFromTag(NbtCompound tag, String key) { for (NbtElement item : tag.getListOrEmpty(key)) list.add(item.asString().orElse("")); return list; } - - public enum WindowIcons { - Meteor( - MeteorClient.identifier("textures/icons/windowicon/meteor_16.png"), - MeteorClient.identifier("textures/icons/windowicon/meteor_32.png") - ), - Christmas( - MeteorClient.identifier("textures/icons/windowicon/christmas_16.png"), - MeteorClient.identifier("textures/icons/windowicon/christmas_32.png") - ), - Halloween( - MeteorClient.identifier("textures/icons/windowicon/halloween_16.png"), - MeteorClient.identifier("textures/icons/windowicon/halloween_32.png") - ), - Default(null, null); - - public final Identifier icon16; - public final Identifier icon32; - - WindowIcons(Identifier icon16, Identifier icon32) { - this.icon16 = icon16; - this.icon32 = icon32; - } - } } diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java index 2900dd36af..0bcfb69263 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/IconChanger.java @@ -6,7 +6,6 @@ package meteordevelopment.meteorclient.utils.misc; import meteordevelopment.meteorclient.MeteorClient; -import meteordevelopment.meteorclient.systems.config.Config.WindowIcons; import net.minecraft.SharedConstants; import net.minecraft.client.texture.NativeImage; import net.minecraft.client.util.Icons; @@ -25,6 +24,30 @@ public class IconChanger { private IconChanger() { } + public enum WindowIcons { + Meteor( + MeteorClient.identifier("textures/icons/windowicon/meteor_16.png"), + MeteorClient.identifier("textures/icons/windowicon/meteor_32.png") + ), + Christmas( + MeteorClient.identifier("textures/icons/windowicon/christmas_16.png"), + MeteorClient.identifier("textures/icons/windowicon/christmas_32.png") + ), + Halloween( + MeteorClient.identifier("textures/icons/windowicon/halloween_16.png"), + MeteorClient.identifier("textures/icons/windowicon/halloween_32.png") + ), + Default(null, null); + + public final Identifier icon16; + public final Identifier icon32; + + WindowIcons(Identifier icon16, Identifier icon32) { + this.icon16 = icon16; + this.icon32 = icon32; + } + } + public static void setIcon(WindowIcons icon) { if (icon == WindowIcons.Default) { resetToDefault();