Skip to content

Commit

Permalink
chore(WindowMixin.java): modify the window title when we create the w…
Browse files Browse the repository at this point in the history
…indow initially
  • Loading branch information
DataM0del committed Dec 22, 2024
1 parent 10dfad6 commit 3eaf974
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/info/opensigma/mixin/WindowMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(Window.class)
public class WindowMixin {
Expand All @@ -16,4 +18,8 @@ private CharSequence setTitle(CharSequence title) {
title = ((String)title).replace("Minecraft", "OpenSigma for Minecraft");
return title;
}
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwCreateWindow(IILjava/lang/CharSequence;JJ)J"))
private void modifyWindowTitle(Args args) {
args.set(2, ((String)args.get(2)).replace("Minecraft", "OpenSigma"));
}
}

0 comments on commit 3eaf974

Please sign in to comment.