Skip to content

Refactor ParticlePreset for additional types and update StarEventService - #27

Merged
Adammatthiesen merged 2 commits into
mainfrom
advanced-particles
Oct 21, 2026
Merged

Adammatthiesen merged 2 commits into
mainfrom
advanced-particles

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request significantly expands and refactors the ParticlePreset enum to provide a comprehensive mapping to Minecraft's vanilla particle types, and updates the particle resolution logic to leverage this new structure. The main changes are as follows:

Particle Preset Refactor and Expansion:

  • The ParticlePreset enum in ParticlePreset.java has been refactored to include a large number of Minecraft particle types, each explicitly mapped to its corresponding ParticleTypes constant. This replaces the previous limited set of presets and enables easier expansion and maintenance.
  • Each enum value in ParticlePreset now stores a reference to its corresponding ParticleOptions instance, with a new constructor and a getVanillaParticle() accessor method added to facilitate this.

Runtime Logic Simplification:

  • The resolveParticlePreset method in StarEventService.java has been simplified to use the new getVanillaParticle() method from ParticlePreset, removing the previous switch statement and making the code more maintainable and less error-prone.

These changes make it much easier to add or modify particle presets in the future and ensure that the runtime code remains concise and clear.

…te StarEventService to use getVanillaParticle method
… for better configuration management and add a method to retrieve particle presets as a formatted string
@Adammatthiesen
Adammatthiesen merged commit 0097428 into main Oct 21, 2026
1 check passed
@Adammatthiesen
Adammatthiesen deleted the advanced-particles branch October 21, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant