File tree Expand file tree Collapse file tree
src/main/java/com/nerds/addon Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import com .nerds .addon .commands .CommandExample ;
44import com .nerds .addon .hud .HudExample ;
55import com .nerds .addon .modules .JoinLeaveNotify ;
6+ import com .nerds .addon .modules .WindowTitleRenamer ;
67import com .mojang .logging .LogUtils ;
78import meteordevelopment .meteorclient .addons .GithubRepo ;
89import meteordevelopment .meteorclient .addons .MeteorAddon ;
@@ -22,8 +23,10 @@ public class NerdAddon extends MeteorAddon {
2223 public void onInitialize () {
2324 LOG .info ("Initializing Nerd Addon" );
2425
25- // Modules
26+
2627 Modules .get ().add (new JoinLeaveNotify ());
28+ Modules .get ().add (new WindowTitleRenamer ());
29+
2730
2831 // Commands
2932 Commands .add (new CommandExample ());
Original file line number Diff line number Diff line change 1+ package com .nerds .addon .modules ;
2+
3+ import com .nerds .addon .NerdAddon ;
4+ import meteordevelopment .meteorclient .events .world .TickEvent ;
5+ import meteordevelopment .meteorclient .settings .Setting ;
6+ import meteordevelopment .meteorclient .settings .SettingGroup ;
7+ import meteordevelopment .meteorclient .settings .StringSetting ;
8+ import meteordevelopment .meteorclient .systems .modules .Module ;
9+ import meteordevelopment .orbit .EventHandler ;
10+ import org .lwjgl .glfw .GLFW ;
11+
12+ public class WindowTitleRenamer extends Module {
13+ private final SettingGroup sgGeneral = settings .getDefaultGroup ();
14+
15+ private final Setting <String > title = sgGeneral .add (new StringSetting .Builder ()
16+ .name ("title" )
17+ .description ("The custom window title to display." )
18+ .defaultValue ("Nerd Addon" )
19+ .build ()
20+ );
21+
22+ public WindowTitleRenamer () {
23+ super (NerdAddon .CATEGORY , "window-title-renamer" , "Lets you set a custom window title." );
24+ }
25+
26+ @ Override
27+ public void onActivate () {
28+ applyTitle ();
29+ }
30+
31+ @ Override
32+ public void onDeactivate () {
33+ GLFW .glfwSetWindowTitle (mc .getWindow ().getHandle (), "Minecraft" );
34+ }
35+
36+ @ EventHandler
37+ private void onTick (TickEvent .Post event ) {
38+ applyTitle ();
39+ }
40+
41+ private void applyTitle () {
42+ GLFW .glfwSetWindowTitle (mc .getWindow ().getHandle (), title .get ());
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments