2121 */
2222public class CeleritasExtraGameOptions {
2323
24- // Category names
2524 private static final String CAT_ANIMATION = "animation" ;
2625 private static final String CAT_PARTICLE = "particle" ;
2726 private static final String CAT_PARTICLE_CLASSES = "particle_classes" ;
@@ -269,18 +268,18 @@ public static VerticalSyncOption getVerticalSyncOption(CeleritasExtraGameOptions
269268 public static void setVerticalSyncOption (CeleritasExtraGameOptions opts , VerticalSyncOption value ) {
270269 Minecraft mc = Minecraft .getMinecraft ();
271270 switch (value ) {
272- case OFF :
271+ case OFF -> {
273272 opts .extraSettings .useAdaptiveSync = false ;
274273 mc .gameSettings .enableVsync = false ;
275- break ;
276- case ON :
274+ }
275+ case ON -> {
277276 opts .extraSettings .useAdaptiveSync = false ;
278277 mc .gameSettings .enableVsync = true ;
279- break ;
280- case ADAPTIVE :
278+ }
279+ case ADAPTIVE -> {
281280 opts .extraSettings .useAdaptiveSync = true ;
282281 mc .gameSettings .enableVsync = true ;
283- break ;
282+ }
284283 }
285284 // Trigger VSync update - our mixin intercepts this when adaptive is enabled
286285 Display .setVSyncEnabled (mc .gameSettings .enableVsync );
@@ -305,7 +304,6 @@ public String getLocalizedName() {
305304 }
306305 }
307306
308- // Settings classes
309307 public static class AnimationSettings {
310308 public boolean animation = true ;
311309 public boolean water = true ;
@@ -363,24 +361,8 @@ public static class ExtraSettings {
363361 public int steadyDebugHudRefreshInterval = 20 ;
364362 }
365363
366- private static class BooleanProperty {
367- final String category ;
368- final String key ;
369- final boolean defaultValue ;
370- final String comment ;
371- final Consumer <Boolean > setter ;
372- final Supplier <Boolean > getter ;
373-
374- BooleanProperty (String category , String key , boolean defaultValue , String comment ,
375- Consumer <Boolean > setter , Supplier <Boolean > getter ) {
376- this .category = category ;
377- this .key = key ;
378- this .defaultValue = defaultValue ;
379- this .comment = comment ;
380- this .setter = setter ;
381- this .getter = getter ;
382- }
383-
364+ private record BooleanProperty (String category , String key , boolean defaultValue , String comment ,
365+ Consumer <Boolean > setter , Supplier <Boolean > getter ) {
384366 void load (Configuration config ) {
385367 setter .accept (config .getBoolean (key , category , defaultValue , comment ));
386368 }
@@ -390,28 +372,8 @@ void save(Configuration config) {
390372 }
391373 }
392374
393- private static class IntProperty {
394- final String category ;
395- final String key ;
396- final int defaultValue ;
397- final int min ;
398- final int max ;
399- final String comment ;
400- final Consumer <Integer > setter ;
401- final Supplier <Integer > getter ;
402-
403- IntProperty (String category , String key , int defaultValue , int min , int max , String comment ,
404- Consumer <Integer > setter , Supplier <Integer > getter ) {
405- this .category = category ;
406- this .key = key ;
407- this .defaultValue = defaultValue ;
408- this .min = min ;
409- this .max = max ;
410- this .comment = comment ;
411- this .setter = setter ;
412- this .getter = getter ;
413- }
414-
375+ private record IntProperty (String category , String key , int defaultValue , int min , int max , String comment ,
376+ Consumer <Integer > setter , Supplier <Integer > getter ) {
415377 void load (Configuration config ) {
416378 setter .accept (config .getInt (key , category , defaultValue , min , max , comment ));
417379 }
0 commit comments