Skip to content

Commit

Permalink
Merge pull request #896 from TonytheMacaroni/main
Browse files Browse the repository at this point in the history
Support color for entity effect particle
  • Loading branch information
Chronoken committed May 18, 2024
2 parents a90a518 + 6b049bc commit 0c1ec06
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ParticlesEffect extends SpellEffect {

protected ConfigData<Particle> particle;

protected ConfigData<Color> color;
protected ConfigData<Material> material;
protected ConfigData<BlockData> blockData;
protected ConfigData<DustOptions> dustOptions;
Expand Down Expand Up @@ -57,6 +58,7 @@ public class ParticlesEffect extends SpellEffect {
public void loadFromConfig(ConfigurationSection config) {
particle = ConfigDataUtil.getParticle(config, "particle-name", Particle.POOF);

color = ConfigDataUtil.getARGBColor(config, "color", null);
material = ConfigDataUtil.getMaterial(config, "material", null);
blockData = ConfigDataUtil.getBlockData(config, "material", null);
dustOptions = ConfigDataUtil.getDustOptions(config, "color", "size", new DustOptions(Color.RED, 1));
Expand Down Expand Up @@ -161,6 +163,7 @@ protected Object getParticleData(Particle particle, Entity entity, Location loca
if (type == DustTransition.class) return dustTransition.get(data);
if (type == Float.class) return sculkChargeRotation.get(data);
if (type == Integer.class) return shriekDelay.get(data);
if (type == Color.class) return color.get(data);

return null;
}
Expand Down Expand Up @@ -191,6 +194,7 @@ protected Object getParticleData(Particle particle, Location location, SpellData
if (type == DustTransition.class) return dustTransition.get(data);
if (type == Float.class) return sculkChargeRotation.get(data);
if (type == Integer.class) return shriekDelay.get(data);
if (type == Color.class) return color.get(data);

return null;
}
Expand Down

0 comments on commit 0c1ec06

Please sign in to comment.