public class ParticleRegistry extends Object
A registry representing all particle name changes between various Spigot versions.
It consist of list containing a maps of ParticleNode nodes
for each significant Spigot version change.
This approach allows for fast access to ParticleNode nodes of
current particle name in running Spigot version using ParticleVersion enum
as index in the list. Next, it uses particle name as a key for returned map that
returns ParticleNode associated with current particle.
This node is then used to find certain's particle in desired Spigot version.
This registry takes some memory, but it only exists during class generation and will be garbage collected after implementations of interface instantiation finishes.
| Constructor and Description |
|---|
ParticleRegistry() |
| Modifier and Type | Method and Description |
|---|---|
Optional<String> |
find(SpigotParticleVersion from,
String name,
SpigotParticleVersion to)
Attempts to convert particle name from provided Spigot version
to target Spigot version.
|
public Optional<String> find(SpigotParticleVersion from, String name, SpigotParticleVersion to)
Attempts to convert particle name from provided Spigot version to target Spigot version.
from - a ParticleVersion enum representing Spigot
version of parameter particle name.name - a particle name in parameter from Spigot version.to - a ParticleVersion enum representing Spigot version
to which attempt of conversion should happen.Optional containing converted particle name or empty if particle has been removed
or non-existent in target Spigot version.Copyright © 2022. All Rights Reserved.