Class ParticleRegistry
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 SpigotParticleVersion 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind(SpigotParticleVersion from, String name, SpigotParticleVersion to) Attempts to convert particle name from provided Spigot version to target Spigot version.
-
Constructor Details
-
ParticleRegistry
public ParticleRegistry()
-
-
Method Details
-
find
Attempts to convert particle name from provided Spigot version to target Spigot version.
- Parameters:
from- aSpigotParticleVersionenum representing Spigot version of parameter particle name.name- a particle name in parameterfromSpigot version.to- aSpigotParticleVersionenum representing Spigot version to which attempt of conversion should happen.- Returns:
- an
Optionalcontaining converted particle name or empty if particle has been removed or non-existent in target Spigot version.
-