@@ -32,10 +32,13 @@ 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 ;
41+ protected ConfigData <Particle .Spell > spellOptions ;
3942 protected ConfigData <DustTransition > dustTransition ;
4043
4144 protected ConfigData <Vector > vibrationOffset ;
@@ -59,6 +62,7 @@ public class ParticlesEffect extends SpellEffect {
5962 protected ConfigData <Float > xSpread ;
6063 protected ConfigData <Float > ySpread ;
6164 protected ConfigData <Float > zSpread ;
65+ protected ConfigData <Float > dragonBreathPower ;
6266 protected ConfigData <Float > sculkChargeRotation ;
6367
6468 protected ConfigData <Boolean > force ;
@@ -68,11 +72,14 @@ public class ParticlesEffect extends SpellEffect {
6872 public void loadFromConfig (ConfigurationSection config ) {
6973 particle = ConfigDataUtil .getParticle (config , "particle-name" , Particle .POOF );
7074
71- 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+
7278 material = ConfigDataUtil .getMaterial (config , "material" , null );
7379 blockData = ConfigDataUtil .getBlockData (config , "material" , null );
7480 dustOptions = ConfigDataUtil .getDustOptions (config , "color" , "size" , new DustOptions (Color .RED , 1 ));
7581 dustTransition = ConfigDataUtil .getDustTransition (config , "color" , "to-color" , "size" , new DustTransition (Color .RED , Color .BLACK , 1 ));
82+ spellOptions = ConfigDataUtil .getSpellOptions (config , "spell.color" , "spell.power" , null );
7683
7784 vibrationOffset = ConfigDataUtil .getVector (config , "vibration-offset" , new Vector ());
7885 vibrationOrigin = ConfigDataUtil .getEnum (config , "vibration-origin" , ParticlePosition .class , ParticlePosition .POSITION );
@@ -91,12 +98,14 @@ public void loadFromConfig(ConfigurationSection config) {
9198 arrivalTime = ConfigDataUtil .getInteger (config , "arrival-time" , -1 );
9299 shriekDelay = ConfigDataUtil .getInteger (config , "shriek-delay" , 0 );
93100
101+ dragonBreathPower = ConfigDataUtil .getFloat (config , "dragon-breath-power" , 1 );
102+ sculkChargeRotation = ConfigDataUtil .getFloat (config , "sculk-charge-rotation" , 0 );
103+
94104 speed = ConfigDataUtil .getFloat (config , "speed" , 0.2f );
95105
96106 ConfigData <Float > horizSpread = ConfigDataUtil .getFloat (config , "horiz-spread" , 0.2f );
97107 xSpread = ConfigDataUtil .getFloat (config , "x-spread" , horizSpread );
98108 zSpread = ConfigDataUtil .getFloat (config , "z-spread" , horizSpread );
99- sculkChargeRotation = ConfigDataUtil .getFloat (config , "sculk-charge-rotation" , 0 );
100109
101110 ConfigData <Float > vertSpread = ConfigDataUtil .getFloat (config , "vert-spread" , 0.2f );
102111 ySpread = ConfigDataUtil .getFloat (config , "y-spread" , vertSpread );
@@ -149,6 +158,12 @@ public Runnable playEffectLocation(Location location, SpellData data) {
149158 protected Object getParticleData (@ NotNull Particle particle , @ Nullable Entity entity , @ NotNull Location location , @ NotNull SpellData data ) {
150159 Class <?> type = particle .getDataType ();
151160
161+ if (type == Color .class ) {
162+ return particle == Particle .ENTITY_EFFECT ?
163+ argbColor .get (data ) :
164+ rgbColor .get (data );
165+ }
166+
152167 if (type == ItemStack .class ) {
153168 Material material = this .material .get (data );
154169 return material == null ? null : new ItemStack (material );
@@ -209,12 +224,15 @@ protected Object getParticleData(@NotNull Particle particle, @Nullable Entity en
209224
210225 if (type == BlockData .class ) return blockData .get (data );
211226 if (type == DustOptions .class ) return dustOptions .get (data );
227+ if (type == Particle .Spell .class ) return spellOptions .get (data );
212228 if (type == DustTransition .class ) return dustTransition .get (data );
213- if (type == Float .class ) return sculkChargeRotation .get (data );
214- if (type == Integer .class ) return shriekDelay .get (data );
215- if (type == Color .class ) return argbColor .get (data );
216229
217- return null ;
230+ return switch (particle ) {
231+ case SHRIEK -> shriekDelay .get (data );
232+ case DRAGON_BREATH -> dragonBreathPower .get (data );
233+ case SCULK_CHARGE -> sculkChargeRotation .get (data );
234+ default -> null ;
235+ };
218236 }
219237
220238 protected Location getSpawnLocation (@ NotNull Particle particle , @ NotNull Location position , @ NotNull SpellData data ) {
0 commit comments