File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
src/main/java/me/srrapero720/chloride Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ public static void onSodiumPagesRegister(final OptionGUIConstructionEvent e) {
4646 }
4747 }
4848
49+ private static Option <?> particles ;
50+
4951 @ SubscribeEvent
5052 public static void onSodiumPagesRegister (final OptionGroupConstructionEvent e ) {
5153 if (e .getId () != null && e .getId ().toString ().equals (StandardOptions .Group .WINDOW .toString ())) {
@@ -54,9 +56,26 @@ public static void onSodiumPagesRegister(final OptionGroupConstructionEvent e) {
5456 final var id = options .get (i ).getId ();
5557 if (id != null && id .matches (StandardOptions .Option .FULLSCREEN )) {
5658 options .set (i , getFullscreenOption ());
59+ break ;
60+ }
61+ }
62+ }
63+ if (e .getId () != null && e .getId ().toString ().equals (StandardOptions .Group .DETAILS .toString ())) {
64+ final var options = e .getOptions ();
65+ for (final Option <?> option : options ) {
66+ final var id = option .getId ();
67+ if (id != null && id .matches (StandardOptions .Option .PARTICLES )) {
68+ particles = option ;
69+ options .remove (option );
70+ break ;
5771 }
5872 }
5973 }
74+
75+ if (e .getId () != null && e .getId ().equals (ParticlesPage .PARTICLE_BASE_PAGE )) {
76+ final var options = e .getOptions ();
77+ options .add (0 , particles );
78+ }
6079 }
6180
6281 @ SubscribeEvent
Original file line number Diff line number Diff line change 2626
2727public class ParticlesPage extends OptionPage {
2828 public static final OptionIdentifier <Void > ID = OptionIdentifier .create (Objects .requireNonNull (ResourceLocation .tryBuild (Chloride .ID , "particles" )));
29+ public static final OptionIdentifier <Void > PARTICLE_BASE_PAGE = OptionIdentifier .create (Objects .requireNonNull (ResourceLocation .tryBuild (Chloride .ID , "particles_page_base" )));
2930 public ParticlesPage () {
3031 super (ID , Component .translatable ("chloride.particles" ), create ());
3132 }
3233
3334 private static ImmutableList <OptionGroup > create () {
3435 final List <OptionGroup > groups = new ArrayList <>();
3536
37+ final var particles = OptionGroup .createBuilder ();
38+ particles .setId (PARTICLE_BASE_PAGE );
39+
3640 final var base = OptionGroup .createBuilder ();
3741 base .add (OptionImpl .createBuilder (boolean .class , STORAGE )
3842 .setName (Component .translatable ("chloride.particles.rain.title" ))
@@ -96,6 +100,7 @@ private static ImmutableList<OptionGroup> create() {
96100 );
97101 }
98102
103+ groups .add (particles .build ());
99104 groups .add (base .build ());
100105 groups .add (disabled .build ());
101106 groups .add (enabled .build ());
Original file line number Diff line number Diff line change 33import me .srrapero720 .chloride .ChlorideConfig ;
44import me .srrapero720 .chloride .api .IParticleTypeData ;
55import net .minecraft .client .Camera ;
6+ import net .minecraft .client .Minecraft ;
67import net .minecraft .client .particle .FireworkParticles ;
78import net .minecraft .client .particle .Particle ;
89import net .minecraft .client .particle .ParticleEngine ;
You can’t perform that action at this time.
0 commit comments