Package dev.cwhead.GravesX.compatibility
Class CompatibilityParticleEnum
java.lang.Object
dev.cwhead.GravesX.compatibility.CompatibilityParticleEnum
Handles compatibility for Particle enums to prevent runtime errors across versions.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CompatibilityParticleEnum
public CompatibilityParticleEnum()
-
-
Method Details
-
valueOf
Retrieves theParticle
value associated with the given particle name.For modern versions, this calls
Particle.valueOf(String)
via reflection. If the particle is not present on the running server, the method logs the error and returnsnull
.- Parameters:
particleName
- The particle name (e.g., "FLAME", "angry_villager").- Returns:
- The corresponding
Particle
value, ornull
if not found or an error occurs.
-