1313import net .azureaaron .mod .config .ConfigUtils ;
1414import net .azureaaron .mod .mixins .accessors .BillboardParticleAccessor ;
1515import net .azureaaron .mod .utils .Functions ;
16- import net .minecraft .client .particle .BillboardParticle ;
1716import net .minecraft .client .particle .Particle ;
18- import net .minecraft .particle .ParticleType ;
19- import net .minecraft .particle .ParticleTypes ;
20- import net .minecraft .registry .Registries ;
21- import net .minecraft .registry .RegistryKey ;
22- import net .minecraft .text .Text ;
23- import net .minecraft .util .Identifier ;
17+ import net .minecraft .client .particle .SingleQuadParticle ;
18+ import net .minecraft .core .particles .ParticleType ;
19+ import net .minecraft .core .particles .ParticleTypes ;
20+ import net .minecraft .core .registries .BuiltInRegistries ;
21+ import net .minecraft .network .chat .Component ;
22+ import net .minecraft .resources .Identifier ;
23+ import net .minecraft .resources .ResourceKey ;
2424import net .minecraft .util .Util ;
2525
2626public class Particles {
@@ -49,7 +49,7 @@ public static Particle modifyParticle(Particle particle, Identifier id) {
4949 float scale = AaronModConfigManager .get ().particles .scaling .getOrDefault (id , 1f );
5050
5151 //Only set the alpha if won't result in the particle being discarded by the fragment shader or if its not greater than the default
52- if (particle instanceof BillboardParticle billboard && billboard instanceof BillboardParticleAccessor accessor && alpha > 0.1f && alpha < accessor .getAlpha ()) {
52+ if (particle instanceof SingleQuadParticle billboard && billboard instanceof BillboardParticleAccessor accessor && alpha > 0.1f && alpha < accessor .getAlpha ()) {
5353 accessor .invokeSetAlpha (alpha );
5454 billboard .markHasCustomAlpha ();
5555 }
@@ -63,48 +63,48 @@ private static String getParticleDisplayName(String id) {
6363
6464 public static List <OptionGroup > getOptionGroups (AaronModConfig config ) {
6565 List <OptionGroup > list = new ArrayList <>();
66- List <Entry <RegistryKey <ParticleType <?>>, ParticleType <?>>> entryList = new ArrayList <>(Registries .PARTICLE_TYPE .getEntrySet ());
66+ List <Entry <ResourceKey <ParticleType <?>>, ParticleType <?>>> entryList = new ArrayList <>(BuiltInRegistries .PARTICLE_TYPE .entrySet ());
6767
6868 // Alphabetically sort the entries for logical ordering
6969 entryList .sort ((o1 , o2 ) -> {
70- String o1Name = getParticleDisplayName (o1 .getKey ().getValue ().toString ());
71- String o2Name = getParticleDisplayName (o2 .getKey ().getValue ().toString ());
70+ String o1Name = getParticleDisplayName (o1 .getKey ().identifier ().toString ());
71+ String o2Name = getParticleDisplayName (o2 .getKey ().identifier ().toString ());
7272
7373 return o1Name .compareTo (o2Name );
7474 });
7575
76- for (Entry <RegistryKey <ParticleType <?>>, ParticleType <?>> entry : entryList ) {
76+ for (Entry <ResourceKey <ParticleType <?>>, ParticleType <?>> entry : entryList ) {
7777 ParticleType <?> particleType = entry .getValue ();
78- Identifier id = entry .getKey ().getValue ();
78+ Identifier id = entry .getKey ().identifier ();
7979
8080 String name = getParticleDisplayName (id .getPath ());
8181 String namespaceName = getParticleDisplayName (id .getNamespace ());
82- Text description = PARTICLE_DESCRIPTIONS .containsKey (particleType ) ? Text .literal (PARTICLE_DESCRIPTIONS .get (particleType )) : Text .empty ();
82+ Component description = PARTICLE_DESCRIPTIONS .containsKey (particleType ) ? Component .literal (PARTICLE_DESCRIPTIONS .get (particleType )) : Component .empty ();
8383
8484 list .add (OptionGroup .createBuilder ()
85- .name (Text .literal (name + " Particles (" + namespaceName + ")" ))
85+ .name (Component .literal (name + " Particles (" + namespaceName + ")" ))
8686 .description (description )
8787 .collapsed (true )
8888
8989 //Toggle
9090 .option (Option .<Boolean >createBuilder ()
91- .name (Text .literal ("Enable " + name ))
91+ .name (Component .literal ("Enable " + name ))
9292 .binding (true ,
9393 () -> config .particles .states .getOrDefault (id , true ),
9494 newValue -> config .particles .states .put (id , newValue .booleanValue ()))
9595 .modifiable (!Main .OPTIFABRIC_LOADED )
9696 .controller (ConfigUtils .createBooleanController ())
9797 .build ())
9898 .option (Option .<Float >createBuilder ()
99- .name (Text .literal (name + " Scale Multiplier" ))
99+ .name (Component .literal (name + " Scale Multiplier" ))
100100 .binding (1f ,
101101 () -> config .particles .scaling .getOrDefault (id , 1f ),
102102 newValue -> config .particles .scaling .put (id , newValue .floatValue ()))
103103 .modifiable (!Main .OPTIFABRIC_LOADED )
104104 .controller (FloatController .createBuilder ().range (0f , 20f ).build ())
105105 .build ())
106106 .option (Option .<Float >createBuilder ()
107- .name (Text .literal (name + " Opacity" ))
107+ .name (Component .literal (name + " Opacity" ))
108108 .binding (1f ,
109109 () -> config .particles .alphas .getOrDefault (id , 1f ),
110110 newValue -> config .particles .alphas .put (id , newValue .floatValue ()))
0 commit comments