@@ -32,7 +32,9 @@ public class ParticlesEffect extends SpellEffect {
3232
3333 protected ConfigData <Particle > particle ;
3434
35+ protected ConfigData <Color > rgbColor ;
3536 protected ConfigData <Color > argbColor ;
37+
3638 protected ConfigData <Material > material ;
3739 protected ConfigData <BlockData > blockData ;
3840 protected ConfigData <DustOptions > dustOptions ;
@@ -70,7 +72,9 @@ public class ParticlesEffect extends SpellEffect {
7072 public void loadFromConfig (ConfigurationSection config ) {
7173 particle = ConfigDataUtil .getParticle (config , "particle-name" , Particle .POOF );
7274
73- argbColor = ConfigDataUtil .getARGBColor (config , "argb-color" , null );
75+ rgbColor = ConfigDataUtil .getColor (config , "color" , null );
76+ argbColor = ConfigDataUtil .getARGBColor (config , "argb-color" , null ).orDefault (rgbColor );
77+
7478 material = ConfigDataUtil .getMaterial (config , "material" , null );
7579 blockData = ConfigDataUtil .getBlockData (config , "material" , null );
7680 dustOptions = ConfigDataUtil .getDustOptions (config , "color" , "size" , new DustOptions (Color .RED , 1 ));
@@ -154,6 +158,12 @@ public Runnable playEffectLocation(Location location, SpellData data) {
154158 protected Object getParticleData (@ NotNull Particle particle , @ Nullable Entity entity , @ NotNull Location location , @ NotNull SpellData data ) {
155159 Class <?> type = particle .getDataType ();
156160
161+ if (type == Color .class ) {
162+ return particle == Particle .ENTITY_EFFECT ?
163+ argbColor .get (data ) :
164+ rgbColor .get (data );
165+ }
166+
157167 if (type == ItemStack .class ) {
158168 Material material = this .material .get (data );
159169 return material == null ? null : new ItemStack (material );
@@ -216,7 +226,6 @@ protected Object getParticleData(@NotNull Particle particle, @Nullable Entity en
216226 if (type == DustOptions .class ) return dustOptions .get (data );
217227 if (type == Particle .Spell .class ) return spellOptions .get (data );
218228 if (type == DustTransition .class ) return dustTransition .get (data );
219- if (type == Color .class ) return argbColor .get (data );
220229
221230 return switch (particle ) {
222231 case SHRIEK -> shriekDelay .get (data );
0 commit comments