2626package org .visuals .legacy .animatium .config .category ;
2727
2828import dev .isxander .yacl3 .api .ConfigCategory ;
29- import dev .isxander .yacl3 .api .Option ;
30- import dev .isxander .yacl3 .api .OptionDescription ;
31- import dev .isxander .yacl3 .api .controller .TickBoxControllerBuilder ;
32- import net .minecraft .client .Minecraft ;
33- import net .minecraft .client .renderer .texture .OverlayTexture ;
29+ import dev .isxander .yacl3 .api .OptionGroup ;
3430import net .minecraft .network .chat .Component ;
35- import org .visuals .legacy .animatium .mixins .accessor .GameRendererAccessor ;
3631import org .visuals .legacy .animatium .util .compatibility .Mods ;
3732
38- public class ExtrasConfigCategory {
33+ public class ExtrasConfigCategory extends Category {
3934 public boolean minimalViewBobbing = false ;
4035 public boolean showNameTagInThirdPerson = false ;
4136 public boolean hideNameTagBackground = false ;
@@ -55,186 +50,49 @@ public class ExtrasConfigCategory {
5550 public boolean disableFirstPersonParticles = false ;
5651 public boolean dontClearChat = false ;
5752 public boolean dontCloseChat = false ;
53+ public float itemSwingSpeed = 0.0F ;
54+ public float hasteSwingSpeed = 0.0F ;
55+ public float miningFatigueSwingSpeed = 0.0F ;
56+ public boolean ignoreHasteSpeed = false ;
57+ public boolean ignoreMiningFatigueSpeed = false ;
5858
5959 public static ConfigCategory setup (final ExtrasConfigCategory defaults , final ExtrasConfigCategory config ) {
6060 final ConfigCategory .Builder category = ConfigCategory .createBuilder ();
6161 category .name (Component .translatable ("animatium.category.extras" ));
62- category .option (Option .<Boolean >createBuilder ()
63- .name (Component .translatable ("animatium.minimalViewBobbing" ))
64- .description (OptionDescription .of (Component .translatable ("animatium.minimalViewBobbing.description" )))
65- .binding (
66- defaults .minimalViewBobbing ,
67- () -> config .minimalViewBobbing ,
68- (newVal ) -> config .minimalViewBobbing = newVal )
69- .controller (TickBoxControllerBuilder ::create )
70- .build ());
71- category .option (Option .<Boolean >createBuilder ()
72- .name (Component .translatable ("animatium.showNameTagInThirdPerson" ))
73- .description (OptionDescription .of (Component .translatable ("animatium.showNameTagInThirdPerson.description" )))
74- .binding (
75- defaults .showNameTagInThirdPerson ,
76- () -> config .showNameTagInThirdPerson ,
77- (newVal ) -> config .showNameTagInThirdPerson = newVal )
78- .controller (TickBoxControllerBuilder ::create )
79- .build ());
80- category .option (Option .<Boolean >createBuilder ()
81- .name (Component .translatable ("animatium.hideNameTagBackground" ))
82- .description (OptionDescription .of (Component .translatable ("animatium.hideNameTagBackground.description" )))
83- .binding (
84- defaults .hideNameTagBackground ,
85- () -> config .hideNameTagBackground ,
86- (newVal ) -> config .hideNameTagBackground = newVal )
87- .controller (TickBoxControllerBuilder ::create )
88- .build ());
89- category .option (Option .<Boolean >createBuilder ()
90- .name (Component .translatable ("animatium.nameTagTextShadow" ))
91- .description (OptionDescription .of (Component .translatable ("animatium.nameTagTextShadow.description" )))
92- .binding (
93- defaults .nameTagTextShadow ,
94- () -> config .nameTagTextShadow ,
95- (newVal ) -> config .nameTagTextShadow = newVal )
96- .controller (TickBoxControllerBuilder ::create )
97- .build ());
98- category .option (Option .<Boolean >createBuilder ()
99- .name (Component .translatable ("animatium.debugHudTextColor" ))
100- .description (OptionDescription .of (Component .translatable ("animatium.debugHudTextColor.description" )))
101- .binding (
102- defaults .debugHudTextColor ,
103- () -> config .debugHudTextColor ,
104- (newVal ) -> config .debugHudTextColor = newVal )
105- .controller (TickBoxControllerBuilder ::create )
106- .build ());
107- category .option (Option .<Boolean >createBuilder ()
108- .name (Component .translatable ("animatium.persistentBlockOutline" ))
109- .description (OptionDescription .of (Component .translatable ("animatium.persistentBlockOutline.description" )))
110- .binding (
111- defaults .persistentBlockOutline ,
112- () -> config .persistentBlockOutline ,
113- (newVal ) -> config .persistentBlockOutline = newVal )
114- .controller (TickBoxControllerBuilder ::create )
115- .build ());
116- category .option (Option .<Boolean >createBuilder ()
117- .name (Component .translatable ("animatium.offhandUsageSwinging" ))
118- .description (OptionDescription .of (Component .translatable ("animatium.offhandUsageSwinging.description" )))
119- .binding (
120- defaults .offhandUsageSwinging ,
121- () -> config .offhandUsageSwinging ,
122- (newVal ) -> config .offhandUsageSwinging = newVal )
123- .controller (TickBoxControllerBuilder ::create )
124- .build ());
125- category .option (Option .<Boolean >createBuilder ()
126- .name (Component .translatable ("animatium.alwaysUsageSwing" ))
127- .description (OptionDescription .of (Component .translatable ("animatium.alwaysUsageSwing.description" )))
128- .binding (
129- defaults .alwaysUsageSwing ,
130- () -> config .alwaysUsageSwing ,
131- (newVal ) -> config .alwaysUsageSwing = newVal )
132- .controller (TickBoxControllerBuilder ::create )
133- .build ());
134- category .option (Option .<Boolean >createBuilder ()
135- .name (Component .translatable ("animatium.alwaysSharpParticles" ))
136- .description (OptionDescription .of (Component .translatable ("animatium.alwaysSharpParticles.description" )))
137- .binding (
138- defaults .alwaysSharpParticles ,
139- () -> config .alwaysSharpParticles ,
140- (newVal ) -> config .alwaysSharpParticles = newVal )
141- .controller (TickBoxControllerBuilder ::create )
142- .build ());
62+ category .option (booleanOption ("minimalViewBobbing" , defaults , config ));
63+ category .option (booleanOption ("showNameTagInThirdPerson" , defaults , config ));
64+ category .option (booleanOption ("hideNameTagBackground" , defaults , config ));
65+ category .option (booleanOption ("nameTagTextShadow" , defaults , config ));
66+ category .option (booleanOption ("debugHudTextColor" , defaults , config ));
67+ category .option (booleanOption ("persistentBlockOutline" , defaults , config ));
68+ category .option (booleanOption ("offhandUsageSwinging" , defaults , config ));
69+ category .option (booleanOption ("alwaysUsageSwing" , defaults , config ));
70+ category .option (booleanOption ("alwaysSharpParticles" , defaults , config ));
14371 if (!Mods .HAS_SODIUM_EXTRAS ) {
144- category .option (Option .<Boolean >createBuilder ()
145- .name (Component .translatable ("animatium.disableRecipeAndTutorialToasts" ))
146- .description (OptionDescription .of (Component .translatable ("animatium.disableRecipeAndTutorialToasts.description" )))
147- .binding (
148- defaults .disableRecipeAndTutorialToasts ,
149- () -> config .disableRecipeAndTutorialToasts ,
150- (newVal ) -> config .disableRecipeAndTutorialToasts = newVal )
151- .controller (TickBoxControllerBuilder ::create )
152- .build ());
72+ category .option (booleanOption ("disableRecipeAndTutorialToasts" , defaults , config ));
15373 }
154- category .option (Option .<Boolean >createBuilder ()
155- .name (Component .translatable ("animatium.showArmWhileInvisible" ))
156- .description (OptionDescription .of (Component .translatable ("animatium.showArmWhileInvisible.description" )))
157- .binding (
158- defaults .showArmWhileInvisible ,
159- () -> config .showArmWhileInvisible ,
160- (newVal ) -> config .showArmWhileInvisible = newVal )
161- .controller (TickBoxControllerBuilder ::create )
162- .build ());
163- category .option (Option .<Boolean >createBuilder ()
164- .name (Component .translatable ("animatium.fakeMissPenaltySwing" ))
165- .description (OptionDescription .of (Component .translatable ("animatium.fakeMissPenaltySwing.description" )))
166- .binding (
167- defaults .fakeMissPenaltySwing ,
168- () -> config .fakeMissPenaltySwing ,
169- (newVal ) -> config .fakeMissPenaltySwing = newVal )
170- .controller (TickBoxControllerBuilder ::create )
171- .build ());
172- category .option (Option .<Boolean >createBuilder ()
173- .name (Component .translatable ("animatium.dontMoveBlueVoid" ))
174- .description (OptionDescription .of (Component .translatable ("animatium.dontMoveBlueVoid.description" )))
175- .binding (
176- defaults .dontMoveBlueVoid ,
177- () -> config .dontMoveBlueVoid ,
178- (newVal ) -> config .dontMoveBlueVoid = newVal )
179- .controller (TickBoxControllerBuilder ::create )
180- .build ());
181- category .option (Option .<Boolean >createBuilder ()
182- .name (Component .translatable ("animatium.disableEntityDeathTopple" ))
183- .description (OptionDescription .of (Component .translatable ("animatium.disableEntityDeathTopple.description" )))
184- .binding (
185- defaults .disableEntityDeathTopple ,
186- () -> config .disableEntityDeathTopple ,
187- (newVal ) -> config .disableEntityDeathTopple = newVal )
188- .controller (TickBoxControllerBuilder ::create )
189- .build ());
190- category .option (Option .<Boolean >createBuilder ()
191- .name (Component .translatable ("animatium.deepRedHurtTint" ))
192- .description (OptionDescription .of (Component .translatable ("animatium.deepRedHurtTint.description" )))
193- .binding (
194- defaults .deepRedHurtTint ,
195- () -> config .deepRedHurtTint ,
196- (newVal ) -> {
197- config .deepRedHurtTint = newVal ;
198- ((GameRendererAccessor ) Minecraft .getInstance ().gameRenderer ).animatium$setOverlayTexture (new OverlayTexture ());
199- })
200- .controller (TickBoxControllerBuilder ::create )
201- .build ());
202- category .option (Option .<Boolean >createBuilder ()
203- .name (Component .translatable ("animatium.disableParticlePhysics" ))
204- .description (OptionDescription .of (Component .translatable ("animatium.disableParticlePhysics.description" )))
205- .binding (
206- defaults .disableParticlePhysics ,
207- () -> config .disableParticlePhysics ,
208- (newVal ) -> config .disableParticlePhysics = newVal )
209- .controller (TickBoxControllerBuilder ::create )
210- .build ());
211- category .option (Option .<Boolean >createBuilder ()
212- .name (Component .translatable ("animatium.disableFirstPersonParticles" ))
213- .description (OptionDescription .of (Component .translatable ("animatium.disableFirstPersonParticles.description" )))
214- .binding (
215- defaults .disableFirstPersonParticles ,
216- () -> config .disableFirstPersonParticles ,
217- (newVal ) -> config .disableFirstPersonParticles = newVal )
218- .controller (TickBoxControllerBuilder ::create )
219- .build ());
220- category .option (Option .<Boolean >createBuilder ()
221- .name (Component .translatable ("animatium.dontClearChat" ))
222- .description (OptionDescription .of (Component .translatable ("animatium.dontClearChat.description" )))
223- .binding (
224- defaults .dontClearChat ,
225- () -> config .dontClearChat ,
226- (newVal ) -> config .dontClearChat = newVal )
227- .controller (TickBoxControllerBuilder ::create )
228- .build ());
229- category .option (Option .<Boolean >createBuilder ()
230- .name (Component .translatable ("animatium.dontCloseChat" ))
231- .description (OptionDescription .of (Component .translatable ("animatium.dontCloseChat.description" )))
232- .binding (
233- defaults .dontCloseChat ,
234- () -> config .dontCloseChat ,
235- (newVal ) -> config .dontCloseChat = newVal )
236- .controller (TickBoxControllerBuilder ::create )
237- .build ());
74+
75+ category .option (booleanOption ("showArmWhileInvisible" , defaults , config ));
76+ category .option (booleanOption ("fakeMissPenaltySwing" , defaults , config ));
77+ category .option (booleanOption ("dontMoveBlueVoid" , defaults , config ));
78+ category .option (booleanOption ("disableEntityDeathTopple" , defaults , config ));
79+ category .option (booleanOption ("deepRedHurtTint" , defaults , config ));
80+ category .option (booleanOption ("disableParticlePhysics" , defaults , config ));
81+ category .option (booleanOption ("disableFirstPersonParticles" , defaults , config ));
82+ category .option (booleanOption ("dontClearChat" , defaults , config ));
83+ category .option (booleanOption ("dontCloseChat" , defaults , config ));
84+
85+ {
86+ final OptionGroup .Builder itemSwingCategory = OptionGroup .createBuilder ();
87+ itemSwingCategory .name (Component .translatable ("animatium.category.extras.item_swing" ));
88+ itemSwingCategory .option (floatSliderOption ("itemSwingSpeed" , defaults , config , -1.0F , 1.0F , 0.1F ));
89+ itemSwingCategory .option (floatSliderOption ("hasteSwingSpeed" , defaults , config , -1.0F , 1.0F , 0.1F ));
90+ itemSwingCategory .option (floatSliderOption ("miningFatigueSwingSpeed" , defaults , config , -1.0F , 1.0F , 0.1F ));
91+ itemSwingCategory .option (booleanOption ("ignoreHasteSpeed" , defaults , config ));
92+ itemSwingCategory .option (booleanOption ("ignoreMiningFatigueSpeed" , defaults , config ));
93+ category .group (itemSwingCategory .build ());
94+ }
95+
23896 return category .build ();
23997 }
24098}
0 commit comments