1+ package cqb13 .NumbyHack .modules .general ;
2+
3+ import cqb13 .NumbyHack .NumbyHack ;
4+ import meteordevelopment .meteorclient .settings .BoolSetting ;
5+ import meteordevelopment .meteorclient .settings .Setting ;
6+ import meteordevelopment .meteorclient .settings .SettingGroup ;
7+ import meteordevelopment .meteorclient .systems .modules .Module ;
8+ import meteordevelopment .meteorclient .utils .player .ChatUtils ;
9+
10+ /**
11+ * made by cqb13
12+ */
13+ public class GameSettings extends Module {
14+ private final SettingGroup sgGeneral = settings .getDefaultGroup ();
15+
16+ private final Setting <Boolean > hudHidden = sgGeneral .add (new BoolSetting .Builder ()
17+ .name ("hide-HUD" )
18+ .description ("Hide your HUD." )
19+ .defaultValue (mc .options .hudHidden )
20+ .onChanged (this ::toggleHUD )
21+ .build ()
22+ );
23+
24+ private final Setting <Boolean > pauseOnLostFocus = sgGeneral .add (new BoolSetting .Builder ()
25+ .name ("pause-on-lost-focus" )
26+ .description ("Pauses the game when it is not focussed." )
27+ .defaultValue (mc .options .pauseOnLostFocus )
28+ .onChanged (this ::togglePauseOnLostFocus )
29+ .build ()
30+ );
31+
32+ private final Setting <Boolean > skipMultiplayerWarning = sgGeneral .add (new BoolSetting .Builder ()
33+ .name ("skip-multiplayer-warning" )
34+ .description ("Skips the Multiplayer warning." )
35+ .defaultValue (mc .options .skipMultiplayerWarning )
36+ .onChanged (this ::toggleSkipMultiplayerWarning )
37+ .build ()
38+ );
39+
40+ private final Setting <Boolean > smoothCameraEnabled = sgGeneral .add (new BoolSetting .Builder ()
41+ .name ("cinematic-camera" )
42+ .description ("Smooth camera movement." )
43+ .defaultValue (mc .options .smoothCameraEnabled )
44+ .onChanged (this ::toggleSmoothCamera )
45+ .build ()
46+ );
47+
48+ private final Setting <Boolean > advancedTooltips = sgGeneral .add (new BoolSetting .Builder ()
49+ .name ("advanced-tooltips" )
50+ .description ("More information on items in your inventory." )
51+ .defaultValue (mc .options .advancedItemTooltips )
52+ .onChanged (this ::toggleAdvancedTooltips )
53+ .build ()
54+ );
55+
56+ private final Setting <Boolean > hideScore = sgGeneral .add (new BoolSetting .Builder ()
57+ .name ("hide-score" )
58+ .description ("Hides the score when you die." )
59+ .defaultValue (true )
60+ .build ()
61+ );
62+
63+ private final Setting <Boolean > chatFeedback = sgGeneral .add (new BoolSetting .Builder ()
64+ .name ("chat-feedback" )
65+ .description ("Sends updates in the chat." )
66+ .defaultValue (true )
67+ .build ()
68+ );
69+
70+ public GameSettings () {
71+ super (NumbyHack .CATEGORY , "game-settings" , "Allows for easier access to Minecraft's settings and adds some tweaks." );
72+ }
73+
74+ private void toggleHUD (Boolean b ) {
75+ mc .options .hudHidden = b ;
76+ sendChatInfo ("HUD" , b ? "hidden" : "shown" );
77+ }
78+
79+ private void togglePauseOnLostFocus (Boolean b ) {
80+ mc .options .pauseOnLostFocus = b ;
81+ sendChatInfo ("Pause on Lost Focus" , b ? "enabled" : "disabled" );
82+ }
83+
84+ private void toggleSkipMultiplayerWarning (Boolean b ) {
85+ mc .options .skipMultiplayerWarning = b ;
86+ sendChatInfo ("Skip Multiplayer Warning" , b ? "enabled" : "disabled" );
87+ }
88+
89+ private void toggleSmoothCamera (Boolean b ) {
90+ mc .options .smoothCameraEnabled = b ;
91+ sendChatInfo ("Smooth Camera" , b ? "enabled" : "disabled" );
92+ }
93+
94+ private void toggleAdvancedTooltips (Boolean b ) {
95+ mc .options .advancedItemTooltips = b ;
96+ sendChatInfo ("Advanced Tooltips" , b ? "enabled" : "disabled" );
97+ }
98+
99+ public boolean toggleHideScore () {
100+ sendChatInfo ("Hide Score" , hideScore .get () ? "enabled" : "disabled" );
101+ return isActive () && hideScore .get ();
102+ }
103+
104+ private void sendChatInfo (String setting , String value ) {
105+ if (!chatFeedback .get ()) return ;
106+ ChatUtils .info ("Set %s to %s." , setting , value );
107+ }
108+ }
0 commit comments